The Analytics API makes it possible to get data about your SMS and email campaigns, flows, and automations.
You can use the data:
- for data warehousing and backup purposes
- with additional marketing tools for in-depth research of marketing trends
- with analytics tools for advanced research and analysis
- Retrieve dimensions - Retrieve required qualitative values, such as marketing channel (SMS or email), aggregation date, etc.
- Retrieve measures - Retrieve required quantitive values, such as how many messages were sent, or how much revenue was earned
- Get aggregations - Aggregations require properties of the dimensions and measures to get and filter the actual data
- Automations - Source data will be taken from the specified automation
- Campaigns - Source data will be taken from the specified campaign
- Flows - Source data will be taken from the specified flow
- Use only secure URLs that start with HTTPS
- URLs can have a maximum length of 2048 characters
- URLs must conform to RFC 2396
For this example, we want to get the number of sent campaigns and the total generated revenue for all campaigns that ran on April, 20th.
- Use the Dimensions endpoint to get the source_type and aggregation_date dimensions.
- Use the Measures endpoint to get the All_revenue and All_sent measures.
- Use the Aggregations endpoint to specify and filter the dimensions and measures:
The Aggregation endpoint will now pull in the required data.
Data is aggregated (updated) on an hourly basis.