copyright: years: 2017, 2018 lastupdated: "2023-02-12"
Configuring authentication for the SMS Gateway REST API
The SMS Gateway REST API controls the creation and deletion of SMS sessions. You can access the REST API user interface, either in your browser or connecting through an application, at the following URLs:
- Unsecured connection:
http://<host-address:unsecured-port>/publicURL/apis/explorer/
- Secured connection:
https://<host-address:secured-port>/publicURL/apis/explorer/
For additional security, you can configure HTTP Basic authentication for the REST API. When authentication is configured, you must authenticate to send any REST API requests.
With HTTP Basic authentication, you can pass the user name and password in the URL or enter them when prompted by the browser. To pass them in the URL, add them to the REST API URL in the following format: https://<user:password>@<host address:secure port>/publicURL/apis/explorer/
For example:
https://myRESTAPIuser:Pa55w0rd@123.4.5.67:9443/publicURL/apis/explorer/
-
Single-tenant environment: In the SMS Gateway configuration, specify the
CTRL_TENANT_USERNAME
andCTRL_TENANT_PASSWORD
environment variables.For example, on Docker:
- CTRL_TENANT_USERNAME=myRESTAPIuser - CTRL_TENANT_PASSWORD=Pa55w0rd
-
Multi-tenant JSON configuration: In your tenant configuration JSON file, configure a
controlCredentials
object withusername
andpassword
properties.
"tenants": [
{
"tenantPhoneNumber": "+12345556789",
"description": "Number for accessing account information",
...
"controlCredentials": {
"username": "myRESTAPIuser",
"password": "Pa55w0rd"
}
...
}
]