Messages

Get analytics

Activity over a period.

Days are counted in East Africa Time. Deltas compare with the equal-length window before, and are null when it had nothing.

Query Parameters

period?string
Value in"today""last_7_days""last_30_days""last_90_days""this_month""last_month""this_year""all_time"
from?string

The first day of a picked range, given with to; it takes the place of period.

Formatdate
to?string

The last day of a picked range, included. A range is at most 731 days.

Formatdate
channel?string

One channel, as GET /channels lists them (sms, whatsapp, ...); every channel when absent. Any other is 400 invalid_value.

Header Parameters

X-Request-Id?string

Your id for this request; it becomes the request_id of any error. Without it the server makes one.

curl -X GET 'https://v3.ghala.io/v1/analytics'
{  "range": {    "period": "today",    "from": "2019-08-24",    "to": "2019-08-24",    "previous_from": "2019-08-24",    "previous_to": "2019-08-24",    "granularity": "day",    "tz": "Africa/Dar_es_Salaam"  },  "totals": {    "messages": 0,    "delivered": 0,    "failed": 0,    "parts": 0,    "spend_minor": 0,    "new_contacts": 0  },  "previous": {    "messages": 0,    "delivered": 0,    "failed": 0,    "parts": 0,    "spend_minor": 0,    "new_contacts": 0  },  "deltas": {    "messages_pct": 0,    "delivered_pct": 0,    "failed_pct": 0,    "spend_pct": 0,    "new_contacts_pct": 0  },  "series": [    {      "messages": 0,      "delivered": 0,      "failed": 0,      "parts": 0,      "spend_minor": 0,      "new_contacts": 0,      "bucket": "2019-08-24"    }  ],  "breakdowns": {    "messages_by_status": {      "property1": 0,      "property2": 0    },    "messages_by_source": {      "property1": 0,      "property2": 0    }  }}