Gravito Ltd
Search…
CMP as an API
TCF core logic as REST API
Generally the idea of providing CMP as an API is to allow developing consent management solutions for environments on which using the ordinary javascript based CMP would not be possible, ie. smart-TVs, mobile applications (on mobile platforms with limited capabilities), applications embedded to third party context etc.
Gravito CMP as an API is a service that provides the TCF core encoding/decoding capabilities as REST API. The service is stateless and it does not store any customer or client specific to backend. It provides the up-to-date purposes, features, special purposes and features as well as latest vendor information based on global vendor list.
Best way to get on-boarded to CMP as an API setup is to research it via example implementation:
Gravito - Consent Management Platform
It is made on same UI as ordinary Gravito TCF CMP (https://demo.cmp.gravito.net) but instead of running the TCF core locally with javascript API, the setup requests the standard texts, vendors etc. from the API. The initial request must contain the configuration of the CMP as request body:
1
{
2
"config": {
3
"cmpId":302,
4
"cookieName": "TcString",
5
"cookieExpiry": 2,
6
"useTopDomain": false,
7
"isServiceSpecific": true,
8
"version": 2,
9
"purposeOneTreatment": true,
10
"languageCode":"fi",
11
"publisherCountryCode": "EN",
12
"googleTcfId": 755,
13
"allowedVendors": [
14
2,
15
8,
16
11
17
],
18
"customPurposes": [
19
{
20
"type": "customPurpose",
21
"id": 1,
22
"name": "Data Collection",
23
"description": "Gravito can collect data and can use it for better experience of its customers",
24
"descriptionLegal": "Gravito can collect data and can use it for better experience of its customers",
25
"isConsentable":true,
26
"isLegitimate":true
27
28
},
29
{
30
"type": "customPurpose",
31
"id": 2,
32
"name": "Targeting",
33
"description": "Gravito can use data for targeting its customers",
34
"descriptionLegal": "Gravito can use data for targeting its customers",
35
"isConsentable":false,
36
"isLegitimate":false
37
}
38
]
39
},
40
"consent": true
41
}
Copied!
post
https://dev-cmp-api.gravito.net
/consent
Get model
Postman collection
CMP_API.postman_collection.json
26KB
Code
Last modified 11mo ago
Copy link