Add Campaign Data (Basic authentication)

Use this API to add data to any outbound campaign(dialer) with basic authentication. Create an outbound campaign in your CloudAgent account, and use this API to add data/records for the same.

You can also manually add data to the dialer by uploading an Excel sheet. However by using this API, the same can be automated.

👍

Note:

  • Make sure the admin setting 'API Authentication' is set to 'BASIC_AUTH', If you are using this API.
  • In the body params, if no priority value is specified, the system defaults to 1.

❗️

Rate Limit:

A maximum of 100 requests per minute is allowed for this API.

To access the API, 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.

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 HH:MM:SS",
    "checkDuplicate": "xxxx",
    "userName": "xxxxxx"
}

Below is the description of the parameters to be passed:

Parameter (Key)Description
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 HH:MM:SS
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 admin setting is TOKEN_AUTH/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 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.""
}"
Invalid expiryDate Value"{
""status"": ""Error"",
""message"": ""Invalid date format. Please pass date in format yyyy-MM-dd HH:mm:ss or yyyy-MM-dd""
}"
Missing expiryDate Value"{
""status"": ""Error"",
""message"": ""Invalid date format. Please pass date in format yyyy-MM-dd HH:mm:ss or yyyy-MM-dd""
}"
Passing past date as expiryDate value"{
""status"": ""Error"",
""message"": ""The expiry date and time must be in the future""
}"
Passing future date as expiryDate value"{
""status"": ""Success"",
""message"": ""Campaign progressive Is Already Started""
}"
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": "SUCCESS", "message": "SuccessFully Updated, IVR was started"}
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"": ""false"",
""message"": ""Invalid action."",
""data"": null
}"
Language
URL
Click Try It! to start a request and see the response here!