Quickstart with API
Visual Guide
Account
Let's briefly go over using the API. We will use an account with an Essentials Plan configuration for this demonstration.
![](https://files.readme.io/8805053-getting_started_account.png)
Phone Number
Because this user has purchased a subscription, they have a phone number registered. The A2P Brand and Campaign have been approved for (312) 638-0457.
![](https://files.readme.io/fa66155-getting_started_phone.png)
Testing
Tests are supported through the following API endpoint.
For testing, you will need to get the ClientID and the API Key from your Settings tab as shown below.
![](https://files.readme.io/5b1bf03-getting_started_api_key.png)
The Client ID and API Key will be used in the REST API Request. On the developer.cloudcontactai.com site, add the API Key to the Authorization prefixed with Bearer.
![](https://files.readme.io/0a42408-getting_started_rest_api_request.png)
You are required to specify the Client ID.
![](https://files.readme.io/c3f04c2-getting_started_client_id.png)
In the Body Params category, click Add Object. You will need to specify the first name, last name, and phone number categories, or else the message will throw an error.
![](https://files.readme.io/afaf0c3-getting_started_required_categories.png)
Outside of the account parameters, you will need a campaign name and message. For example, we're giving the campaign the title of "First Campaign" and the message will read, “${firstName}, hello how’s it going?”
![](https://files.readme.io/e936871-getting_started_complete_campaign.png)
The campaign has all the prerequisites and is ready to be sent. Click on the "Try it!" button at the bottom of the Curl Request window. The message will go out and the following will appear in the Response window.
![](https://files.readme.io/07a102d-getting_started_try_it_outcome.png)
The message should appear both to the phone number the message was written for and under the "Sent" tab on the CCAI dashboard.
![](https://files.readme.io/9691470-getting_started_text_message.png)
![](https://files.readme.io/c1a8f47-getting_started_ccai_records.png)
Curl Request
If anything is confusing about the Curl Request window, here is an excerpt for reference.
curl --request POST \
--url https://core.cloudcontactai.com/api/clients/YOUR-CLIENT-ID/campaigns/direct \
--header 'Authorization: Bearer API-KEY-TOKEN' \
--header 'accept: */*' \
--header 'content-type: application/json' \
--data '
{
"accounts": [
{
"firstName": "Mike",
"lastName": "Alvarez",
"phone": "+17199411698"
}
],
"message": "Testing campaign setup with you, ${firstName} ${lastName}",
"title": "Setup Validation Campaign"
}
Updated 9 days ago