Get up and running with our Quick Start Guide and start developing your SMSPortal integration.
Integrating with SMSPortal can begin as soon as you create a SMSPortal account, and requires three steps:
The REST API uses an API Client ID and API Secret to authenticate requests. You can create, view and manage your Client ID and Secret in the SMSPortal Control Panel.
API Credential Security
Your API Credentials carry many privileges and your Secret cannot be accessed after creation, so be sure to keep them secure! Do not share your secret API credentials in publicly accessible areas such as GitHub, client-side code, and so forth.
All API requests should be made over HTTPS. Calls made over plain HTTP will work but are not recommended. API requests without authentication will fail.
The RESTful API authenticates HTTP requests using tokens, which are generated using your API credentials. Each token is valid for 24 hours from creation, after which they expire and a new token will need to be generated.
To generate a token, BASE64
encode your API credentials in the format ClientID:APISecret
and include them in the Basic Authentication Header, ex. BASIC WFhYWFhYWFgtWFhYWC1YWFhYLVhYWFgtWFhYWFhYWFhYWFhYOlhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhY
.
Subsequent API calls will require the token returned by the authentication request, in the Authorization harder, ex. Bearer WU9VUiBHRU5FUkFURUQgVE9LRU4gWU9VUiBHRU5FUkFURUQgVE9LRU4gWU9VUiBHRU5FUkFURUQg VE9LRU4gWU9VUiBHRU5FUkFURUQgVE9LRU4gWU9VUiBHRU5FUkFURUQgVE9LRU4=
.
Implement these best practices when integrating with SMSPortal’s REST API.
To check that your integration is working correctly, send a message with the testMode
parameter set to true
and ensure that SMSPortal returns a successful response to your API request.
We advise that you use webhooks to receive feedback on the delivery of any messages sent or for the processing of any replies to the messages.
These webhooks can be registered via the customer portal or by using the provided WebhookRegistration
API calls.
For more details on the supported webhooks, please see our webhooks documentation.
For the complete API documentation please see https://docs.smsportal.com/docs/rest including various code recipes for sending SMSes.