collection.getStats
Returns the statistics for the specified collection.
Note: Requests must be made to https://api.flipsnack.com/v1.
Name | Type | Description |
apiKey (required) | string | The API key provided for your user. If it is not specified, the request will return the error code "30 - Missing mandatory parameter". If the key is incorrect the request returns the error code "41 - Invalid credentials". |
signature (required) | string | The signature must be calculated by you and added to the request. See How to sign a request for more information. If the parameter is missing the request will return the error code "30 - Missing mandatory parameter". If the signature is incorrect the request will return the error code "44 - Invalid signature". |
action (required) | string | The API method that should be called. In this case the value should be collection.getStats. If it is not specified, the request will return the error code "30 - Missing mandatory parameter". |
collectionHash (required) | string | The hash of the collection for which you want to get statistics. If you do not specify a collection hash, then the request will return the error code "30 - Missing mandatory parameter". |
startDate | string | The start date for statistics interval. Date format must be: YYYY-MM-DD |
endDate | string | The end date for statistics interval. Date format must be: YYYY-MM-DD |
includePageStats | boolean | If set to true an array with statistics for each page will be returned. Default: false. |
Name | Type | Description |
impressions | number | The number of impressions of the collection. Impressions are counted each time the player is loaded. |
views | number | The number of views of the collection. Views are counted each time a user interacts with the player. |
time_spent | number | The total time spent is measured in seconds and shows how much time people spend viewing the collection. |
likes (DEPRECATED) | number | The number of likes your flipbook has received on Flipsnack. |
downloads | number | The number of times your documents were downloaded from the collection. |
pages | array | This array will be returned only if the includePageStats is set to true and the request format is json.
This will be an array/list of properties containing: page (page index), time_spent (in seconds), clicks, views for each page. |
cURL
HTML
# GET
curl -F "action=collection.getStats"\
-F "apiKey=<YOUR-API-KEY>"\
-F "collectionHash=d3m0h45h"\
-F "signature=<YOUR-REQUEST-SIGNATURE>"\
https://api.flipsnack.com/v1/
<form method="get" action="https://api.flipsnack.com/v1/">
<input type="hidden" name="action" value="collection.getStats">
<input type="hidden" name="apiKey" value="<YOUR-API-KEY>">
<input type="hidden" name="collectionHash">
<input type="hidden" name="signature" value="<YOUR-REQUEST-SIGNATURE>">
<button type="submit">Submit</button>
</form>
JSON
{
"code": 20,
"status": "OK",
"data": {
"impressions": 723,
"views": 1240,
"time_spent": 53,
"downloads": 4,
"pages": [
{
"page": 1,
"time_spent": 127443,
"clicks": 392,
"views": 4529
},
{
"page": 2,
"time_spent": 89382,
"clicks": 171,
"views": 4130
}
]
}
}
Last modified 4mo ago