Upload Contract Subscription
This API allows you to upload a contract group subscription using the Cellcast API.
Parameters for Create Group API
Headers Parameters
Parameters | Description |
---|---|
Authorization | Please add provided Bearer token - linked to your Cellcast account. Check here |
Request Body Parameters
Name | Example | Description |
---|---|---|
name | VIP list | A name of contacts list |
message | SMS Text goes here | String - Required field. To add a new line to the message, use "\r\n" in the message string with only double quote |
contacts | ["+61400000000"] | JSON encoded Array - Required field. To send multiple SMS messages, provide the recipient numbers in a JSON-encoded array, such as ["+61400000000", "+61400000001"]. You can include up to 1,000 numbers in a single API call. Supported number formats include : "+61400000000", "61400000000", "0400000000", "400000000" |
countryCode | 61 | Allowed values: 61 |
Code Samples
Post https://api.cellcast.com/api/v1/group
bash
curl --location 'https://api.cellcast.com/api/v1/group' \
--header 'Content-Type: multipart/form-data' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{API_KEY}}' \
--form 'name="YourGroupName"' \
--form 'unSubList="false"' \
--form 'file=@"/home/ez/Pictures/cellcast.png"' \
--form 'mergeLabels="[object Object],[object Object]"' \
--form 'tagIds="<string>,<string>"'
js
const axios = require("axios");
const FormData = require("form-data");
const fs = require("fs");
const createGroup = async () => {
try {
const form = new FormData();
form.append("name", "YourGroupName");
form.append("unSubList", "false");
form.append("file", fs.createReadStream("/home/ez/Pictures/cellcast.png"));
form.append("mergeLabels", "[object Object],[object Object]");
form.append("tagIds", "<string>,<string>");
const response = await axios.post("https://api.cellcast.com/api/v1/group", form, {
headers: {
...form.getHeaders(),
Authorization: "Bearer {{API_KEY}}",
},
});
console.log(response.data);
} catch (error) {
console.error(error.response.data);
}
};
Replace with the actual API key that you own.
This documentation provides details on how to create a group using the Cellcast API, including the required headers and request body parameters.
Responses
200 OK
json
{
"app_type": "web",
"app_version": "1.0",
"maintainence": 0,
"new_version": 0,
"force_update": 0,
"invalid_token": 0,
"refresh_token": "",
"show_message": 0,
"is_enc": false,
"status": true,
"message": "Group created successfully",
"message_type": "toast",
"error": {},
"data": {
"group": {
"fields": [
"name",
"unSubList"
],
"groupstatus": true,
"tagsId": [
"<string>",
"<string>"
],
"addedThrough": "api",
"_id": "5f600e4988556f2900000000",
"user": "5f600e4988556f2900000000",
"name": "YourGroupName",
"status": "active",
"mergeLabels": "[object Object],[object Object]",
"createdBy": "5f600e4988556f2900000000",
"fieldsAndTotalLength": [
"name",
13
],
"contacts": [],
"errorLog": [],
"createdAt": "2020-09-04T03:18:01.000Z",
"updatedAt": "2020-09-04T03:18:01.000Z",
"__v": 0,
"totalContacts": "0"
}
}
}