Skip to content

Verify Custom Number

This API is to verify your Custom Number using the OTP sent.

Parameters for Verifying Custom Number

Headers Parameters

ParametersDescription
AuthorizationPlease add provided Bearer token - linked to your Cellcast account. Check here
Content-Typeapplication/json

Request Body Parameters

NameExampleDescription
nameCustom NumberRequired. The name you want to assign to the custom number.
number+61400000000Required. The contact number you registered as the custom number.
otp123456Required. The OTP sent to your registered number for verification.

Code Samples

Post https://api.cellcast.com/api/v1/customNumber/verifyCustomNumber

bash
curl --location 'https://api.cellcast.com/api/v1/customNumber/verifyCustomNumber' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{API_KEY}}' \
--data '{
    "name": "Custom Number",
    "number": "+61400000000",
    "otp": "123456"
}'
js
const axios = require('axios');

const verifyCustomNumber = async () => {
    try {
        const response = await axios.post(
            'https://api.cellcast.com/api/v1/customNumber/verifyCustomNumber',
            {
                name: "Custom Number",
                number: "+61400000000",
                otp: "123456"
            },
            {
                headers: {
                    'Content-Type': 'application/json',
                    'Authorization': 'Bearer {{API_KEY}}'
                }
            }
        );
        console.log('Response:', response.data);
    } catch (error) {
        console.error('Error:', error.response ? error.response.data : error.message);
    }
};

verifyCustomNumber();

Replace with the actual API key that you own.

Responses

200 Success

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": "OTP Verified Successfully!",
    "message_type": "toast",
    "data": {},
    "error": {}
}

200 Empty Name

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": false,
    "message_type": "toast",
    "message": "Name is Required",
    "data": {},
    "error": {
        "error": "Name is Required"
    }
}

400 Empty Number

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": false,
    "message_type": "toast",
    "message": "Number is Required",
    "data": {},
    "error": {
        "error": "Number is Required"
    }
}

400 Empty OTP

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": false,
    "message_type": "toast",
    "message": "OTP verification failed",
    "data": {},
    "error": {
        "error": "OTP verification failed"
    }
}

400 Invalid OTP Code

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": false,
    "message_type": "toast",
    "message": "OTP verification failed",
    "data": {},
    "error": {
        "error": "OTP verification failed"
    }
}

401 Unauthorized

json
{
  "code": 401,
  "message": "Token expired",
  "stack": "APIError: Token expired ...."
}