Consents
Get consent
Get consent by ID
GET
/
consents
/
{id}
Get consent
curl --request GET \
--url https://cookiechimp.com/api/v1/consents/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://cookiechimp.com/api/v1/consents/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cookiechimp.com/api/v1/consents/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cookiechimp.com/api/v1/consents/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cookiechimp.com/api/v1/consents/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cookiechimp.com/api/v1/consents/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cookiechimp.com/api/v1/consents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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"
}{
"error": {
"code": 400,
"message": "Invalid request"
}
}Authorizations
API token obtained from the login endpoint or the dashboard
Path Parameters
ID of the resource
Was this page helpful?
Previous
List groupsList all groups belonging to the authenticated partner. Requires a partner API token.
Next
⌘I
Get consent
curl --request GET \
--url https://cookiechimp.com/api/v1/consents/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://cookiechimp.com/api/v1/consents/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cookiechimp.com/api/v1/consents/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cookiechimp.com/api/v1/consents/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cookiechimp.com/api/v1/consents/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cookiechimp.com/api/v1/consents/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cookiechimp.com/api/v1/consents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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"
}{
"error": {
"code": 400,
"message": "Invalid request"
}
}