api-dynamic-item

API to import a list items to CDP system

Noted: Access to CDP admin tool to defined item and item attributes before call this api.

Import dynamic Item

POST https://api.cdp.asia/be/item

Query Parameters

Name
Type
Description

token

string

Private key API for each Portal / Client (Request to help desk admin CDP to get token)

item_type

string

item types has defined on cdp admin tool. such as: product, shop,...

scope

string

upsert is **using fixed value

portal_id

string

Portal ID

Request Body

Name
Type
Description

attribute_5

object

The attributes type object.

attribute_4

array

some attributes type array : array string, array number, array date-time

attribute_3

boolean

The attributes type boolean true or

attribute_2

number

The attributes type number

attribute_1

string

The attributes type string

name

string

item name

id

string

item id

{
    "msg": "success. list size:1",
    "status": true,
    "data": {
        "lost_time": "48ms",
        "version": "20200227"
    },
    "code": 200
}

A - Attributes input parameters

name

data

attribute 1

string

"string value"

attribute 2

number

10000 or 10000.9 or 0.1

attribute 3

boolean

true or false

attribute 4

datetime

"2020-03-27 05:58:10" . (yyyy-MM-dd HH:mm:)

attribute 5.1

array_string

["Thor","Caption american", "Iron man"]

attribute 5.2

array_number

[1,2,3]

attribute 5.3

array_

["2020-03-27 05:58:10","2020-03-27 05:58:11"]

attribute 6

object

{ "key_string":"xxxx", "key_number":10000, "key_datetime":"2020-03-17 00:00:00", "key_boolean":true }

B - Sample import a dynamic item type

1. API request

https://api.cdp.asia/be/delivery/item?scope=upsert&portal_id=PORTAL_ID&token=THE_API_TOKEN&item_type=ITEM_TYPE_CODE

2. Data

[
{
"id":"x1",
"name":"name of x1",
"type":"x",
"attr_number":10000,
"attr_boolean":true,
"attr_datetime":"2020-03-17 23:00:00",
"attr_string":"Description about item x",
"attr_bject":{
"key_string":"xxxx",
"key_number":10000,
"key_datetime":"2020-03-17 00:00:00",
"key_boolean":true
}
}
]

Last updated

Was this helpful?