getAnalytics to fetch SMS delivery statistics for your account. The method lets you filter by time range and adjust for your local timezone.
Endpoint: GET https://api.pindo.io/v2/sms/analytics?timezone_offset={timezoneOffset}&start={start}&timeframe={timeframe}
Parameters
Your timezone offset in minutes relative to UTC. For example:
- UTC+2 →
120 - UTC-2 →
-120 - UTC →
0
new Date().getTimezoneOffset() * -1 to get the current system offset programmatically. Note that Date.getTimezoneOffset() returns the inverse (negative for east of UTC), so multiply by -1 to get the Pindo-expected value.The start date for the analytics window in
YYYY-MM-DD format. For example, '2024-07-20'.The duration of the analytics window. Accepted values include:
'30d'— last 30 days fromstart'7d'— last 7 days fromstart'1d'— a single day'all'— all available data fromstart
Response shape
The API returns adata object keyed by hour ('HH:mm' format), where each entry contains SMS delivery statistics for that hour:
Code example
Dynamic timezone example
To use the system’s current timezone automatically:getAnalytics calls the /v2/sms/analytics endpoint, which is separate from the v1 SMS endpoints used by sendSMS and sendBulkSMS.