Skip to main content

Pre-API Setup

Before you start integrating with the SMS API, there are a few essential steps you need to complete to ensure a smooth experience. This guide will help you prepare your environment and understand the necessary prerequisites.

1. Obtain Your API Key

To authenticate your requests, you will need a valid API key. Follow these steps to obtain your API key:

  • Sign Up: Create an account on the Betatel platform.
  • Generate API Key: Once logged in, navigate to the API section of your dashboard and generate a new API key.
  • Store Securely: Keep your API key secure and do not share it publicly.

2. Check User Balance

Before sending SMS messages, it's essential to verify that the user has enough balance. You can check the user's balance by using the following endpoint:

Check User Balance Endpoint

https://api.betatel.com/api/billing/me/balance

Method: GET

Response

The response will include the user's current balance, which you can use to determine if they have enough funds for the SMS service.

{
"userId": "user123",
"balance": 245.65,
"currency": "USD",
"lastUpdated": "2025-03-18T14:32:05Z"
}

For more information on verifying the pricing for the SMS service, please refer to the Check My Balance section.

3. Check Service Pre-Authorization

Before sending messages, you should verify the pre-authorization for the SMS service you intend to use, including the estimated cost and authorization status. This will help you manage costs effectively

Check Service Pre-Authorization Endpoint

https://api.betatel.com/api/billing/services/preauth

Method: POST

Request Body

{
"userId": "rzeureu2626323232",
"serviceId": "svc_mobile_sms",
"phoneNumber": "+4412345678",
"quantity": 150
}

Response

The response will provide the correlationId, userId, serviceId, status, estimatedCost, currency, and timestamp, allowing you to understand the authorization status and the estimated cost before sending messages.

{
"correlationId": "evt_b4f82932",
"userId": "user123",
"serviceId": "svc_mobile_sms",
"status": "AUTHORIZED",
"estimatedCost": 1.80,
"currency": "USD",
"timestamp": "2025-03-18T14:32:05Z"

For more information on retrieving the current pre-authorization for the SMS service, please refer to the Check Service Pre-Authorization section.

4. Review SMS Best Practices

To maximize the effectiveness of your SMS communications, familiarize yourself with best practices:

  • Keep Messages Concise: Ensure your messages are clear and to the point.
  • Personalize Content: Tailor messages to your audience for better engagement.
  • Include Call to Action: Encourage users to take specific actions based on your messages.

What's Next

Now that you have completed the essential setup steps, you are ready to start using the SMS API effectively. Here are your next steps:

  • Integrate the API: You can begin making API calls to send SMS messages. Refer to the SMS API documentation for detailed instructions on how to send messages, check delivery status, and manage your SMS communications.

  • Use Our SDK: If you prefer a more streamlined approach, consider using our SDK. The SDK simplifies the integration process and provides built-in methods for common tasks, allowing you to focus on building your application without worrying about the underlying API calls.

By following these steps, you will be well-equipped to utilize the SMS service to its fullest potential. If you have any questions or need further assistance, feel free to reach out to our support team.