Overview
To align with industry standards, Awaaz.De uses REST APIs with simple and flexible architecture leading to easier implementation and integration. Partners need to integrate two APIs:- Login API: JWT-based authentication that allows partners to make a login request once and send multiple message requests using the same token. Partners only need to request login when the token expires. JWT access tokens are valid for 1 hour.
- Message API: Used to schedule automated voice call messages to customers.
Demo Code
Awaaz.De’s API integration demo code is available on GitHub and explains how to authenticate via the Login API, obtain a token, and send automated voice calls using the Message API. Demo code is available in:Login API
- Contact our team to set up your account.
- After account creation, you’ll receive key details like the tenant name, which you’ll need to include in every API request.
Endpoint
Request Body
Request Parameters
| Parameter | Type | Description |
|---|---|---|
email | string | User email for login |
password | string | User password for login |
Success Response
Status Code:200 OK
Error Response
Status Code:401 Unauthorized
Message API
Endpoint
Authentication
Include the JWT token obtained from the Login API in the request headers:Request Body
Note: Request data should be customized based on your template and language requirements.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
transform_using_template | boolean | Yes | Enable template-based transformation |
data | array | Yes | Array of message objects to be scheduled |
instant_message | boolean | No | Indicates whether the message should be sent immediately. You can schedule up to 5 messages with this flag. |
| Parameter | Type | Required | Description |
|---|---|---|---|
phone_number | string | Yes | Phone number in international format (e.g., +9194XXXXXXXX) |
language | string | Yes | Language to be used for the voice call |
template | string | Yes | Template name (or ID) indicating the script for the call |
tags | array | No | List of tags or additional metadata for the message |
day_of_month, installment_amount, month, and number_of_days are template-specific and should be included based on your template requirements.
Rate Limits
- 5,000 messages per request: approximately 30 seconds to process
- 10,000 messages per request: approximately 45-50 seconds to process
Success Response
Status Code:201 Created
"status": "created" have been successfully scheduled.
Error Response
Status Code:201 Created (partial success)
"status": "invalid" contain errors. The error field provides details about what went wrong.
Example Request and Response
Request
Response
created), while the second message failed due to an invalid phone number (status: invalid).
Error Handling
HTTP Status Codes
| Status Code | Description | Action |
|---|---|---|
200 | The request has succeeded | N/A |
201 | The request has succeeded and a new message has been created | N/A |
400 | Bad Request - Invalid or malformed data | Verify request format matches API documentation. Check the error message for specific data issues |
401 | Unauthorized - User is not authenticated | Please log in using the Login API |
403 | Forbidden - Token expired | Please re-login to obtain a new JWT token |
404 | Not Found - URL is not recognized | Verify the API endpoint URL is correct |
502 | Bad Gateway | Retry the operation after some time. If issue persists after multiple retries, contact Awaaz.De |
504 | Gateway Timeout | Retry the operation after some time. If issue persists after multiple retries, contact Awaaz.De |
500-599 | Server Error | We monitor our systems for such errors. If not resolved within 24 hours, please contact Awaaz.De |
Common Error Scenarios
Invalid Credentials
Invalid Phone Number
Expired Token
Status Code:403 Forbidden
Solution: Re-authenticate using the Login API to obtain a new JWT token.
Best Practices
- Token Management: Cache the JWT token and reuse it for multiple requests within the 1-hour validity period. Only request a new token when the current one expires.
- Batch Processing: Group messages in batches of up to 10,000 for optimal performance.
-
Error Handling: Always check the
statusfield in the response for each message. Messages can fail individually while others succeed. - Phone Number Format: Always use international format with country code (e.g., +91 for India).
- Retry Logic: Implement exponential backoff for 502, 504, and 5xx errors.
- Rate Limiting: Be mindful of processing times when sending large batches of messages.
Support
For technical support or questions about API integration, please contact:- Email: [email protected]