GET - Get stats
The stats endpoint allows you to track the result transactional messages using its group id.
Request structure
Route
The transactional API exposes a GET endpoint at: https://api.batch.com/1.1/BATCH_API_KEY/transactional/stats/GROUP_ID
Here are examples of valid cURL, PHP or Python requests syntax:
The GROUP_ID
value is the id you set when you create a transactional message.
Note: Only LIVE API Keys are supported by this API
Get parameters
since
String - Required. Must be lower than 'until' parameter.
Value that indicates the first date of the window over which stats are fetched. The maximum window size is 6 months.
E.g."/transactional/stats/GROUP_ID?since=2018-03-01"
until
String - Required, Default : today's date (GMT)
Value that indicates the last date of the window over which stats are fetched.
E.g."/transactional/stats/GROUP_ID?since=2018-03-01&until=2018-03-10"
Here is an example of a valid cURL CLI request, which would return daily stats about the group id welcome from 1 to 10 March 2018 :
Headers
In order to authenticate with the API, you need to provide your company REST API Key as the value of the X-Authorization
header.
Responses
Success
If the GET to the API endpoint is successfull you will receive an HTTP 200 confirmation and information on your campaign.
You can use this information to show the results of your transactional messages in your business intelligence tools.
Also, you can easily calculate the open-rate by using the following formula:
open-rate = (direct_open
+ influenced_open
) / sent
Failure
If the GET data does not meet the API requirements you will receive an actionable error message. Contact us at [email protected] if you need further support.
AUTHENTICATION_INVALID
(Http status code: 401, Error code: 10)API_MISUSE
(Http status code: 403, Error code: 12)ROUTE_NOT_FOUND
(Http status code: 404, Error code: 20)SERVER_ERROR
(Http status code: 500, Error code: 0)
Last updated
Was this helpful?