Skip to main content

Providers API

The Providers API allows you to fetch information about all configured telephony providers to help identify and manage available calling services.

Get Telephony Providers

Retrieve a list of all telephony providers in the system along with their details.
GET /api/v2/platform/telephony/providers/

Headers

NameTypeRequiredDescription
AuthorizationstringYesAPI Key format: Token <token>

Example Request

GET /api/v2/platform/telephony/providers/
Headers:
  Authorization: Token your-api-token

Success Response (200)

{
  "status_code": 200,
  "message": "Voice infra providers fetched successfully.",
  "data": [
    {
      "id": 1,
      "name": "Provider 1",
      "description": "Desc 1",
      "icon": "http://example.com/icon1.png"
    },
    {
      "id": 2,
      "name": "Provider 2",
      "description": "Desc 2",
      "icon": "http://example.com/icon2.png"
    }
  ]
}

Response Fields

FieldTypeDescription
status_codeintegerHTTP status code
messagestringResponse message
dataarrayArray of provider objects

Provider Object Fields

FieldTypeDescription
idintegerProvider unique identifier
namestringProvider name
descriptionstringProvider description
iconstringProvider icon URL

Error Response (401  Unauthorized)

{
  "status_code": 401,
  "message": "Authentication credentials were not provided."
}

Code Examples

const axios = require('axios');

const headers = {
  'Authorization': 'Token your-api-token'
};

// Get all telephony providers
const getproviders = async () => {
  const response = await axios.get(
    'https://unpod.dev/api/v2/platform/telephony/providers/',
    { headers }
  );
  console.log(`Total providers: ${response.data.data.length}`);
  response.data.data.forEach(provider => {
    console.log(`${provider.name} - ${provider.description}`);
  });
  return response.data.data;
};

// Example usage
getproviders();

Best Practices

  1. Provider Selection: Choose the appropriate provider based on your region and requirements
  2. Error Handling: Always handle potential errors and implement retry logic
  3. Security: Keep API tokens secure and rotate them regularly
  4. Caching: Cache provider list locally to reduce API calls