Get statistics about sent notifications (v2)
Purpose
Get statistics about sent notifications.
URL
Sandbox
https://sandbox.httpush.com/ACCOUNT_KEY/v2/APP_HASH/statistics/DATE/RESOLUTION/count.json
https://sandbox.httpush.com/ACCOUNT_KEY/v2/APP_HASH/statistics/DATE/RESOLUTION/count.xml
Production
https://production.httpush.com/ACCOUNT_KEY/v2/APP_HASH/statistics/DATE/RESOLUTION/count.json
https://production.httpush.com/ACCOUNT_KEY/v2/APP_HASH/statistics/DATE/RESOLUTION/count.xml
Find your ACCOUNT_KEY on
the dashboard at the management web site.
HTTP Method
GET
Formats
JSON, XML
Requires Authentication
Yes (about Authentication)
Parameters
Send the parameters ACCOUNT_KEY, APP_HASH, DATE and RESOLUTION as part of the URL.
APP_HASH: Theapplication_hash. Provided by the management site. Identifies under which application the recipient should be created.DATE: Adatefrom which you want the count of sent notifications. A string in the form like 2009-01-01 (YYYY-MM-DD).RESOLUTION: Theresolutionof the count. Can be eitherday,monthoryear.yearis default.resolutionset toyearreturns the count of notifications sent for this year.resolutionset tomonthreturns the count of notifications sent for this month.resolutionset todayreturns the count of notifications sent for this day.
Usage Notes
Statistics are available starting from 01.08.2009.
Do not poll this more than once every
hour. We are only updating the count every hour. Polling
once a day should be sufficient for most use cases.
DATE must always contain month and day even if the
resolution is set to year. For a year resolution specify the date like
this 2009-01-01.
Example Data
Example JSON data
https://sandbox.httpush.com/ACCOUNT_KEY/v2/05673b6d12c796afc0cb74849e60573949bf2521/statistics/2009-01-01/year/count.json
Example XML data
https://sandbox.httpush.com/ACCOUNT_KEY/v2/05673b6d12c796afc0cb74849e60573949bf2521/statistics/2009-12-06/day/count.xml
Response
See return codes for all codes, here are specific ones:
JSON
200 {"count" : "1"}
400 {"error" : "application_hash not found"}
400 {"error" : "not a valid time string"}
XML
XML returns the same errors string like JSON:
<?xml version="1.0" encoding="UTF-8"?> <statistics> <count>1</count> </statistics> <?xml version="1.0" encoding="UTF-8"?> <errors> <error>not a valid time string</error> </errors>
Usage examples
cURL (about cURL)
curl -k -u 'c3bb3b10864278055b3873503629904b98862895:1ab182418e3bca321dab504f96dd0339869eef0c' https://sandbox.httpush.com/ACCOUNT_KEY/v2/05673b6d12c796afc0cb74849e60573949bf2521/statistics/2009-12-06/day/count.json
curl -k -u 'c3bb3b10864278055b3873503629904b98862895:1ab182418e3bca321dab504f96dd0339869eef0c' https://sandbox.httpush.com/ACCOUNT_KEY/v2/05673b6d12c796afc0cb74849e60573949bf2521/statistics/2009-12-06/day/count.xml
Do you have an example to share in the language of your choice? Please share!