Consent endpoint
Purpose
This endpoint reports that an end-user's data is allowed to be processed by Copilot.
This data can also be sent as part of the user_created / user_updated / preexisting_user_created events as a data-point instead of a response-based endpoint.
Consent data is only required for fully GDPR-compliant systems (a configuration parameter set by your Technical Onboarding Manager). This is to validate that data is being collected and that targeted campaigns are only sent out to users who explicitly agreed to analytics collection in your service.
By default, it is not required, and data will be collected automatically.
If it is required, then explicit consent must be requested from each end-user and submitted to Copilot.cx Report. End-users must be allowed to change their consent status at any time. Once they do, you must report the new status to Copilot.
Please refer the
user_id
best practices here.
API Description
Request
- Endpoint :
https://api.<YOUR_ENVIRONMENT>.bycopilot.com/v2/api/report/user_copilot_analysis_consent_changed
- HTTP Method :
POST
- HTTP Headers :
Content-Type : application/json
Authorization: Basic $YOUR_AUTH_DATA_HERE$
- HTTP Request Body:
A single
consent_value
(described below) may be sent in each Consent endpoint request.
Field | Type | Description | Mandatory |
---|---|---|---|
consent_value | Boolean | This value must be true in order to process this User’s data in Copilot. If this value is false , then the following applies. Copilot.cx will not include this user in engagement campaigns. For example, they will not receive Reduce Churn emails. This user’s raw events will not be presented in the User card on Copilot.cx Support. The user will be counted towards anonymous aggregations on Copilot.cx dashboards. | Y |
user_id | String | Specifies the unique identifier of the end-user that awarded consent. This identifier should be the same as used in the user_created event. | Y |
For example setting a user with user_id
"325ca496-afe8-4f44-bd37-b0dc90bdfdea" which agreed to Copilot.cx analysis consent (true):
{
"consent_value": true,
"user_id": "325ca496-afe8-4f44-bd37-b0dc90bdfdea"
}
- HTTP Response body:
- Success: Empty body
{}
- Failure (e.g. in case of missing property
consent_value
):{ "reason": "COMMON.REQUEST_VALIDATION", "error_message": "1 validation error: [ may not be null --> consent_value ]" }
- Success: Empty body
The following describes the two fields in the error response
reason
- Contains one of the fixed strings ‒AUTH.UNAUTHORIZED
orCOMMON.REQUEST_VALIDATION
.error_message
- Provides a description of the error that occurred.
The following lists the possible errors –
HTTP Code | Description |
---|---|
401 | Invalid Token (Not Bearer, Basic Token or Token Expired) |