Add Campaign Data (Token authentication)

To add campaign data with the use of a token, follow these steps:

  1. Generate the Token: Use the 'Generate Token ' API to obtain an authentication token.
  2. Enter the Token ID: Navigate to the right section of this page, under the 'AUTHORIZATION' tab. Here, input the generated token ID.
  3. Add Campaign Data: With the token entered, pass the below header parameters:
ParameterDescription
Content-Type*Should be - "application/json"
apiKey*Provide the API key of your account. Available in CloudAgent after admin login.
  1. Pass the BODY PARAMS in the following format:
{
    "campaignName": "xxxxxx",
    "phoneNumber": "830xxxxxxx",
    "Name": "xxxxx",
    "action": "xxxxx",
    "skill": "xxxxx",
    "priority": "xx",
    "agentId": "xxxxx",
    "expiryDate": "YYYY-MM-DD",
    "checkDuplicate": "xxxx",
    "userName": "xxxxxx"
}

Below is the description of the parameters to be passed:

ParameterDescription
campaignName*Name of the campaign where the data is to be added
phoneNumber*Phone number of the lead
NameOptional name to the phone number or lead being added.
actionIf the parameter value passes as 'START', API starts the campaign simultaneous to adding data.
skillUnique skill assigned to agents to which the call is routed.
priorityThe higher the priority value(1-99) assigned to the phoneNumber, the faster the number gets
dialed.
agentIdUnique ID for every agent irrespective of campaign
expiryDateIt Is the last date set to the number to be valid in the dialer. Format is YYYY-MM-DD
checkDuplicateThis parameter checks for any duplicate numbers in the campaign.
If the parameter is passed as "TRUE", API avoids adding duplicate numbers to the campaign.
If the parameter is passed as "FALSE', API doesn't check for duplicates and adds the data to the campaign.
userName*Your CloudAgent acoount user name.

Possible responses

Adding data when the token expired"{
""status"": ""false"",
""message"": ""Token Expired"",
""data"": null
}"
Adding data when the token is empty/Null"{
""status"": ""false"",
""message"": ""Token Should Not be Null or Empty."",
""data"": null
}"
Add data when the setting is set is set to "BasicAuth"/"NONE'"{
""status"": ""false"",
""message"": ""Invalid action."",
""data"": null
}"
Missing api_key parameter"{
""status"": ""false"",
""message"": ""Api Key Should Not be Null or Empty."",
""data"": null
}"
Invalid api_key / Empty api_key value"{
""status"": ""false"",
""message"": ""Invalid User Details"",
""data"": null
}"
Empty campaign name key / Invalid camapign name key/ campaign name value missing"{
""status"": ""Error"",
""message"": ""Please provide campaign details""
}"
Invalid campaign name value"{""status"": ""FAIL"",
""message"": ""No User Found or Campaign Name is Invalid""}"
phone number key missing / Invalid phone number Key / Invalid phone number value / Empty phone number value"{""status"": ""error"",
""message"": ""phone number should be numeric and must be between 3 to 16 digits and allows prefix +""}"
Valid phone number value"""{
""""status"""": """"Success"""",
""""message"""": """"Campaign xxxxx Is Already Started""""
}"""
action key is invalid"{
""status"": ""Success"",
""message"": ""SuccessFully Updated xxxx Campaign""
}"
"Success response when
action = stop"
"{
""status"": ""Success"",
""message"": ""SuccessFully Updated Progressive Campaign Stoped""
}"
"Success response when
action = start"
{"status": "SUCCESS", "message": "SuccessFully Updated, IVR was started"}
"Success response when
action is blank / missing / invalid
"{
""status"": ""Success"",
""message"": ""Please pass the valid Campaign action SuccessFully Updated xxxxx Campaign Data""
}"
A number already exists and parameter passed
checkDuplicate=true
{"status": "SUCCESS", "message": "Number Already Exist"}
A number already exists and parameter passed
checkDuplicate=false / blank / missing / invalid
{"status": "SUCCESS", "message": "SuccessFully Updated, xxx was started"}
checkDuplicate number key is missing"{
""status"": ""Success"",
""message"": ""Campaign xxxxx Is Already Started""
}"
username key is missing / username key empty OR null / username key is invalid"{
""status"": ""false"",
""message"": ""Username Should Not be Null or Empty."",
""data"": null
}"
username value is valid"""""""{
""""""""status"""""""": """"""""Success"""""""",
""""""""message"""""""": """"""""Campaign xxxx Is Already Started""""""""
}"""""""
username value is invalid"{
""status"": ""false"",
""message"": ""Invalid User Details"",
""data"": null
}"
priority key is missing / priority key with invalid priority value / priority key is invalid and value is valid / priority value is invalid / priority value is valid "{
""status"": ""Success"",
""message"": ""SuccessFully Updated xxxxx Campaign""
}"
priority value is missing"{
""status"": ""Error"",
""message"": ""The priority value must be numeric and range from 0 to 99.""
}"
ExpiryDate key is missing / ExpiryDate key is invalid / ExpiryDate key is valid / ExpiryDate value is empty OR Null "{
""status"": ""Success"",
""message"": ""SuccessFully Updated xxxx Campaign""
}"
ExpiryDate value is Invalid"{
""status"": ""Error"",
""message"": ""Invalid date format. Please enter date in format yyyy-MM-dd""
}"
ExpiryDate value is valid"{
""status"": ""Success"",
""message"": ""SuccessFully Updated Progressive Campaign""
}"
username value is empty/null"{
""status"": ""false"",
""message"": ""Username Should Not be Null or Empty."",
""data"": null
}"
Adding phone number to Agentwise campaign and agentId missing"status": "FAIL", "message": "Agent Is Empty!"
Adding phone number to Agentwise campaign and agentId empty"""status"": ""FAIL"",
""message"": ""Agent Is Empty!"""
Adding a phone number to Agentwise campaign and agentId invalid"""status"": ""FAIL"",
""message"": ""Agent is not correctly mapped!"""
Adding a phone number to Agentwise campaign and agentId valid{"status": "SUCCESS", "message": "SuccessFully Updated"}
Adding a phone number to skill wise campaign and skill is missing"""status"": ""FAIL"",
""message"": ""Please provide valid skill"""
Adding a phone number to skill wise campaign and skill is empty"""status"": ""FAIL"",
""message"": ""Please provide valid skill"""
Adding a phone number to skill wise campaign and skill is invalid"""status"": ""FAIL"",
""message"": ""Please provide valid skill"""
Adding a phone number to skill wise campaign and skill is valid{"status": "SUCCESS", "message": "SuccessFully Updated"}
Adding a phone number to skill wise campaign with other valid skill"{
""status"": ""Success"",
""message"": ""Number Already Existed""
}"
Uploading phone numbers to non-mandatory mapped columns like name, address missing/ invalid.{"status": "SUCCESS", "message": "SuccessFully Updated"}
Giving same name to a different number {"status": "SUCCESS", "message": "SuccessFully Updated, xxx was started"}
Giving same number and different name{"status": "SUCCESS", "message": "Number Already Exist"}
Adding data to inbound campaign"no, we should not {
""status"": ""Fail"",
""message"": ""The selected campaign is not outbound""
}"
Data added to the campaign when the setting "Api authentication" is "Basic_Auth""{
""status"": ""false"",
""message"": ""Invalid action."",
""data"": null
}"
Data added to campaign when the setting "Api authentication" is "None""{
""status"": ""false"",
""message"": ""Invalid action."",
""data"": null
}"
Data added to campaign when the setting "Api authentiction" is "Token_Auth"{"status": "SUCCESS", "message": "SuccessFully Updated, xxxx was started"}
Language
Authorization
Bearer
URL
Click Try It! to start a request and see the response here!