post https://{domainname}/ca_apis/createBlockNumber
Using this API, you can create a Block Number group within your Cloud Agent account, allowing you to add multiple numbers.
Note:
Make sure the admin setting 'API Authentication' is set to 'BASIC_AUTH', If you are using this API.
Header parameters
Parameter | Description |
---|---|
apiKey* | Your CloudAgent account API Key |
Content-Type | application/json |
Body Params
{
"userName":"xxxxx",
"name":"xxxxxx",
"description":"xxxx",
"blockNumbers":"12345678966",
"expiryDate":"YYYY-MM-DD HH:MM:SS"
}
Parameter | Description |
---|---|
userName | Your CloudAgent account username |
name | Name for the block number group |
description | Enter the description for the group |
blockNumbers | Phone number to be added to 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 |
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 name key parameter. | { "status": "error","message": "Parameters are mandatory"} |
Passing invalid name value parameter | {"status": "error","message": "invalid data","errors": {"name": "Name (X) allows 2 to 50 characters only"}} |
Passing invalid description key parameter. | { "status": "error","message": "Parameters are mandatory"} |
Passing invalid description value parameter. | {"status": "error","message": "invalid data","errors": {"name": "Name (B) allows 2 to 50 characters only"}} |
Passing invalid blockNumbers value parameter. | {"status": "error","message": "invalid data","errors": {"blockNumbers": "Blocknumbers data contains invalid format of numbers"}} |
Successfully group is created with multiple numbers | "{""status"": ""success"",""message"": ""created"",""input"": {""name"": ""XXXX"",""description"": ""XXXX"", ""blockNumbers"": [ ""97XXX04XX3,98XXXXXX98,97XXXXXX97,90XXXXXX50,99XXXXXX66""]}, ""output"": {""affectedRows"": 1, ""lastInsertId"": 20,""succes"": [],""error"": [ ""97XXX04XX3,98XXXXXX98,97XXXXXX97,90XXXXXX50,99XXXXXX66""]}}" |