Data Ingestion

This API is used to ingest data into PangoCDP

This API is used to ingest data into PangoCDP and requires Authentication

Method

POST

Request Parameters

  • initData: [true, false]: Is used to determine the data in init stage or not (default=false)

payload

{
    "objectType":"OBJECT_TYPE",
    "source":"SOURCE_NAME",
    "jeConfigId":null,
    "jeEventKey":null,
    "entries":[
        { ENTITY_OBJECT }
    ],
    "ignoredUpdateCfs":[
       "customField01", "customFieldLong03"
    ]
}

Headers

Content-type: application/json

TOKEN: token

API_KEY: api_key

Headers

Name
Type
Required
Valid value / Description

Content-type

String

Yes

application/json

TOKEN

String

Yes

The token is created by calling the Authentication API

API_KEY

string

Yes

Api Key belongs to username

Request

Name
Type
Required
Valid value / Description
Example

objectType

String

Yes

Object Type. Valid value: OBJECT_TYPE

shopping-cart

source

String

The source where your data comes from.

CRM

jeConfigId

String

Journey Event Configuration ID.

Once you provide this value, Ingestion API will generate new Event data based on your given JE Id.

jeEventKey

String

Journey Event Configuration Key.

Once you provide this value, Ingestion API will generate new Event data based on your given JE KEY.

entries

Array

Yes

List of Objects following Object Type.

  • Max: 100 records / 1 request

  • Limit: [1- 50]

  • List of fields of each object type: ENTITY_OBJECT

[]

ignoredUpdateCfs

Array

List of custom fields that you don’t want to update to existing records.

Only apply to existing records.

This value is applied to ENTITY_OBJECT that has the tag: “SUPPORT_IGNORED_UPDATE_CFS”

[“customField01”]

Response

Type
Code
Example

Error

400

//ObjectType, Entity is missing
{
    "success": false,
    "errorCode": "MISSING_INFO",
    "message": "Invalid value of: objectType"
}
//Entity is empty
{
    "success": false,
    "requestId": "{REQUEST_ID}",
    "initData": false,
    "validRecords": 1,
    "invalidItems": 2,
    "errorCode": "MISSING_INFO",
    "invalidIds": [“Input_Id", “Input_Id2"],
    "message": "Invalid value of: entities, entity size [1-50]"
}
//Entity data is invalid
{
    "entity0": "Invalid value of: orderId",
    "entity1": "Invalid value of: orderStatus",
    "success": false,
    "errorCode": "MISSING_INFO",
    "message": "Some entities are invalid."
}

Error

401

{
    "success": false,
    "errorCode": "UNAUTHENTICATED",
    "message": null
}

Success

200

{
    "success": true
}

Payload Parameters:

Name
Type
Required
Valid value / Description
Example

objectType

String

Yes

Object Type value to determine Entity Object.

OBJECT_TYPE below

order

source

String

Yes

Source name that owns your data.

POS, Ecommerce,...

entries

List

Yes

This is a List of Entities.

  • Not null

  • Size: 1-50 entities

Entity Objects will be parsed based on objectType.

Please Refer to ENTITY_OBJECT tables

[ .. ]

Example

Payload Sample

{
    "objectType":"order",
    "source":"VTA",
    "entries":[
        {
            "orderId":"CDP_TEST_000002",
            "orderStatus":"Created",
            "customerId":"CU_000001",
            "customerName":"Nguyen Van A",
            "customerEmail":"vannguyen@gmail.com",
            "customerPhone":"0123456789",
            "createdBy":"user1",
            "createdAt":1584407426000,
            "updatedBy":null,
            "updatedAt":0,
            "recordStatus":"Active",
            "items":[
                {
                    "productSku":"SKU_0001",
                    "productName":"Product 1",
                    "price":150000,
                    "imageLink":"https://dma.mydatalakes.com/static/media/LogoCDP.24bbda4b.png",
                    "quantity":3
                }
            ],
            "customFieldTexts":{
                "customField01":"Value 1",
                "customField12":"Value 12"
            },
            "customFieldLongs":{
                "customFieldLong01":12,
                "customFieldLong12":3
            },
            "customFieldBooleans":{
                "customFieldBoolean01":true,
                "customFieldBoolean12":false
            },
            "customFieldDoubles":{
                "customFieldDouble01":12,
                "customFieldDouble12":3.6
            },
            "customFieldTimestamps":{
                "customFieldTimestamp01":12122121212121,
                "customFieldTimestamp12":12122121212121
            },
            "customFieldListTexts":{
                "customFieldList01":[
                    "V1",
                    "V2"
                ],
                "customFieldList12":[
                    "V3"
                ]
            }
        }
    ]
}

Response

{
    "success": true
}

Hướng dẫn tạo jeConfigId và jeEventKey trên hệ thống PangoCDP

  • Bước 1: Truy cập vào Module Console, chọn Custom Model nhận Data Ingestion

  • Bước 2: Chọn tính năng Data Manipulation, chọn thẻ User Event

  • Bước 3: Sử dụng tính năng + Add và nhập đầy đủ thông tin (tuỳ theo nhu cầu sử dụng) để tạo một Event trên User Event.

Trường nhập
Ý nghĩa

Trigger when

Tạo một User Event khi có một Data trong Model được tạo ra hoặc thay đổi thông tin

Event Key

Tham số định danh duy nhất của Event. Hệ thống tự tạo, không nhập, không thay đổi

Event Name

Tên Event được tạo trên User Event Ví dụ: create_order, delivery_order

Event Time

Thời gian của Event được sinh ra khi: + Dữ liệu được tạo ra/cập nhật vào Model + Theo trường thời gian tạo ra/cập nhật được Ingest vào Model

Channel

Kênh ghi nhận dữ liệu: thông tin + None + Online + Offline

Category

Danh mục dữ liệu: chọn thông tin phù hợp

Sub Category

Nhập danh mục phụ

Filter

Thêm các điều kiện lọc dữ liệu trong Model

Update Value

Gán các giá trị cần sử dụng từ Model vào dữ liệu trên Event được sinh ra trong User Event

Disable/Enable

Trạng thái kích hoạt

  • Bước 4: Sau khi hoàn tất việc tạo, đảm bảo Enable để tính năng có thể hoạt động

    • jeConfigId: sử dụng value của trường ID

    Ví dụ: "id":"890e4b921b11ee870b36f6b36959decd-Created-EWal77RxKcLjsew"

    • jeEventKey: sử dụng value của trường eventNameKey

    Ví dụ: "eventNameKey":"CJE-MA9CNMC7ZA.KFUBAVXEGZ"

  • Bước 6: Dùng hai giá trị này ⇒ thêm vào Payload khi thực hiện Data Ingestion vào hệ thống PangoCDP ⇒ khi dữ liệu được thêm vào Model sẽ tạo ra User Event đã thiết lập. Tối đa 200 events được tạo ra trên User Event trong một Request Ingest Data.

Last updated

Was this helpful?