Custom Number
This API is used to create a Sender ID using your own custom number.
Note: Depending on your account settings, when registering a custom number, an OTP will be sent to the number. You must verify the OTP before you can use the number. Refer to this API for verifying the OTP Verify Cutom Number
Parameters for Creating Custom Number
Headers Parameters
Parameters | Description |
---|---|
Authorization | Please add provided Bearer token - linked to your Cellcast account. Check here |
Content-Type | application/json |
Request Body Parameters
Name | Example | Description |
---|---|---|
name | Custom Number | Required. The name you want to assign to the custom number. |
number | +61400000000 | Required. The contact number you want to register as custom number. You can use formats +61400000000 , 61400000000 , 0400000000 , or 400000000 . |
Code Samples
Post https://api.cellcast.com/api/v1/customNumber/add
bash
curl --location 'https://api.cellcast.com/api/v1/customNumber/add' \
--header 'authorization: Bearer {{API_KEY}}' \
--header 'content-type: application/json' \
--data '{
"name": "Custom Number",
"number": "+61400000000"
}'
js
const axios = require('axios');
async function addCustomNumber() {
const url = 'https://api.cellcast.com/api/v1/customNumber/add';
const apiKey = 'your_api_key_here'; // Replace with your actual API key
const payload = {
name: 'Custom Number',
number: '+61400000000',
};
try {
const response = await axios.post(url, payload, {
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
});
console.log('Response:', response.data);
} catch (error) {
console.error('Error:', error.response ? error.response.data : error.message);
}
}
addCustomNumber();
Replace with the actual API key that you own.
Responses
200 Success request without OTP Verification
json
{
"app_type": "web",
"app_version": "1.0",
"maintainence": 0,
"new_version": 0,
"force_update": 0,
"invalid_token": 0,
"refresh_token": "",
"show_message": 1,
"is_enc": false,
"status": true,
"message": "Custom number created",
"message_type": "toast",
"data": {
"success": true,
"message": "Success create new custom number"
},
"error": {}
}
200 Success request with OTP Verification
json
{
"app_type": "web",
"app_version": "1.0",
"maintainence": 0,
"new_version": 0,
"force_update": 0,
"invalid_token": 0,
"refresh_token": "",
"show_message": 1,
"is_enc": false,
"status": true,
"message": "OTP sent to your number successfully",
"message_type": "toast",
"data": {
"success": true,
"message": "OTP sent to your number successfully"
},
"error": {}
}
400 Name is required
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": false,
"message_type": "toast",
"message": "Name is required",
"data": {},
"error": {
"error": "name is not valid"
}
}
400 Number already exist
json
{
"maintainence": 0,
"new_version": 0,
"force_update": 0,
"invalid_token": 0,
"refresh_token": "",
"show_message": 0,
"is_enc": false,
"status": true,
"message": "Number already exist in system",
"message_type": "toast",
"data": {
"invalid_token": 0,
"refresh_token": "",
"app_type": "web",
"app_version": "1.0"
},
"error": {}
}
400 Mobile number is required
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": false,
"message_type": "toast",
"message": "Mobile number is required",
"data": {},
"error": {
"email": "Mobile number is not valie"
}
}
400 Mobile number is invalid
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": false,
"message_type": "toast",
"message": "Mobile number is not valid",
"data": {},
"error": {
"error": "Mobile number is not valid"
}
}
401 Unauthorized
json
{
"code": 401,
"message": "Token expired",
"stack": "APIError: Token expired ...."
}