Add Single Contact
This API allows you to add single contact to your Cellcast account.
Parameters for Add Single Contact API
Headers Parameters
Parameters | Description |
---|---|
Authorization | Please add provided Bearer token - linked to your Cellcast account. Check here |
Request Body Parameters
Name | Example | Description |
---|---|---|
phone_number | +61400000000 | Required - The phone number of the contact |
first_name | John | Optional - The first name of the contact |
last_name | Doe | Optional - The last name of the contact |
birthday | 1990-05-14 | Optional - The birth date of the contact |
address | 123 Main St, Sydney, NSW | Optional - The address of the contact |
[email protected] | Optional - The email of the contact | |
postal_code | 2000 | Optional - The postal code of the contact |
gender | male | Optional - The gender of the contact |
purchase | paypal | Optional - The purchase information of the contact |
tags | [ "Example Tag", "New User Tag" ] | Include this in your request to add Tags to the uploaded contacts. You can add multiple tags to the contacts. Set empty string to not add tag. |
list | [ "Example List", "New User List" ] | Include this in your request to add the uploaded contacts into Lists. You can add the contacts to multiple Lists. Set empty string to not add to list. |
Code Samples
Post https://api.cellcast.com/api/v1/contact/single
bash
curl --location 'https://api.cellcast.com/api/v1/contact/single' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{API_KEY}}' \
--data-raw '{
"first_name": "John",
"last_name": "Cen A",
"phone_number": "+61400000000",
"birthday": "1990-05-14",
"address": "123 Main St, Sydney, NSW",
"email": "[email protected]",
"postal_code": "2000",
"gender": "male",
"purchase": "paypal",
"tags": [
"new_client",
"external_contact"
],
"list": [
"new contact list"
]
}'
js
const axios = require("axios");
const addBulkContacts = async () => {
try {
const response = await axios.post(
"https://api.cellcast.com/api/v1/contact/bulk",
{
first_name: "John",
last_name: "Cen A",
phone_number: "+61400000000",
birthday: "1990-05-14",
address: "123 Main St, Sydney, NSW",
email: "[email protected]",
postal_code: "2000",
gender: "male",
purchase: "paypal",
tags: [
"Example Tag",
"New User Tag"
],
list: [
"Example List",
"New User List"
]
},
{
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: "Bearer {{API_KEY}}",
},
}
);
console.log(JSON.stringify(response.data));
} catch (error) {
console.log(error);
}
};
Replace with the actual API key that you own.
Response
200 Success
json
{
"message": "success",
"data": {
"message": "all data success to process",
"success_data": 1,
"failed_data": 0,
"errors": []
}
}
400 Bad Request
json
{
"message": "phone_number is required"
}