CreateUser

更新时间:
复制 MD 格式

Call the CreateUser operation to create a new agent in a specified instance.

Operation description

Creating an agent is equivalent to creating a Resource Access Management (RAM) sub-account. Agents in Cloud Contact Center are mapped to RAM sub-accounts. Therefore, the parameters for creating an agent are similar to those for creating a RAM account. For example, LoginName is the logon name for the RAM account. Email is the email address associated with the RAM account. This email address receives an email containing the initial logon password for the RAM account.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The instance ID.

ccc-test

LoginName

string

Yes

The logon name of the agent. It must be 4 to 64 characters in length and can contain uppercase letters, lowercase letters, digits, periods (.), underscores (_), and hyphens (-).

agent

DisplayName

string

Yes

The display name of the agent. It must be 1 to 128 characters in length.

坐席小王

Mobile

string

No

The personal phone number of the agent. This number is used in OFF_SITE mode. The agent can use this number to answer calls in OFF_SITE mode.

1382114****

Email

string

Yes

The email address of the agent. After the agent is created, an email is sent to this address. The email contains the logon URL for Cloud Contact Center, and the username and password for the RAM account. Keep this information secure.

username@example.com

WorkMode

string

No

The work mode.

Valid values:

  • ON_SITE :

    On-site mode

  • OFF_SITE :

    Off-site mode

  • OFFICE_PHONE :

    Office phone mode

ON_SITE

RoleId

string

Yes

The role ID. The format is Role@InstanceID. The following roles are supported: Admin (administrator), Manager (skill group leader), and Agent (agent).

Agent@ccc-test

SkillLevelList

string

No

A list of skill levels for skill groups. This is a string in the format of a JSON array. The array can contain up to 100 elements. Each element is an object that contains two fields: skillGroupId and skillLevel. For skillGroupId, enter the ID of the skill group to add. For skillLevel, enter the skill level to add. The value can range from 1 to 10. A smaller value indicates a higher skill level, meaning the agent can handle more calls per unit of time.

[{"skillGroupId":"skillgroup1@ccc-test","skillLevel":1},{"skillGroupId":"skillgroup2@ccc-test","skillLevel":10}]

ResetPassword

boolean

No

Specifies whether the agent must reset the password upon the first logon. If set to true, the agent is prompted to reset the password when they first log on to the RAM account. Otherwise, they are not prompted. The default value is false.

false

DisplayId

string

No

The agent's ID number. Set this as needed.

1001

AvatarUrl

string

No

The URL of the agent's profile picture.

http://abc.com/sam.jpg

Nickname

string

No

The agent's nickname.

老王

NeedEmailNotification

string

No

Specifies whether to send an email notification.

  • true: Send

  • false: Do not send

true

Response elements

Element

Type

Description

Example

object

Code

string

The response code.

OK

HttpStatusCode

integer

The HTTP status code.

200

Message

string

The response message.

RequestId

string

The request ID.

BA03159C-E808-4FF1-B27E-A61B6E888D7F

Data

object

The data.

DisplayName

string

The display name of the agent.

坐席小王

Extension

string

The agent's extension number.

8032****

Email

string

The email address.

username@example.com

LoginName

string

The logon name of the agent.

agent

WorkMode

string

The work mode.

Valid values:

  • ON_SITE :

    On-site mode

  • OFF_SITE :

    Off-site mode

  • OFFICE_PHONE :

    Office phone mode

ON_SITE

Mobile

string

The personal phone number of the agent.

1382114****

UserId

string

The agent ID.

agent@ccc-test

AvatarUrl

string

The URL of the agent's profile picture.

http://abc.com/sam.jpg

Nickname

string

The agent's nickname.

老王。

Params

array

The response parameters.

string

The response parameters.

Examples

Success response

JSON format

{
  "Code": "OK",
  "HttpStatusCode": 200,
  "Message": "无",
  "RequestId": "BA03159C-E808-4FF1-B27E-A61B6E888D7F",
  "Data": {
    "DisplayName": "坐席小王",
    "Extension": "8032****",
    "Email": "username@example.com",
    "LoginName": "agent",
    "WorkMode": "ON_SITE",
    "Mobile": "1382114****",
    "UserId": "agent@ccc-test",
    "AvatarUrl": "http://abc.com/sam.jpg",
    "Nickname": "老王。"
  },
  "Params": [
    "无"
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 Parameter.Blank The parameter %s may not be null or blank.
400 Parameter.Enumeration The parameter %s must be one of the value of enumeration %s.
400 Parameter.Maximum The parameter %s must be less than or equal to %s.
403 Permission.StsToken You have no permission to access sts token %s.
404 NotExists.InstanceId The specified instance %s does not exist.
404 NotExists.RoleId Role %s does not exist.
409 AlreadyExists.User User %s already exists in instance %s.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.