Documentation · API reference
GET
/api/v1/sites/{site}/consentHow many were asked and what they answered, day by day
This page as Markdown, or in an AI chatMore ways to read this page
How many were asked and what they answered, day by day.
# How many were asked and what they answered, day by day
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/get-sites-site-consent
`GET /api/v1/sites/{site}/consent`
How many were asked and what they answered, day by day.
## Parameters
- `site` (in path, needed): A site's id or name
- `period` (in query): 7d, 30d, all, or two dates
## The answer
200, `ConsentSummary`: The consent log's figures (CR-06).
- `agreed` (integer, needed)
- `asked` (integer, needed): The banner was shown.
- `by_device` (list of ConsentSplit, needed)
- `by_language` (list of ConsentSplit, needed)
- `by_version` (list of ConsentSplit, needed)
- `days` (list of ConsentDay, needed)
- `declined` (integer, needed)
- `gpc` (integer, needed): Never asked: the browser sent Global Privacy Control.
- `period` (PeriodView, needed)
- `site` (string, needed)
- `unanswered` (integer, needed): Shown, and neither answer given. Treated as a no.
- `withdrew` (integer, needed)
## Asking
```sh
curl https://tidekeeper.eu/api/v1/sites/example.org/consent \
-H "Authorization: Bearer $TIDEKEEPER_TOKEN"
```
Parameters
- sitein the address
- neededA site's id or name
- periodin the query
- 7d, 30d, all, or two dates
The answer
Status 200
ConsentSummary The consent log's figures (CR-06).
- agreed
- integerneeded
- asked
- integerneededThe banner was shown.
- by_device
- list of ConsentSplitneeded
- by_language
- list of ConsentSplitneeded
- by_version
- list of ConsentSplitneeded
- days
- list of ConsentDayneeded
- declined
- integerneeded
- gpc
- integerneededNever asked: the browser sent Global Privacy Control.
- period
- PeriodViewneeded
- site
- stringneeded
- unanswered
- integerneededShown, and neither answer given. Treated as a no.
- withdrew
- integerneeded
Asking
curl https://tidekeeper.eu/api/v1/sites/example.org/consent \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN"
const answer = await fetch("https://tidekeeper.eu/api/v1/sites/example.org/consent", { headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, }, }).then((r) => r.json());