logo

Explanation of some field values

Corresponding values of employee type (profile)

Value
all
im
call
ticket
dial

ucpapp_subaccount

Attribute NameTypeDescription
numberStringSIP account
passwordStringSIP password
lang value range
ValueMeaning
zh-cnSimplified Chinese
en-usAmerican English

Get the list of customer service representatives

This interface is used to obtain multiple customer service information at one time

Request Method

GET /agents

Request Parameters (Query String)

Parameter NameRequiredTypeDescriptionLimitations
pageNoIntegerPage number, starting from 1, default is 1
per_pageNoIntegerNumber of items per page, default is 20, maximum is 100
with_disabledNoStringWhether to include disabled customer service representatives, default is false (does not include disabled customer service representatives)true or false

Returned Data

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 means success
metaObjectPagination information, see Common Data for details
agentsArrayList of customer service representatives, see customer service data for the description of each customer service representative

Customer Service Data

Attribute NameTypeDescription
idIntegerUnique identifier
emailStringEmail address
nick_nameStringName
profileStringEmployee type
aliaseStringExternal nickname
cellphoneStringMobile phone number
role_nameStringRole
dutyStringEmployee position
im_ability_valueIntegerConversation skill value
user_group_idsArrayList of customer service group IDs
passwordStringCall center SIP account information
numberStringCall center SIP account information
avatarStringAvatar
work_idStringWork number
departmentsObjectDepartment to which it belongs, including id (department ID) and name (department name), see example for details
agent_callout_display_numberStringOutbound display number
disable_statusStringStatus
availabilityStringWhether to receive automatic assignment of work orders
im_welcomesStringWelcome message
langStringLanguage preference

Example

curl https://demo.udesk.cn/open_api_v1/agents?page=1&per_page=10&email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2

Returns

{
"code": 1000,
"meta": {
"current_page": 1,
"total_pages": 1,
"total_count": 1
},
"agents": [
{
"id": 1,
"email": "agent1@sample.com",
"nick_name": "Test Customer Service 1",
"profile": "im",
"aliase": null,
"cellphone": "13300000001",
"role_name": "agent",
"duty": null,
"im_ability_value": 10,
"user_group_ids": [1,2],
"number": "100000000",
"password": "xxxxxxxx",
"avatar": null,
"work_id": "",
"departments": [
{
"id": 1,
"name": "demo"
}
],
"agent_callout_display_number": "10000000000",
"disable_status": "enable",
"availability": true,
"im_welcomes": null,
"lang": null
}
]
}

Get Customer Service Details

This interface is used to obtain customer service information under specified conditions.

Request Method

GET /agents/get_agent

Request Parameters (Query String)

Parameter NameTypeRequiredDescriptionRestrictions
typestringYesCondition type, see below for details
contentstringYesCondition content

Condition Type

ValueCorresponding content meaning
idCustomer service ID
emailCustomer service email

Returned Data

Attribute NameTypeDescription
codeintExecution result code, 1000 means success
agentobjectCustomer service information

Customer Service Data

Attribute NameTypeDescription
idintUnique identifier
emailstringEmail address
nick_namestringName
profilestringEmployee type
aliasestringExternal nickname
cellphonestringMobile phone number
role_namestringRole
dutystringEmployee position
user_group_idsarrayList of customer service group IDs
im_ability_valueintConversation skill value
work_idstringJob number
disable_statusstringEnable or disable status (enable/disable)
availabilitybooleanWhether to accept automatic work order distribution
passwordstringCall center SIP account information
numberstringCall center SIP account information
avatarstringAvatar
departmentsobjectDepartment to which it belongs
agent_callout_display_numberstringOutbound display number
im_welcomesstringWelcome message
langstringLanguage preference
user_groupsarrayInformation of the customer service group to which it belongs, see example
agent_rolesarrayInformation of the role to which it belongs, see example

Example

curl https://demo.udesk.cn/open_api_v1/agents/get_agent?email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
&type=id&content=1

Returns

{
"code": 1000,
"agent": {
"id": 1,
"email": "agent1@sample.com",
"nick_name": "Test Customer Service 1",
"profile": "im",
"aliase": null,
"cellphone": "13300000001",
"role_name": "agent",
"duty": null,
"user_group_ids": [1,2],
"im_ability_value": 10,
"work_id": "123",
"disable_status": "enable",
"availability": true,
"number": "100000000",
"password": "xxxxxxxx",
"avatar": null,
"lang": "zh-cn",
"im_welcomes": null,
"user_groups": [
{
"id": 1,
"name": "Test Group"
}
],
"agent_roles": [
{
"id": 11,
"name": "Customer Service"
}
],
"departments": [
{
"id": 1,
"name": "Customer Service Group 1"
}
],
"agent_callout_display_number": "100000000"
}
}

Create Customer Service

This interface is used to create customer service.

Request Method

POST /agents

Request Parameters (request body)

Parameter NameTypeRequiredDescriptionRestrictions
agentobjectYesCustomer service information, see below
Structure of agent
Parameter NameTypeRequiredDescriptionRestrictionsDefault Value
emailstringYesEmail address, used as accountNot more than 255 characters
passwordstringYesPasswordNot more than 255 characters
agent_role_idsarrayYesRole ID, comma-separated numbers, maximum length of array is 10
user_group_idsarrayYesEmployee group ID, comma-separated numbers, maximum length of array is 10
department_idsarrayYesDepartment ID, comma-separated numbers, maximum length of array is 10
im_ability_valueintYesConversation skill value
nick_namestringNoNameNot more than 255 charactersnull
aliasestringNoNicknameNot more than 255 charactersnull
cellphonestringNoPhone numberNot more than 255 charactersnull
profilestringNoEmployee typeNot more than 255 charactersim
dutystringNoPositionNot more than 255 charactersnull
im_welcomesstringNoWelcome messagenull
availabilitybooleanNoWhether to accept automatic work order distributiontrue
avatarstringNoAvatar URLnull
work_idstringNoJob numbernull
callout_number_idintNoOutbound display number IDnull
langstringNoLanguage preferencenull
Note:
  • The value of agent_role_ids can be obtained in the role list, and non-company agent_role_id will be removed in the request.
  • The value of user_group_ids can be obtained in the customer service group list, and non-company user_group_id will be removed in the request.
  • The value of department_ids can be obtained in the department list, and non-company department_id will be removed in the request.
  • The value of callout_number_id can be obtained in the call center interface-Get call center trunk number list.

Returned Data

Attribute NameTypeDescription
codeintExecution result code, 1000 means success
agent_idintID of the newly created customer service

Example

Request

curl https://demo.udesk.cn/open_api_v1/agents?email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
\
-X POST \
-H 'content-type:application/json' \
-d '
{
"agent":{
"email": "agent_001@udesk.cn",
"password": "agent12345",
"nick_name": "agent_001",
"aliase": "agent_001",
"cellphone": "13123456789",
"profile": "all",
"agent_role_ids": [1,2],
"user_group_ids": [2],
"im_ability_value": 1,
"department_ids": [1,3],
"duty": "Department Manager",
"im_welcomes": "Welcome",
"availability": false,
"avatar": "http://attachments.gfan.com/forum/attachments2/201302/03/11281446n2st1its4152n5.jpg",
"lang": "en-us"
}
}'

Returns

{
"code": 1000,
"agent_id": 1
}

Modify Customer Service Agent

This interface is used to modify the basic information of an existing customer service agent.

Request

PUT agents/:id

Request Parameters (URL)

Parameter NameTypeRequiredDescriptionRestrictions
idIntegerYesCustomer service agent ID
with_disabledStringNoWhether to include disabled agents

Request Parameters (Request Body)

Parameter NameTypeRequiredDescriptionRestrictions
agentObjectYesCustomer service information, details below
Agent Structure
Parameter NameTypeRequiredDescriptionRestrictions
emailStringNoAccountNo more than 255 characters
passwordStringNoPasswordNo more than 255 characters
nick_nameStringNoNameNo more than 255 characters
aliaseStringNoNicknameNo more than 255 characters
cellphoneStringNoPhone numberNo more than 255 characters
profileStringNoEmployee type, details belowNo more than 255 characters
agent_role_idsArrayNoRole IDs
user_group_idsArrayNoEmployee group IDs
im_ability_valueIntegerNoChat skill value
department_idsArrayNoDepartment IDs
dutyStringNoPositionNo more than 255 characters
im_welcomesStringNoWelcome message
availabilityBooleanNoWhether to accept automatic ticket assignment
avatarStringNoAvatar URL
work_idStringNoEmployee ID
disable_statusStringNoEnable or disable statusEnable or disable
callout_number_idIntegerNoOutbound calling display number ID
langStringNoLanguage preference
Note: Only modify the parameters provided in the request, do not modify what is not included.

Response Data

Property NameTypeDescription
codeIntegerExecution result code, 1000 represents success
agentObjectDetails below
Agent Structure
Property NameTypeDescription
idIntegerCustomer service agent ID
emailStringAccount
nick_nameStringName
aliaseStringNickname
cellphoneStringPhone number
profileStringEmployee type
agent_rolesArrayRoles
user_groupsArrayEmployee groups
im_ability_valueIntegerChat skill value
departmentsArrayDepartments
dutyStringPosition
im_welcomesStringWelcome message
availabilityBooleanWhether to accept automatic ticket assignment
avatarStringAvatar URL
langStringLanguage preference
agent_callout_display_numberStringOutbound calling display number
disable_statusStringEnable or disable status
work_idStringEmployee ID
numberStringIP phone number
passwordStringIP phone password

Example

Request

curl https://demo.udesk.cn/open_api_v1/agents/1?email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2 \
-X PUT \
-H 'content-type: application/json' \
-d '{
    "agent":{
        "email": "agent_0010@udesk.cn",
        "nick_name": "agent_0010",
        "aliase": "agent_0010",
        "cellphone": "15834234893",
        "profile": "all",
        "work_id": null,
        "disable_status": "enable",
        "number": "97425540622337",
        "password": "6ab7d5b8d8472241",
        "agent_role_ids" :[1,4],
        "user_group_ids" :[2],
        "im_ability_value" : 1,
        "department_ids" :[1,3],
        "duty": "Department Manager",
        "im_welcomes": "",
        "availability": true,
        "avatar": ""
    }
}'

Response

{
    "code": 1000,
    "agent":{
        "id": 1,
        "email": "agent_0010@udesk.cn",
        "nick_name": "agent_0010",
        "aliase": "agent_0010",
        "cellphone": "15834234893",
        "profile": "all",
        "agent_roles": [{"id":1,"name":"role 1"}, {"id":4,"name":"role 4"}],
        "user_groups": [{"id":2,"name":"Agent Group 1"}],
        "im_ability_value": 1,
        "departments": [{"id":1,"name":"Department 1"}, {"id":3,"name":"Department 3"}],
        "duty": "Department Manager",
        "im_welcomes": "",
        "availability": true,
        "lang": "zh-cn",
        "avatar": "",
        "work_id": "1231",
        "disable_status": "enable",
        "number": "98151643491111",
        "password": "23fece86b5841f17"
    }
}

Delete Customer Service Agent

This interface is used to delete a specified customer service agent.

Request

DELETE agents/:id

Request Parameters (URL)

Parameter NameTypeRequiredDescriptionRestrictions
idIntegerYesCustomer service agent ID

Request Parameters (Request Body)

Parameter NameTypeRequiredDescriptionRestrictions
owner_group_idIntegerYesCustomer service group ID
owner_idIntegerNoCustomer service agent ID

Note: After deleting a customer service agent, the customers responsible for by this agent will be transferred to another customer service group/agent. The provided owner_id must be within the owner_group_id. If no owner_group_id and owner_id are provided in the request, the responsible agent/group for the customers of this agent will be set to empty. If the owner_group_id is empty in the request, the responsible agent/group for the customers of this agent will be set to empty.

Response Data

Property NameTypeDescription
codeIntegerExecution result code, 1000 represents success
messageStringExecution result description

Example

Request

curl https://demo.udesk.cn/open_api_v1/agents/1?email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2 \
-X DELETE \
-H 'content-type: application/json' \

Response

{
    "code": 1000,
    "message": "The customer service agent with ID 1 has been successfully deleted"
}

Get Role List

This interface is used to obtain the role list information under the current company.

Request Method

GET /agent_roles

Request Parameters

None

Response Data

Property NameTypeDescription
codeIntegerExecution result code, 1000 represents success
agent_rolesArrayDetails below
agent_roles Structure
Parameter NameTypeDescription
idIntegerRole ID
nameStringRole name
descriptionStringRole description

Example

Request

curl https://demo.udesk.cn/open_api_v1/agent_roles?email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2 \
-X GET \
-H 'content-type: application/json' \

Response

{
    "code": 1000,
    "agent_roles": [
        {"id": 1, "name": "Role 1", "description": ""},
        {"id": 2, "name": "Role 2", "description": ""},
        {"id": 3, "name": "Role 3", "description": ""}
    ]
}

Error Code Description

Error CodeMessage InformationException:message InformationDescription
2000The resource does not exist, please check the input parametersNoneWhen a custom field is set as required, the parameter {custom_fields} is not filled in or does not meet the requirements
XXX is required, XXX is requiredNoneRequired parameter {XXX} is not filled in
The employee type cannot be assigned this permissionNoneParameter {profile} is not filled in
The email has been occupiedNoneParameter {email} is already in use
The callout_number_id value is invalidNoneParameter {callout_number_id} is not within the valid range
The current type of employee has reached the limitNoneThe number of customer service agents corresponding to parameter {profile} has reached the company's limit
Verification failed: the password must be different from the email addressNoneParameter {password} is the same as parameter {email}
The customer service agent has responsible customers and cannot be deletedNoneThe agent specified by parameter {id} has responsible tickets and customers
Unknown errorparam is missing or the value is empty: agentRequired parameter {agent} is not filled in
comparison of Fixnum with nil failedThe input parameter is out of range or the data was not found
2005The resource does not exist, please check the input parametersNoneParameters {type} and {content} did not match any data
No such resource was foundNoneThe request parameter {id} is incorrect, no matching data was found
11006NoneNoneThe employee IM is online, cannot be updated
11007NoneNoneThe employee has some IM sessions that are not closed, cannot be updated