post https://api.exponea.com/data/v2/projects//analyses/retention
/data/v2/projects/{projectToken}/analyses/retention
Retrieve calculated (materialized) results of an already existing retention.
Please note that:
- Results of your analyses may contain Private data (PII).
- Results may be cached for up to 10 minutes.
Definition
Authorization
In this API call you must use the following authorization access and permissions:
Available access types | Permissions needed |
---|---|
Private access | GDPR > Export analyses > Allow |
Read more about:
Path parameters
Parameter | Type | Description | Required |
---|---|---|---|
projectToken | string | The ID of your project. | Required |
Body Parameters
Parameter | Type | Description | Required |
---|---|---|---|
analysis_id | string | The ID of the retention you want to retrieve. This can be found in the URL when editing an analyses. | Required |
execution_time | string | To which timestamp should the retention be evaluated. The default value is current time . | No |
timezone | string | Which timezone should the customer filter and attributes be evaluated on. The default value is UTC . | No |
format | string | How should the retention's output be formatted.csv - Formatted as CSV table with header row.table_json - Similar to CSV format, but with data represented in JSON. | Required |
Header
Parameter | Type | Description | Required |
---|---|---|---|
authorization | string | Used for authentication. Read more in the Authentication section. | Required |
content-type | string | application/json | Required |
Response description
JSON format
Attribute | Type | Description |
---|---|---|
name | string | The name of the requested retention, as displayed in the app. |
header | array of string | Names of the columns. "starting date", "initial step" and "period #" as defined in Retention definition. |
rows | array of arrays of values | Values of rows as indicated by header. |
success | boolean | Result status |
Additional payload and response example
{
"analysis_id": "60645bd7b7ed80aa5cc1c08b",
"timezone": "Europe/Bratislava",
"format": "csv"
}
starting date,initial step,period 0,period 1,period 2,period 3,period 4,period 5,period 6,period 7
1514761200,0,0,0,0,0,,,,
1546297200,0,0,0,0,,,,,
1577833200,1,0,1,,,,,,
1609455600,1,0,,,,,,,
{
"header": [
"starting date",
"initial step",
"period 0",
"period 1",
"period 2",
"period 3",
"period 4",
"period 5",
"period 6",
"period 7"
],
"name": "repurchase retention",
"rows": [
[
1514761200,
0,
0,
0,
0,
0,
"",
"",
"",
""
],
[
1546297200,
0,
0,
0,
0,
"",
"",
"",
"",
""
],
[
1577833200,
1,
0,
1,
"",
"",
"",
"",
"",
""
],
[
1609455600,
1,
0,
"",
"",
"",
"",
"",
"",
""
]
],
"success": true
}