Getting your consent logs
Don't forget to include your Access Key in the X-API-Key header of all your requests.
Let's continue with how to retrieve them. To do it, you first have to have your site id, which you can retrieve using these endpoints.
After having that, you can do a Get to our api at the following endpoint:
https://api.platform.illow.io/open-api/v1/consent-logs/{SITE_ID}
{SITE_ID} must be changed to the site id retrieved before.
That endpoint has the following attributes on the query params:
Query params
Property | Type | Description |
---|---|---|
from | string | Since when you want to retrieve the results |
to | string | The max amount of time you want to get for the results |
limit | number | Amount of results that you want to retrieve. |
lastId | string | The last id received in the last query, this is to use a pagination implemented from your side if you so desire. |
The from and to query param can be either number if it is a timestamp in unix format (using milliseconds) or string using the ISO 8601. So you can even track it correspondingly to your time zone and use it as you so desire.
The response would have the following format:
Main response
format: json
Property | Type | Description |
---|---|---|
consents | Array of Consents | An ordered array of the consents given by the user in the timeframe given at the query. It is ordered by the createdAt value in ascending order |
amount | number | Amount of results given by the query |
lastId | string | lastId returned from the query that has to be used for future key if you want to use pagination at the query params |
Sometimes, the data inside lastId is not the last consent in the array. This is not an error, the values that have to be used on the query to paginate are the ones from that field and not the values from the last consent on the array.
cURL for a minimum example:
Here we will provide a last example of a cURL, everything inside {} must be changed by the correct value, and the values on the query param are there as an example:
curl --location --request GET 'https://api.platform.illow.io/open-api/v1/consent-logs/{SITE_ID}?to=2023-09-4 21:00:00Z UTC-03&from=169387478756&limit=30&lastId=${LAST_ID}' \
--header 'x-api-key: {YOUR_API_KEY}'
All query params are optional, you can send the empty request and everything would be good.
If you want to test this endpoint on the swagger, you are always welcomed to try it at our amazing swagger