put https://{domainname}/ca_apis/updateBlockNumbers
Using this API, You can add multiple phone numbers to a Block Number group.
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",
"groupName":"xxxx",
"description":"xxxxx",
"expiryDate":"2024-09-10 10:15:12",
"blockNumbers": [
"xxxxxxxxxx",
"xxxxxxxxxx"
]
}
Parameter | Description |
---|---|
userName | Your CloudAgent account username |
groupName | Name of the group to be updated |
description | Enter the description for the group |
expiryDate | Add the expiry date for the number, this indicates the duration you want the number to remain in the blocked list. Format: YYYY-MM-DD HH:MM:SS |
blockNumbers | Phone numbers to be added to the group |
Rate Limit
This API supports the addition of up to 100 phone numbers in a single request.
Possible responses
Passing Invalid 'username' in Authorization | {"status": "error","message": "Authentication failed"} |
Passing Invalid 'password' in Authorization | {"status": "error","message": "Authentication failed"} |
Passing invalid Id key parameter. | { "status": "error","message": "Parameters are mandatory"} |
Passing invalid Id value parameter. | { "status": "error","message": "Invalid group id"} |
Passing invalid blockNumbers key parameter. | { "status": "error","message": "Parameters are mandatory"} |
Passing invalid blockNumbers value parameter. | {"status": "error","message": "invalid data","errors": {"blockNumbers": "Blocknumbers data contains invalid format of numbers"}} |
Successfully updating multiple numbers in a group | "{""status"": ""success"",""message"": ""updated"",""input"": {""id"": XX, ""blockNumbers"": [""97XXX04XX3"", ""97XXX0XX94"",""97XXX0XX95""]}, ""output"": {""succes"": [ ""+9197XXX04XX3"",""+9197XXX0XX94"", ""+9197XXX0XX95""], ""error"": [],""new"": 3,""inserted"": 3}}" |