Skip to content

Unsubscribe Virtual Number

This API is used to unsubscribe from a virtual number (DN) in your account.

Parameters for Unsubscribing Virtual Number

Headers Parameters

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

URL Path Parameters

NameExampleDescription
id66ea98514f0c1a121c76ec17Required. The ID of the virtual number to unsubscribe.

Code Samples

put https://api.cellcast.com/api/v1/apiClient/virtual-number/unsubscribe/:id

bash
curl --location --request PUT 'https://api.cellcast.com/api/v1/apiClient/virtual-number/unsubscribe/66ea98514f0c1a121c76ec17' \
--header 'authorization: Bearer {{API_KEY}}' \
--header 'content-type: application/json'
js
const axios = require('axios');

async function unsubscribeVirtualNumber() {
    const id = '66ea98514f0c1a121c76ec17'; // Replace with the virtual number ID
    const url = `https://api.cellcast.com/api/v1/apiClient/virtual-number/unsubscribe/${id}`;
    const apiKey = 'your_api_key_here'; // Replace with your actual API key

    try {
        const response = await axios.put(url, {
            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);
    }
}

unsubscribeVirtualNumber();

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": 1,
    "is_enc": false,
    "status": true,
    "message": "Virtual number has been unsubscribed successfully.",
    "message_type": "toast",
    "data": {},
    "error": {}
}

401 Unauthorized

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

404 Not Found

json
{
  "code": 404,
  "message": "Virtual number not found",
  "stack": "APIError: Virtual number not found ...."
}