This API is used to create new phone number details in CloudAgent. The user has to update the ‘action’ parameter with the create. For example, if the action parameter = Create along with the following parameters, this API creates a new phone number.
To use this API with the help of a token, follow these steps:
- Generate the Token: Use the 'Generate Token' API to obtain an authentication token.
 - Enter the Token ID: Navigate to the right section of this page, under the 'AUTHORIZATION' tab. Here, input the generated token ID.
 - With the token entered, pass the below header and body parameters:
 
Header parameters
| Parameter | Description | 
|---|---|
| Content-Type | application/json | 
Body Params
{
"userName":"xxxx",
"action":"create",
"phoneNumber":"xxxxx",
"phoneName":"xxxxxx",
"skill":"xxx"}
| Parameter | Description | 
|---|---|
| action* | "create" to create a new phone number | 
| userName* | CloudAgent user name | 
| phoneNumber* | The phone number that is to be created. | 
| phoneName* | Optional name to the Phone number or lead adding. | 
| skill | To assign skills while creating the phone number | 
Note
- Parameters with ‘*’ are considered to be mandatory parameters.
 - phoneNumber with special characters(+1, +91 etc.,) are to be encoded(add %2B instead of ‘+’) while passing in the request.
 - The ‘phoneName’ parameter is not case-sensitive.
 
Possible responses
Success response  | "status": "success"  | 
Invalid api_key  | "status": "error"  | 
Invalid action  | "status": "error"  | 
Invalid phoneNumber  | "status": "error"  | 
Invalid username  | "status": "error"  | 
Empty phoneName  | "status": "error"  | 
Empty phoneNumber  | "status": "error"  | 
Number/Name exists  | "status": "error"  | 
Passing invalid phoneNumber like less than 3 digits or more than 16 digits  | "status":"error","message":"phoneNumber should be between 3 to 17 digits long and allows prefix +"  | 
Passing phoneName with special characters  | "status":"error","message":"phoneName should be between 2 to 50 alphanumeric characters long allows prefix + and special characters like .,@,_,- and Name cannot start and end with Special characters."  | 
If the phone number creation limit exceeded  | "status": "error"  | 
Invalid Skill Key  | "status": "success"  | 
Missing Skill Value  | "status": "success"  | 
