PindoSMS class is the entry point for the pindo-sms SDK. Instantiate it once with your API token and use it to send messages, manage sender IDs, and retrieve analytics.
Import
Constructor
Your Pindo API token. Used to authenticate all requests as a Bearer token in the
Authorization header.The base URL of the Pindo API. Override this only if you are targeting a non-production environment.
The API version to use for SMS endpoints. Affects the constructed URL for
sendSMS and sendBulkSMS.Authentication
All requests are authenticated using a Bearer token. The token you pass to the constructor is included automatically in theAuthorization header of every request:
Error handling
If the API returns a non-OK HTTP status, the SDK throws a JavaScriptError. The error message is taken from the API response body (errorData.message), falling back to 'API request error' if no message is present.
Methods
sendSMS
Send a single SMS to one recipient.
sendBulkSMS
Send a personalized SMS to multiple recipients at once.
createSenderID
Register a custom sender ID for one or more countries.
getSenderIDs
Retrieve your registered sender IDs, optionally filtered by name.
getUserDetails
Fetch details about the authenticated organization.
getAnalytics
Retrieve SMS analytics for a given time range and timezone.