Newer Version Available

This content describes an older version of this product. View Latest

Use the Consent API with Customer Data Platform

The Consent API supports Customer Data Platform. Use the Consent API to read and write to the Customer Data Platform profile. Contact your Salesforce Representative for consumer rights guidance within Customer Data Platform.

Required Permissions

To use Customer Data Platform parameters for Consent API, you must have either the ModifyAllData or the ConsentApiUpdate user permission. Requiring a perm ensures that the Salesforce admin gives explicit permission. These parameters write org-wide consent data, such as links between records and the value of consent flags, which are usually inaccessible to non-admin users.

Actions supported by Consent API with Customer Data Platform

Action Description
Processing This action is used to restrict processing of data in Customer Data Platform processes such as query, segmentation and so on.
Portability This action is used to allow export of Customer Data Platform profile data.
Shouldforget This action indicates right to be forgotten, which means delete my PII (Personally Identifiable Information) data and any related records.

Customer Data Platform Read Parameters

The Consent API allows you to gather information about the Customer Data Platform profile. Use the mode and ids Customer Data Platform parameters as described below.

Syntax

HTTP method
GET
Available since release:
48.0
URI

You can access the consent API using three different URIs based on the Action. The Actions supported are processing, portability, and shouldforget.

Note

1/services/data/vXX.X/consent/action/processing?ids=<list_of_ids>&mode=<cdp>
2/services/data/vXX.X/consent/action/portability?ids=<list_of_ids>&mode=<cdp>
3/services/data/vXX.X/consent/action/shouldforget?ids=<list_of_ids>&mode=<cdp>
Request parameters
Parameter Description
ids Required. Comma-separated list of IDs. The ID can be the record ID or the email address listed on the record. When mode is set to cdp, the ids value is a string equal to the Individual ID attribute. This is the email address used to sync consent.
mode Optional. Default is normal. Valid value to retrieve a CDP profile is cdp.

Customer Data Platform Read Example

URI
/services/data/v56.0/consent/action/portability?ids=00932I3SU92&mode=cdp
Response
{ "j00932I3SU92" : { "result" : "Success", "proceed" : { "portability" : "true" "portabilityResult" : "Success" } } }

Customer Data Platform Write Parameters

The Consent API also allows you to write information to the Customer Data Platform profile. Use the ids, mode, and status parameters as described below.

You can update your consent information with the consent API using three different URIs. The URIs are based on the action that is to be performed on the CDP profile. The actions supported are processing, portability, and shouldforget.

Note

Syntax

HTTP method
PATCH
Available since release
50.0
URI when action is processing
/services/data/vXX.X/consent/action/processing?ids=list_of_ids&mode=cdp&status=optin or optout
Request parameters when action is processing
Parameter Description
ids Required. Comma-separated list of IDs. The ID can be the record ID or the email address listed on the record. When mode is cdp, the ids value is a string equal to the Individual ID attribute. This is the email address used to sync consent.
mode Optional. Default is normal. Valid value to use for updating a CDP profile is cdp.
status Required. Status of the consent. Allowed values are optin or optout. However, when action is processing use status as optout.
URI when action is shouldforget
/services/data/vXX.X/consent/action/shouldforget?ids=list_of_ids&mode=cdp&status=optin or optout
Request parameters when action is shouldforget
Parameter Description
ids Required. Comma-separated list of IDs. The ID can be the record ID or the email address listed on the record. When mode is cdp, the ids value is a string equal to the Individual ID attribute. This is the email address used to sync consent.
mode Optional. Default is normal. Valid value to use for updating a CDP profile is cdp.
status Required. Status of the consent. Allowed values are optin or optout. However, when action is shouldforget use status as optin.
URI action is portability
/services/data/vXX.X/consent/action/portability?ids=list_of_ids&mode=cdp&status=optin or optout
Request parameters when action is portability
Parameter Description
ids Required. Comma-separated list of IDs. The ID can be the record ID or the email address listed on the record. When mode is cdp, the ids value is a string equal to the Individual ID attribute. This is the email address used to sync consent.
mode Optional. Default is normal. Valid value to use for updating a CDP profile is cdp.
status Required. Status of the consent. Allowed values are optin or optout. When action is portability use status as optin.
aws_s3_bucket_id Required only when mode is 'cdp' and the action is 'portability'. This parameter must be passed in as part of the PATCH request body. This parameter is used to pass the S3 bucket location for portability requests to Customer Data Platform.
aws_access_key_id Required only when mode is 'cdp' and the action is 'portability'. This parameter must be passed in as part of the PATCH request body. This parameter is used to pass the S3 bucket access key for portability requests to Customer Data Platform.
aws_secret_access_key Required only when mode is 'cdp' and the action is 'portability'. This parameter must be passed in as part of the PATCH request body. This parameter is used to pass the S3 bucket secret access key for portability requests to Customer Data Platform.
aws_s3_folder Required only when mode is 'cdp' and the action is 'portability'. This parameter must be passed in as part of the PATCH request body. This parameter is used to pass the S3 bucket folder for portability requests to Customer Data Platform.
aws_region Required only when mode is 'cdp' and the action is 'portability'. This parameter must be passed in as part of the PATCH request body. This parameter is used to pass the S3 bucket's aws region for portability requests to Customer Data Platform.

Customer Data Platform Write Example

When action is processing
1/services/data/v56.0/consent/action/processing?ids=100000695&mode=cdp&status=optout
2body: {}
When action is portability
1/services/data/v56.0/consent/action/portability?ids=100000695&mode=cdp&status=optin
2   body:{
3          "aws_s3_bucket_id" : "cdpgdprtest",
4          "aws_access_key_id": "AKIAS4AK7TBJBHUPOBEI",
5          "aws_secret_access_key": "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",
6          "aws_s3_folder": "yyun/Person",
7          "aws_region": "us-west-1"
8        }
When action is shouldforget
1/services/data/v56.0/consent/action/shouldforget?ids=100000695 &mode=cdp&status=optin
2body: {}