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:

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:

{
"config": {
"cmpId":302,
"cookieName": "TcString",
"cookieExpiry": 2,
"useTopDomain": false,
"isServiceSpecific": true,
"version": 2,
"purposeOneTreatment": true,
"languageCode":"fi",
"publisherCountryCode": "EN",
"googleTcfId": 755,
"allowedVendors": [
2,
8,
11
],
"customPurposes": [
{
"type": "customPurpose",
"id": 1,
"name": "Data Collection",
"description": "Gravito can collect data and can use it for better experience of its customers",
"descriptionLegal": "Gravito can collect data and can use it for better experience of its customers",
"isConsentable":true,
"isLegitimate":true
},
{
"type": "customPurpose",
"id": 2,
"name": "Targeting",
"description": "Gravito can use data for targeting its customers",
"descriptionLegal": "Gravito can use data for targeting its customers",
"isConsentable":false,
"isLegitimate":false
}
]
},
"consent": true
}

post
Get model

https://dev-cmp-api.gravito.net/consent
Get the purposes, stacks, vendors etc. to be presented on the CMP UI.
Request
Response
Request
Body Parameters
config
required
string
The CMP configuration, see example above
Response
200: OK
‚Äč

Postman collection