Skip to main content

Getting your consent logs

info

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}
info

{SITE_ID} must be changed to the site id retrieved before.

That endpoint has the following attributes on the query params:

Query params

PropertyTypeDescription
fromstringSince when you want to retrieve the results
tostringThe max amount of time you want to get for the results
limitnumberAmount of results that you want to retrieve.
lastIdstringThe last id received in the last query, this is to use a pagination implemented from your side if you so desire.
Did you know...

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

PropertyTypeDescription
consentsArray of ConsentsAn 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
amountnumberAmount of results given by the query
lastIdstringlastId returned from the query that has to be used for future key if you want to use pagination at the query params
Take into consideration

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}'
Remember

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