Policy Consent
Policy endpoints
GET /api/policyconsent/policy
Obtain the policy document to show to the client.
Request:
{ "PolicyId": "string", "LanguageCode": "string"}
Response:
{ "Id": "string", "Name": "string", "Type": "string", // either of 'Privacy', 'Cookie', 'TermsOfService' "Version": "string", // the current (latest) version of the policy "CompiledHtml": "string" // Policy text in HTML format}
Web endpoints
POST /api/policyconsent
Record the consent of a user to the given policy.
Request:
{ "PolicyId": "string", "ConsentGiven": "boolean", "Language": "string", "CustomUserId": "string", // Optional, e.g. user email or any custom Id "ClientId": "string", // Optional, e.g. user email or any custom Id "URI": "string", // Optional, derived from Origin header if not passed "DomainId": "string" // Optional, from SP dashboard}
Response:
{ "Created": "string" // Date, "ClientId": "string" // Unique id for the user who has given the consent // the same CustomUserId always leads to the same ClientId}
GET /api/policyconsent/:clientId
Get the full policy consent record for a user.
Request:
{ "ClientId": "string", "PolicyId": "string", "Version": "string"}
Response:
{ "Id": "string", "Created": "string", "URI": "string", "PolicyId": "string", "PolicyType": "string", "Version": "string", "ConsentGiven": "boolean", "CustomUserId": "string", // Optional "ClientId": "string"}
GET /api/policyconsent/consent-given
Checks if a user has already consented to the given policy.
Request:
{ "ClientId": "string", "PolicyId": "string", "Version": "string"}
Response:
{ "ConsentGiven": "boolean"}
Mobile endpoints
POST /api/policyconsent
[Authentication required]
Record the consent of a user to the given policy.
Request:
{ "PolicyId": "string", "Language": "string", "ConsentGiven": "boolean", "CustomUserId": "string", "ClientId": "string", "URI": "string", // Mobile screen URI "ClientSessionId": "string", "DeviceManufacturer": "string", "SDKVersion": "string", "OSVersion": "string", "MobileApplicationId": "string"}
Response:
{ "Created": "string", // Date "ClientId": "string" // Unique id for the user who has given the consent // the same CustomUserId always leads to the same ClientId}
GET /api/policyconsent/
[Authentication required]
Get the full policy consent record for a user.
Request:
{ "ClientId": "string", "PolicyId": "string", "Version": "string"}
Response:
{ "Id": "string", "Created": "string", "ConsentGiven": "boolean", "URI": "string", "PolicyName": "string", "PolicyType": "string", "PolicyId": "string", "PolicyVersion": "string", "CustomUserId": "string", "ClientId": "string",}
GET /api/policyconsent/consent-given
[Authentication required]
Checks if a mobile user has consented to the given policy.
Request:
{ "ClientId": "string", "PolicyId": "boolean", "Version": "string"}
Response:
{ "ConsentGiven": "boolean";}
Consent management endpoints
GET /api/policyconsent
[Authentication required]
Get consents by the given filters. By default selects all consents for the last week.
Request:
{ "PolicyId": "string", "CustomUserId": "string", // Optional, e.g. user email or any custom Id "FromDate": "DateTime", // Optional "ToDate": "DateTime", // Optional "ConsentGiven": "boolean", // Optional "PolicyVersion": "string", // Optional "MobileApplicationId": "string", // Optional "DeviceManufacturer": "string", // Optional "SDKVersion": "string", // Optional "OSVersion": "string", // Optional "DomainId": "string" // Optional}
Response: The list of consents in the following format:
{ "Id": "string", "Created": "string", "ConsentGiven": "boolean", "URI": "string", "PolicyType": "string", "PolicyId": "string", "Version": "string", "CustomUserId": "string", "ClientId": "string", "Fingerprint": { "IP": "string", "ProxifiedIP": "string", "UserAgent": "string", "City": "string", "State": "string", "Country": "string", "ClientSessionId": "string", "DeviceManufacturer": "string", "SDKVersion": "string", "OSVersion": "string" }}