Getting the List of Common Phrases
This interface is used to get all or specified category of common phrases under a certain customer service.
Request Method
GET /useful_expressions
Request Parameters (Query String)
Parameter Name | Type | Required | Description | Restrictions |
---|---|---|---|---|
catalog_id | Integer | Yes | Common phrase category id | |
agent_id | Integer | Yes | Id of the owner of the common phrase category | |
page | Integer | No | Page number, starting from 1, default is 1 | |
per_page | Integer | No | Number of items per page, default is 20, maximum is 100 |
Notes:
- catalog_id: Specific category id or 0, 0 represents all
- agent_id: Specific customer service id or 0, 0 represents the administrator
Return Data
Attribute Name | Type | Description |
---|---|---|
code | Integer | Execution result code, 1000 represents success |
useful_expressions | Array | List of common phrases |
meta | Object | Pagination related content, see Common Data |
Data structure of useful_expressions
Attribute Name | Type | Description |
---|---|---|
id | Integer | Common phrase id |
content | String | Common phrase content |
catalog_id | Integer | Common phrase category id |
Example
Request
curl https://demo.udesk.cn/open_api_v1/useful_expressions?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2&catalog_id=15&agent_id=12
Response
{
"code": 1000,
"useful_expressions": [
{
"id": 1,
"content": "content1",
"catalog_id": 4
},
{
"id": 2,
"content": "content2",
"catalog_id": 5
},
{
"id": 3,
"content": "content2",
"catalog_id": 6
},
{
"id": 4,
"content": "content4",
"catalog_id": 6
}
],
"meta": {
"current_page": 1,
"total_pages": 1,
"total_count": 4
}
}
Updating a Common Phrase
This interface is used to modify the content of a specific common phrase.
Request Method
PUT /useful_expressions/:id
Request Parameters (URL)
Parameter Name | Type | Required | Description | Restrictions |
---|---|---|---|---|
id | Integer | Yes | Common phrase id |
Request Parameters (Request Body)
Parameter Name | Type | Required | Description | Restrictions |
---|---|---|---|---|
content | String | Yes | Common phrase content | |
agent_id | Integer | Yes | Id of the creator of the common phrase |
Notes:
- agent_id value is a specific customer service id or 0, 0 represents the administrator
Return Data
Attribute Name | Type | Description |
---|---|---|
code | Integer | Execution result code, 1000 represents success |
id | Integer | Common phrase id |
content | String | Common phrase content |
catalog_id | Integer | Common phrase category id |
Example
Request
curl https://demo.udesk.cn/open_api_v1/useful_expressions/4?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2 \
-X PUT \
-H 'content-type: appliacation/json' \
-d '
{
"content": "content12",
"agent_id": 0
}
'
Response
{
"code": 1000,
"id": 4,
"content": "content12",
"catalog_id": 6
}
Adding a Common Phrase
This interface is used to create a new common phrase under a specific category of a customer service.
Request Method
POST /useful_expressions
Request Parameters (Request Body)
Parameter Name | Type | Required | Description | Restrictions |
---|---|---|---|---|
content | String | Yes | Common phrase content | |
catalog_id | Integer | Yes | Common phrase category id | |
agent_id | Integer | Yes | Id of the creator of the common phrase |
Notes:
- catalog_id: Specific category id
- agent_id: Specific customer service id or 0, 0 represents the administrator
Return Data
Attribute Name | Type | Description |
---|---|---|
code | Integer | Execution result code, 1000 represents success |
id | Integer | Common phrase id |
content | String | Common phrase content |
catalog_id | Integer | Common phrase category id |
Example
Request
curl https://demo.udesk.cn/open_api_v1/useful_expressions?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2 \
-X POST \
-H 'content-type: appliacation/json' \
-d '
{
"content": "kakkakakakakakakaka",
"agent_id": 0,
"catalog_id": 6
}
'
Response
{
"code": 1000,
"id": 4,
"content": "kakkakakakakakakaka",
"catalog_id": 6
}
Deleting a Common Phrase
This interface is used to delete a specific common phrase.
Request Method
DELETE /useful_expressions/:id
Request Parameters (URL)
Parameter Name | Type | Required | Description | Restrictions |
---|---|---|---|---|
id | Integer | Yes | Common phrase id |
Request Parameters (Request Body)
Parameter Name | Type | Required | Description | Restrictions |
---|---|---|---|---|
agent_id | Integer | Yes | Id of the creator of the common phrase |
Return Data
Attribute Name | Type | Description |
---|---|---|
code | Integer | Execution result code, 1000 represents success |
id | Integer | Common phrase id |
message | String | Result explanation |
Example
Request
curl https://demo.udesk.cn/open_api_v1/useful_expressions/4?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2 \
-X DELETE \
-H 'content-type: appliacation/json' \
-d '
{
"agent_id": 0
}
'
Response
{
"code": 1000,
"message": "Common phrase deleted successfully",
"id": "4"
}