Getting the List of Common Links
This interface is used to get all or specified category of common links under a certain customer service.
Request Method
GET /useful_links
Request Parameters (Query String)
| Parameter Name | Type | Required | Description | Restrictions |
|---|---|---|---|---|
| catalog_id | Integer | Yes | Common link category id | |
| agent_id | Integer | Yes | Id of the owner of the common link 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_links | Array | List of common links |
| meta | Object | Pagination related content, see Common Data |
Data structure of useful_links
| Attribute Name | Type | Description |
|---|---|---|
| id | Integer | Common link id |
| name | String | Common link name |
| url | String | Common link URL |
| catalog_id | Integer | Common link category id |
Example
Request
curl https://demo.udesk.cn/open_api_v1/useful_links?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_links": [
{
"id": 6,
"name": "Link 6",
"url": "https://www.baidu1.com",
"catalog_id": 11
},
{
"id": 8,
"name": "Link 8",
"url": "https://www.baidu1.com",
"catalog_id": 11
},
{
"id": 9,
"name": "Link 9",
"url": "https://www.baidu1.com",
"catalog_id": 11
},
{
"id": 10,
"name": "Link 10",
"url": "https://www.baidu1.com",
"catalog_id": 11
},
{
"id": 11,
"name": "Link 11",
"url": "https://www.baidu1.com",
"catalog_id": 11
}
],
"meta": {
"current_page": 1,
"total_pages": 1,
"total_count": 5
}
}
Updating a Common Link
This interface is used to modify a specific common link.
Request Method
PUT /useful_links/:id
Request Parameters (URL)
| Parameter Name | Type | Required | Description | Restrictions |
|---|---|---|---|---|
| id | Integer | Yes | Common link id |
Request Parameters (Request Body)
| Parameter Name | Type | Required | Description | Restrictions |
|---|---|---|---|---|
| name | String | No | Common link name | |
| url | String | No | Common link URL | |
| agent_id | Integer | Yes | Id of the creator of the common link |
Notes:
- agent_id value is a specific customer service id or 0, 0 represents the administrator
- The common link name and URL cannot both be empty in a single request
Return Data
| Attribute Name | Type | Description |
|---|---|---|
| code | Integer | Execution result code, 1000 represents success |
| id | Integer | Common link id |
| name | String | Common link name |
| url | String | Common link URL |
| catalog_id | Integer | Common link category id |
Example
Request
curl https://demo.udesk.cn/open_api_v1/useful_links/12?email=admin@udesk.cn×tamp=1494474404&sign=6892f1b794f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2 \
-X PUT \
-H 'content-type: appliacation/json' \
-d '
{
"name": "",
"url": "https://www.bai.com",
"agent_id": 4
}'
Response
{
"code": 1000,
"id": 12,
"name": "name",
"url": "https://www.bai.com",
"catalog_id": 12
}
Adding a Common Link
This interface is used to create a new common link under a specific category of a customer service.
Request Method
POST /useful_links
Request Parameters (Request Body)
| Parameter Name | Type | Required | Description | Restrictions |
|---|---|---|---|---|
| name | String | Yes | Common link name | |
| url | String | Yes | Common link URL | |
| catalog_id | Integer | Yes | Common link category id | |
| agent_id | Integer | Yes | Id of the creator of the common link |
Notes:
- catalog_id: Specific category id, there is no category with id 0
- 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 link id |
Example
Request
curl https://demo.udesk.cn/open_api_v1/useful_links?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 '
{
"name": "Link 10",
"url": "https://www.baidu1.com",
"catalog_id": 12,
"agent_id": 4
}
'
Response
{
"code": 1000,
"id": 12,
"name": "Link 10",
"url": "https://www.baidu1.com",
"catalog_id": 12
}
Deleting a Common Link
This interface is used to delete a specific common link.
Request Method
DELETE /useful_links/:id
Request Parameters (URL)
| Parameter Name | Type | Required | Description | Restrictions |
|---|---|---|---|---|
| id | Integer | Yes | Common link id |
Request Parameters (Request Body)
| Parameter Name | Type | Required | Description | Restrictions |
|---|---|---|---|---|
| agent_id | Integer | Yes | Id of the creator of the common link |
Return Data
| Attribute Name | Type | Description |
|---|---|---|
| code | Integer | Execution result code, 1000 represents success |
| id | Integer | Common link id |
| message | String | Result explanation |
Example
Request
curl https://demo.udesk.cn/open_api_v1/useful_links/7?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": 4
}'
Response
{
"code": 1000,
"id": "7",
"message": "Common link deleted successfully"
}