Sessions
Get session
Sessions
Get session
Get session by ID
GET
/
sessions
/
{id}
X-API-KEY
string
*
X-API-KEY
Required
string
id
string
*
id
Required
string
ID of the resource
curl --request GET \
--url https://cookiechimp.com/api/v1/sessions/{id} \
--header 'X-API-KEY: <api-key>'
{
"id": "sess123",
"user_id": "user456",
"pageviews": [
{
"id": "pageview789",
"session_id": "sess123",
"url": "https://www.example.com/products",
"consent_id": null,
"active_cookies": [
"essential-cookie-1"
],
"created_at": "2023-01-20T12:45:30Z"
},
{
"id": "pageview890",
"session_id": "sess123",
"url": "https://www.example.com/products/123",
"consent_id": "consent321",
"active_cookies": [
"essential-cookie-1",
"cookie1",
"cookie2"
],
"created_at": "2023-01-20T12:50:00Z"
}
],
"consents": [
{
"id": "consent321",
"session_id": "sess123",
"user_id": "user456",
"user_preferences": {
"accept_type": "all",
"accepted_categories": [
"cat1",
"cat2"
],
"rejected_categories": [
"cat3",
"cat4"
],
"accepted_services": {
"company1": [
"cookie1",
"cookie2"
]
},
"rejected_services": {}
},
"created_at": "2023-01-20T12:46:30Z"
}
],
"first_seen_at": "2023-01-20T12:45:30Z",
"last_seen_at": "2023-01-20T12:50:00Z"
}
Authorizations
X-API-KEY
string
headerrequiredPath Parameters
id
string
requiredID of the resource
Response
200 - application/json
id
string
Unique identifier for the session
user_id
string | null
ID of the user set by your website
pageviews
object[]
List of pageviews in the session
pageviews.id
string
Unique identifier for the pageview
pageviews.session_id
string
ID of the session
pageviews.url
string
URL of the pageview
pageviews.consent_id
string | null
If the user has given consent, the ID of the consent that is associated with the pageview
pageviews.active_cookies
string[]
List of active cookies in the pageview
pageviews.created_at
string
Date and time when the pageview was created
consents
object[]
List of consents in the session
consents.user_id
string
ID of the user set by your website
consents.user_preferences
object
requiredconsents.user_preferences.accept_type
enum<string>
Available options:
all
, custom
, necessary
consents.user_preferences.accepted_categories
string[]
consents.user_preferences.rejected_categories
string[]
consents.user_preferences.accepted_services
object
consents.user_preferences.rejected_services
object
consents.id
string
Unique identifier for the consent
consents.session_id
string
ID of the session
consents.created_at
string
Date and time when the consent was created
first_seen_at
string
Date and time when the session was first seen
last_seen_at
string
Date and time when the session was last seen
curl --request GET \
--url https://cookiechimp.com/api/v1/sessions/{id} \
--header 'X-API-KEY: <api-key>'
{
"id": "sess123",
"user_id": "user456",
"pageviews": [
{
"id": "pageview789",
"session_id": "sess123",
"url": "https://www.example.com/products",
"consent_id": null,
"active_cookies": [
"essential-cookie-1"
],
"created_at": "2023-01-20T12:45:30Z"
},
{
"id": "pageview890",
"session_id": "sess123",
"url": "https://www.example.com/products/123",
"consent_id": "consent321",
"active_cookies": [
"essential-cookie-1",
"cookie1",
"cookie2"
],
"created_at": "2023-01-20T12:50:00Z"
}
],
"consents": [
{
"id": "consent321",
"session_id": "sess123",
"user_id": "user456",
"user_preferences": {
"accept_type": "all",
"accepted_categories": [
"cat1",
"cat2"
],
"rejected_categories": [
"cat3",
"cat4"
],
"accepted_services": {
"company1": [
"cookie1",
"cookie2"
]
},
"rejected_services": {}
},
"created_at": "2023-01-20T12:46:30Z"
}
],
"first_seen_at": "2023-01-20T12:45:30Z",
"last_seen_at": "2023-01-20T12:50:00Z"
}