logo

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 NameTypeRequiredDescriptionRestrictions
catalog_idIntegerYesCommon link category id
agent_idIntegerYesId of the owner of the common link category
pageIntegerNoPage number, starting from 1, default is 1
per_pageIntegerNoNumber 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 NameTypeDescription
codeIntegerExecution result code, 1000 represents success
useful_linksArrayList of common links
metaObjectPagination related content, see Common Data

Data structure of useful_links

Attribute NameTypeDescription
idIntegerCommon link id
nameStringCommon link name
urlStringCommon link URL
catalog_idIntegerCommon link category id

Example

Request

curl https://demo.udesk.cn/open_api_v1/useful_links?email=admin@udesk.cn&timestamp=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
    }
}

This interface is used to modify a specific common link.

Request Method

PUT /useful_links/:id

Request Parameters (URL)

Parameter NameTypeRequiredDescriptionRestrictions
idIntegerYesCommon link id

Request Parameters (Request Body)

Parameter NameTypeRequiredDescriptionRestrictions
nameStringNoCommon link name
urlStringNoCommon link URL
agent_idIntegerYesId 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 NameTypeDescription
codeIntegerExecution result code, 1000 represents success
idIntegerCommon link id
nameStringCommon link name
urlStringCommon link URL
catalog_idIntegerCommon link category id

Example

Request

curl https://demo.udesk.cn/open_api_v1/useful_links/12?email=admin@udesk.cn&timestamp=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
}

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 NameTypeRequiredDescriptionRestrictions
nameStringYesCommon link name
urlStringYesCommon link URL
catalog_idIntegerYesCommon link category id
agent_idIntegerYesId 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 NameTypeDescription
codeIntegerExecution result code, 1000 represents success
idIntegerCommon link id

Example

Request

curl https://demo.udesk.cn/open_api_v1/useful_links?email=admin@udesk.cn&timestamp=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
}

This interface is used to delete a specific common link.

Request Method

DELETE /useful_links/:id

Request Parameters (URL)

Parameter NameTypeRequiredDescriptionRestrictions
idIntegerYesCommon link id

Request Parameters (Request Body)

Parameter NameTypeRequiredDescriptionRestrictions
agent_idIntegerYesId of the creator of the common link

Return Data

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success
idIntegerCommon link id
messageStringResult explanation

Example

Request

curl https://demo.udesk.cn/open_api_v1/useful_links/7?email=admin@udesk.cn&timestamp=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"
}