Operations Support API
# Operations Support API
# API Declaration
The "token" param must be contained in the header of the https request when calling the API.
Token is the only global API call credential for the Sobot API open platform. It is used when developers call the business APIs and thus should be properly kept. At least 32 chars should be reserved to store token. The validity period of token is currently 24 hours. It needs to be refreshed regularly or reacquired according to the token failure prompt returned by the API. When requesting the token API, regardless of the existence of token, a new token will be returned and its expiry time will be reset (currently 24 hours).
Token usage description: 1. Developers need to obtain and manage the token uniformly. When calling the Sobot open APIs of various businesses, they should use the same token, instead of refreshing and obtaining new tokens for each business. Otherwise, it will easily lead to token invalidation and affect the normal API call. 2. The current validity period of the token is transmitted by the returned expire_in, which is currently a value within 86,400 seconds. Developers need to refresh the new token in advance based on this valid time. 3. Developers should reacquire the token according to the token invalidation prompt returned by the API.
# Query marketing theme catalog
API description: Query marketing theme catalog
Request method:
POST
Request URL:
https://sg.sobot.io/marketing-open/api/5/marketing_subject_catalog/query_page
Request param:
Param | Type | Required | Description |
---|---|---|---|
catalogid | String | No | Marketing theme ID |
status | Integer | No | Marketing theme status (1 Normal -1 Delete) |
page_no | Integer | No | Start page (default 1) |
page_size | Integer | No | Query count (default 15, max 100) |
Return param:
Param | Type | Description |
---|---|---|
ret_code | String | Return code |
ret_msg | String | Return message |
items | Object | Return object |
page_count | String | Total pages |
page_no | String | Current page |
page_size | String | Pieces on each page |
total_count | String | Total pieces |
items object:
Param | Type | Description |
---|---|---|
catalogid | String | Marketing theme ID |
name | String | Marketing theme name |
status | String | Marketing theme status (1 Normal -1 Delete) |
Request example:
curl https://sg.sobot.io/marketing-open/api/5/marketing_subject_catalog/query_page
-X POST
-H 'content-type:application/json'
-H 'token: 4ac37cb2e9c740dba4b75a34d5358802'
-d '{
"page_no": 1,
"page_size": 15,
"status": 1,
"catalogid": 1123412432341234123412431
}'
2
3
4
5
6
7
8
9
10
Return example:
{
"items": [
{
"catalogid": 1123412432341234123412431,
"name": "test{dc_test}",
"status": 1
}
],
"page_count": 1,
"page_no": 1,
"page_size": 15,
"ret_code": "000000",
"ret_msg": "success",
"total_count": 1
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Query marketing theme
API description: Query marketing theme
Request method:
POST
Request URL:
https://sg.sobot.io/marketing-open/api/5/marketing_subject/query_page
Request param:
Param | Type | Required | Description |
---|---|---|---|
status | Integer | No | Marketing theme status(1 Normal -1 Delete) |
catalogid | String | No | Marketing theme catalog ID |
subjectid | String | No | Marketing theme ID |
page_no | Integer | No | Start page (default 1) |
page_size | Integer | No | Query count (default 15, max 100) |
Return param:
Param | Type | Description |
---|---|---|
ret_code | String | Return code |
ret_msg | String | Return message |
items | Object | Return object |
page_count | String | Total pages |
page_no | String | Current page |
page_size | String | Pieces on each page |
total_count | String | Total pieces |
items object:
Param | Type | Description |
---|---|---|
catalogid | String | Marketing theme catalog ID |
subjectid | String | Marketing theme ID |
subject | String | Marketing theme name |
status | Integer | Data status (1 Normal -1 Delete) |
Request example:
curl https://sg.sobot.io/marketing-open/api/5/marketing_subject/query_page
-X POST
-H 'content-type:application/json'
-H 'token: 4ac37cb2e9c740dba4b75a34d5358802'
-d '{
"page_no": 1,
"page_size": 15,
"status": "1",
"catalogid": 1123412432341234123412431,
"subjectid": "1123412472341234123412432"
}'
2
3
4
5
6
7
8
9
10
11
Return example:
{
"items": [
{
"catalogid": 1123412432341234123412431,
"subjectid": 1123412472341234123412432,
"subject": "test{dc_test_subject}",
"status": 1
}
],
"page_count": 2,
"page_no": 1,
"page_size": 12,
"ret_code": "000000",
"ret_msg": "success",
"total_count": 19
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# ● Multilingual content detail
Marketing theme grouping and marketing theme support multilingual content. The marketing theme grouping names and marketing theme names returned by the query interface may contain data in the format of "{dc_xxx}", and their specific information can be queried by querying multilingual details (opens new window).
# Error code
# ● Operation done
Error code | Error description |
---|---|
000000 | Operation done (Any code other than this code is an error code) |
# ● System exception
Error code | Error description |
---|---|
900001 | Null token |
900002 | token expired. Get a new one |
999994 | Param exception. Please check |
999999 | Unknown system exception |
← LINE API