API Usage
Learn how to make authenticated requests, use access tokens, handle API errors, and work with the Carrier Network AI Public API.
The Carrier Network AI Public API allows developers to integrate Carrier Network data into their applications, systems, and workflows.
This guide explains the basic structure of API requests, authentication, making requests, handling errors, and using the API Reference.
Before You Start
Before using the Carrier Network AI Public API, make sure you have:
- A Carrier Network account
- An active subscription
- An API Key
- A Secret Key
- A valid Access Token
If you have not completed the setup yet, see Get Started.
API Request Structure
Carrier Network AI API endpoints use standard HTTP methods and API endpoints.
A typical authenticated request looks like:
GET /public-api/v1/endpoint
Authorization: Bearer YOUR_ACCESS_TOKENThe exact HTTP method and endpoint depend on the API you are using.
See the API Reference for the endpoint-specific method, URL, parameters, and request examples.
Authentication
Protected Carrier Network AI API endpoints require an access token.
To generate an access token:
- Obtain your API Key and Secret Key.
- Use the Generate Auth Token API.
- Receive the access token in the API response.
- Include the access token as a Bearer token in subsequent API requests.
Authorization Header
Include the access token in the Authorization header:
Authorization: Bearer YOUR_ACCESS_TOKENFor detailed authentication instructions, see Authentication.
Making an API Request
Once you have a valid access token, you can call the available Carrier Network AI API endpoints.
Example
curl --request GET \
--url https://api.carriernetwork.ai/public-api/v1/... \
--header "Authorization: Bearer YOUR_ACCESS_TOKEN"Replace /public-api/v1/... with the endpoint you want to call.
The HTTP method, endpoint URL, and any required parameters depend on the API endpoint.
Refer to the API Reference for complete request details and examples.
Request Parameters
Some API endpoints may require additional parameters.
The parameters required by an endpoint depend on the specific API.
Refer to the individual endpoint in the API Reference for the exact parameters supported by that endpoint.
API Responses
The API returns a response containing information about the result of the request.
The exact response structure depends on the API endpoint.
For endpoint-specific response formats and examples, see the API Reference.
Handling Errors
If an API request is not authorized, the API may return a 401 Unauthorized response.
For example:
{
"success": false,
"message": "Invalid or expired access token."
}If you receive a 401 Unauthorized response, verify that:
- You are using a valid access token.
- The access token has not expired.
- The access token is included in the
Authorizationheader. - The
Authorizationheader uses theBearerauthentication scheme.
If the access token has expired, generate a new access token using the Generate Auth Token API.
For more information, see Errors & Status Codes.
Token Expiration
The generated access token is valid for 24 hours.
After the token expires, generate a new access token using your API Key and Secret Key.
You do not need to use your API Key and Secret Key with every protected API request. They are used to generate the access token.
Protected API requests use the generated access token in the Authorization header.
Using the API Reference
The API Reference provides detailed information for each available endpoint.
For each endpoint, you can find:
- HTTP method and endpoint
- Authentication requirements
- Request parameters
- Request examples
- Response examples
- Try It functionality
Use the API Reference when you need endpoint-specific information or want to test an API request.
Recommended Workflow
A typical Carrier Network AI API integration follows this workflow:
Create Account → Complete Subscription → Obtain API Credentials → Generate Access Token → Call API
After the access token expires:
Generate a New Access Token → Continue Calling the API
Security Best Practices
API credentials are sensitive and must be kept secure.
- Never share your API Key or Secret Key publicly.
- Never commit your credentials to a public repository.
- Do not expose your Secret Key in client-side applications.
- Do not include real credentials in documentation examples.
- Use environment variables or a secure secrets manager to store credentials.
- Use placeholder values such as
YOUR_API_KEY,YOUR_SECRET_KEY, andYOUR_ACCESS_TOKENin examples.
Next Steps
If you are ready to start integrating with Carrier Network AI:
- See Authentication to learn how authentication works.
- Explore the API Reference to find available endpoints.
- Use Try It to test API requests.
- See Errors & Status Codes for information about authentication errors and HTTP status codes.
Updated about 2 hours ago
