Get SMS Credit Endpoint
REST API endpoint to retrieve the remaining SMS credit balance.
This endpoint allows you to retrieve information about the remaining SMS credit balance. Use it to monitor usage and ensure there’s enough credit to send SMS to subscribers.
Endpoint
GET /wp-json/wpsms/v1/credit
Examples
cURL
curl --location --request GET 'https://site.com/wp-json/wpsms/v1/credit' \
--header 'Authorization: Basic YOUR_API_KEY'
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://site.com/wp-json/wpsms/v1/credit',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic YOUR_API_KEY',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response
Success
{
"credit": "10.00 USD"
}
| Field | Type | Description |
|---|---|---|
credit | string | Remaining credit balance with currency |
Authentication
This endpoint requires authentication. Include the Authorization header with valid credentials. Access is available to:
- Website administrators
- Users with permission to view credit information
Related
Last updated: December 23, 2024