All API requests to the WhatsApp Gateway must be authenticated using both Basic Auth credentials and an API key provided by Namirial support.
Include your credentials in every request using HTTP Basic Authentication:
Authorization: Basic <base64(username:password)>Include your API key in every request using the X-Api-Key header:
X-Api-Key: <your-api-key>curl -X POST "https://wa.namirialtsp.com/api/services/send" \
-H "Authorization: Basic <base64(username:password)>" \
-H "X-Api-Key: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{ ... }'| HTTP Status | Error code | Error type | Solution |
|---|---|---|---|
401 | 1 | AuthenticationFailedException | Verify your Basic Auth credentials for the target environment |
401 | 9 | MissingApiKeyException | The X-Api-Key header is missing. Add it to your request |
401 | 9 | InvalidApiKeyException | The X-Api-Key value is not valid. Verify the key for the target environment |
403 | 6 | ForbiddenException | Your account does not have the required permissions. Contact Namirial support |
Example — invalid credentials (code 1):
{
"type": "AuthenticationFailedException",
"code": 1,
"message": "Invalid credentials"
}Example — insufficient role (code 6):
{
"type": "ForbiddenException",
"code": 6,
"message": "Current role [USER], missing role [ADMIN, TEMPLATE_ADMIN]"
}HTTP 403 is returned when the account is authenticated but does not have the required role.
Example — missing API key (code 9):
{
"type": "MissingApiKeyException",
"code": 9,
"message": "Missing API key"
}Example — invalid API key (code 9):
{
"type": "InvalidApiKeyException",
"code": 9,
"message": "Invalid API Key"
}Submit a request through the Namirial support portal.