Updated on 2023-09-27 GMT+08:00

Querying Agent Account Information (agentAccount/query)

Scenario

Query agent account information. When the agent account condition is entered, the specified agent account is queried. If the pageNum and pageSize parameters are set but the agent account parameter is not set, batch query is performed.

Method

POST

URI

https://Domain name/apiaccess/rest/cc-management/v1/agentAccount/query. For example, the domain name is service.besclouds.com.

Request Description

Table 1 Request header parameters

No.

Name

Type

Mandatory or Not

Description

1

x-app-key

String

No

App key field, which is the user ID. Contact the operation personnel to obtain the app key.

2

Authorization

String

Yes

Authentication field. The format is Bearer {Value of AccessToken returned by the tokenByAkSk interface}. (A space is required after Bearer.)

Table 2 Request body parameters

No.

Name

Type

Mandatory or Not

Description

1

requestParams

Object

Yes

Request parameter object.

1.1

userAccount

String

No

Agent account. This parameter is mandatory when pageNum and pageSize are not contained. When userAccount is transferred, other input parameters are invalid.

1.2

pageNum

Integer

No

Page number. This parameter is valid when userAccount is not set. The value starts from 0.

1.3

pageSize

Integer

No

Size of each page. This parameter is valid when userAccount is not set.

1.4

agentType

Array

No

Agent type.

4: audio agent

11: video agent

5: multimedia agent

99: versatile agent

1.5

transparentDisplayFlag

Boolean

No

Agent anonymization flag.

Response Description

  • Status code: 200
    Table 3 Response body parameters

    No.

    Name

    Type

    Mandatory or Not

    Description

    1

    schema

    Object

    Yes

    Successful request.

    1.1

    resultCode

    String

    Yes

    The options are 0 (success) and 1 (failure).

    1.2

    resultMessage

    String

    Yes

    Returned message.

    1.3

    data

    Array [Object]

    No

    Returned result object.

    1.3.1

    userAccount

    String

    No

    Account.

    1.3.2

    userName

    String

    No

    Username.

    1.3.3

    phone

    String

    No

    Phone number.

    1.3.4

    email

    String

    No

    Email.

    1.3.5

    agentType

    Integer

    No

    Agent type.

    4: audio agent

    11: video agent

    5: multimedia agent

    99: versatile agent

    255: idle agent

    1.3.6

    ccRoleId

    Integer

    No

    Agent role ID.

    2: agent

    3: inspector

    4: outbound call agent

    255: idle role

    1.3.7

    sipAccount

    String

    No

    Default SIP phone number of an agent.

    1.3.8

    skills

    Array [Object]

    No

    Skill parameter array.

    1.3.8.1

    skillId

    Integer

    No

    Skill queue ID.

    1.3.8.2

    agentWeight

    Integer

    No

    Agent weight.

    1.3.8.3

    skillWeight

    Integer

    No

    Skill queue weight.

    1.3.9

    workNo

    Integer

    No

    Agent ID.

    1.3.10

    transparentDisplayFlag

    Boolean

    No

    Agent anonymization flag.

    1.4

    total

    Integer

    No

    Total number.

  • Status code: 400

    Incorrect request. Check the request path and parameters.

  • Status code: 401

    Unauthorized operation.

    1. Check whether you have purchased related services.

    2. Contact customer service to check the status of your account.

  • Status code: 404

    The requested content is not found. Check the request path.

  • Status code: 500

    Business failure. Check the values of parameters in the request.

Error Codes

None

Example

  • Scenario: Query an agent account.

Request header:

x-app-key: XXXXXXXXXXXXXXXXXXXXXXX
Content-Type: application/json
Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXX

Request parameters:

{
    "userAccount":"test123456"
}

Response parameters:

{ "data": [
      {"skills": [ { "skillId": 2,"agentWeight": 1, "skillWeight": 2}],
      "agentType": 11,
      "phone": "",
      "userAccount": "test123456",
      "ccRoleId": 2,
      "userName": "test111",
      "sipAccount": "88880551",
      "email": "tst@*****.com"
    }
  ],
  "resultCode": "0",
  "resultMessage": "get agent account info success"
}
  • Scenario: Query agents in pagination mode.

Request header:

x-app-key: XXXXXXXXXXXXXXXXXXXXXXX
Content-Type: application/json
Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXX

Request parameters:

{
  "pageNum":0,
	"pageSize":1
}

Response parameters:

{
  "data": [ { "skills": [{"skillId": 3,"agentWeight": 1, "skillWeight": 1} ],
        "agentType": 4,"phone": "","userAccount": "chenchuang0513",
        "ccRoleId": 2, "sipAccount": "88880550","userName": "chenchuang0513",
        "email": "che@*****.com"
      },...],
   "resultCode": "0",
   "resultMessage": "get agent account info success"
}