Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Compile Multiple Types of Consent Settings

Gets consent details based on multiple actions, like email and track, across specific consent management objects when the records have a lookup relationship. Available in API version 45.0 and later.

To call Consent API, you must have either the View All Data or the Allow User Access to Privacy Data user permission. Requiring a perm ensures that the System Administrator gives explicit permission. This API accesses org-wide consent data, such as links between records and the value of consent flags, not just records to which the user ordinarily has access.

Consent API gets consent details across the Contact, Contact Point Type Consent, Data Use Purpose, Individual, Lead, Person Account, and User objects when the records have a lookup relationship.

The following table shows how the API responses are determined. If the consulted fields find conflicting consent preferences, the response returns the least permissive preference. For example, if Contact.HasOptedOutOfEmail is false, but Lead.HasOptedOutOfEmail is true, the response indicates that you can’t proceed with emailing the user.

When you select email as the action, the API only aggregates consent for records that contain the same email address. If the record ID specified in the URI is associated with a record that contains a different email address, the consent settings of the associated record aren’t included in the API response.

When the API compares consent settings across records, it doesn’t incorporate settings from converted leads.

Note

Action Fields Consulted API Response Response Schema
email
  • Contact.HasOptedOutOfEmail
  • ContactPointTypeConsent.ContactPointType
  • ContactPointTypeConsent.EffectiveFrom
  • ContactPointTypeConsent.EffectiveTo
  • ContactPointTypeConsent.PrivacyConsentStatus
  • DataUsePurpose.Name
  • Lead.HasOptedOutOfEmail
  • PersonAccount.HasOptedOutOfEmail
Within the time range if specified in ContactPointTypeConsent: Returns TRUE if all consulted field values are 0. Returns FALSE if any consulted field value is 1 or if no related Contact, Contact Point Type Consent, Lead, or Person Account object exists. See example response schema for email after this table.
fax
  • Contact.HasOptedOutOfFax
  • DataUsePurpose.Name
  • Lead.HasOptedOutOfFax
  • PersonAccount.HasOptedOutOfFax
Returns TRUE if all consulted field values are 0. Returns FALSE if any consulted field value is 1 or if no related Contact, Lead, or Person Account object exists. See example response schema for fax after this table.
geotrack
  • DataUsePurpose.Name
  • Individual.HasOptedOutGeoTracking
Returns TRUE if the consulted field value is 0. Returns FALSE if the consulted field value is 1 or if no related Individual object exists. See example response schema for geotrack after this table.
mail
  • ContactPointTypeConsent.ContactPointType
  • ContactPointTypeConsent.EffectiveFrom
  • ContactPointTypeConsent.EffectiveTo
  • ContactPointTypeConsent.PrivacyConsentStatus
  • DataUsePurpose.Name
Within the time range if specified in ContactPointTypeConsent: Returns TRUE if all consulted field values are 0. Returns FALSE if any consulted field value is 1 or if no related Contact, Contact Point Type Consent, Lead, or Person Account object exists. See example response schema for mail after this table.
phone
  • Contact.DoNotCall
  • ContactPointTypeConsent.ContactPointType
  • ContactPointTypeConsent.EffectiveFrom
  • ContactPointTypeConsent.EffectiveTo
  • ContactPointTypeConsent.PrivacyConsentStatus
  • DataUsePurpose.Name
  • Lead.DoNotCall
  • PersonAccount.DoNotCall
Within the time range if specified in ContactPointTypeConsent: Returns TRUE if all consulted field values are 0. Returns FALSE if any consulted field value is 1 or if no related Contact, Contact Point Type Consent, Lead, or Person Account object exists. See example response schema for phone after this table.
portability
  • DataUsePurpose.Name
  • Individual.SendIndividualData
Returns TRUE if the consulted field value is 1. Returns FALSE if the consulted field value is 0 or if no related Individual object exists. See example response schema for portability after this table.
process
  • DataUsePurpose.Name
  • Individual.HasOptedOutProcessing
Returns TRUE if the consulted field value is 0. Returns FALSE if the consulted field value is 1 or if no related Individual object exists. See example response schema for process after this table.
profile
  • DataUsePurpose.Name
  • Individual.HasOptedOutProfiling
Returns TRUE if the consulted field value is 0. Returns FALSE if the consulted field value is 1 or if no related Individual object exists. See example response schema for profile after this table.
shouldforget
  • DataUsePurpose.Name
  • Individual.ShouldForget
Returns TRUE if the consulted field value is 1. Returns FALSE if the consulted field value is 0 or if no related Individual object exists. See example response schema for shouldforget after this table.
social
  • ContactPointTypeConsent.ContactPointType
  • ContactPointTypeConsent.EffectiveFrom
  • ContactPointTypeConsent.EffectiveTo
  • ContactPointTypeConsent.PrivacyConsentStatus
  • DataUsePurpose.Name
Within the time range if specified in ContactPointTypeConsent: Returns TRUE if all consulted field values are 0. Returns FALSE if any consulted field value is 1 or if no related Contact, Contact Point Type Consent, Lead, or Person Account object exists. See example response schema for social after this table.
solicit
  • DataUsePurpose.Name
  • Individual.HasOptedOutSolicit
Returns TRUE if the consulted field value is 0. Returns FALSE if the consulted field value is 1 or if no related Individual object exists. See example response schema for solicit after this table.
storepiielsewhere
  • DataUsePurpose.Name
  • Individual.CanStorePiiElsewhere
Returns TRUE if the consulted field value is 1. Returns FALSE if the consulted field value is 0 or if no related Individual object exists. See example response schema for storepiielsewhere after this table.
track
  • DataUsePurpose.Name
  • Individual.HasOptedOutTracking
Returns TRUE if the consulted field value is 0. Returns FALSE if the consulted field value is 1 or if no related Individual object exists. See example response schema for track after this table.
web
  • ContactPointTypeConsent.ContactPointType
  • ContactPointTypeConsent.EffectiveFrom
  • ContactPointTypeConsent.EffectiveTo
  • ContactPointTypeConsent.PrivacyConsentStatus
  • DataUsePurpose.Name
Within the time range if specified in ContactPointTypeConsent: Returns TRUE if all consulted field values are 0. Returns FALSE if any consulted field value is 1 or if no related Contact, Contact Point Type Consent, Lead, or Person Account object exists. See example response schema for web after this table.

Example response schema for email:

1{
2"<ID/Email>" :
3{
4"result" : "<Success/errormessage>",
5"proceed" : { "emailResult" : "<Success/errormessage>", email : “<true/false>” }
6}
7}

Example response schema for fax:

1{
2"<ID/Email>" :
3{
4"result" : "<Success/errormessage>",
5"proceed" : { "faxResult" : "<Success/errormessage>", fax : "<true/false>" }
6}
7}

Example response schema for geotrack:

1{
2"<ID/Email>" :
3{
4"result" : "<Success/errormessage>",
5"proceed" : { "geotrackResult" : "<Success/errormessage>", "geotrack" : "<true/false>" }
6}
7}

Example response schema for mail:

1{
2"<ID/Email>" :
3{
4"result" : "<Success/errormessage>",
5"proceed" : { "mailingResult" : "<Success/errormessage>", "mail" : "<true/false>" }
6}
7}

Example response schema for phone:

1{
2"<ID/Email>" :
3{
4"result" : "<Success/errormessage>",
5"proceed" : { "phoneResult" : "<Success/errormessage>", "phone" : "<true/false>" }
6}
7}

Example response schema for portability:

1{
2"<ID/Email>" :
3{
4"result" : "<Success/errormessage>",
5"proceed" : { "portabilityResult" : "<Success/errormessage>", "portability" : "<true/false>" }
6}
7}

Example response schema for process:

1{
2"<ID/Email>" :
3{
4"result" : "<Success/errormessage>",
5"proceed" : { "processResult" : "<Success/errormessage>", "process" : "<true/false>" }
6}
7}

Example response schema for profile:

1{
2"<ID/Email>" :
3{
4"result" : "<Success/errormessage>",
5"proceed" : { "profileResult" : "<Success/errormessage>", "profile" : "<true/false>" }
6}
7}

Example response schema for shouldforget:

1{
2"<ID/Email>" :
3{
4"result" : "<Success/errormessage>",
5"proceed" : { "shouldForgetResult" : "<Success/errormessage>", "shouldforget" : "<true/false>" }
6}
7}

Example response schema for social:

1{
2"<ID/Email>" :
3{
4"result" : "<Success/errormessage>",
5"proceed" : { "socialResult" : "<Success/errormessage>", "social" : "<true/false>" }
6}
7}

Example response schema for solicit:

1{
2"<ID/Email>" :
3{
4"result" : "<Success/errormessage>",
5"proceed" : { "solicitResult" : "<Success/errormessage>", "solicit" : "<true/false>" }
6}
7}

Example response schema for storepiielsewhere:

1{
2"<ID/Email>" :
3{
4"result" : "<Success/errormessage>",
5"proceed" : { "storePIIElsewhereResult" : "<Success/errormessage>", "storepiielsewhere" : "<true/false>" }
6}
7}

Example response schema for track:

1{
2"<ID/Email>" :
3{
4"result" : "<Success/errormessage>",
5"proceed" : { "trackResult" : "<Success/errormessage>", "track" : "<true/false>" }
6}
7}

Example response schema for web:

1{
2"<ID/Email>" :
3{
4"result" : "<Success/errormessage>",
5"proceed" : { "webResult" : "<Success/errormessage>", "web" : "<true/false>" }
6}
7}

Syntax

URI: /services/data/vXX.X/consent/multiaction?actions=listOfActions&ids=listOfIds

Formats: JSON

HTTP methods: GET

Authentication: Authorization: Bearer token

Request body: None

Request parameters

Parameter Description
actions Required. Comma-separated list of proposed actions. If this parameter is used, action can't be used.
aggregatedConsent Optional: true or false. aggregatedConsent is the same as aggregatedConsent=true. If true, one result is returned indicating whether to proceed or not, rather than a result for each ID. If any ID in the list returns false, the aggregated result is false.
datetime Optional. The timestamp for which consent is determined. The value is converted to the UTC timezone and must be formatted as described in Valid Date and DateTime Formats. If not specified, defaults to the current date and time.
ids Required. Comma-separated list of IDs. The ID can be the record ID or the email address listed on the record.
policy Optional. Use policy=requireExplicitConsent to specify in the API response whether explicit consent was given for a contact point channel. The API returns an infoNotFound response when consent isn’t specified. This parameter is available in API version 49.0 and later.
purpose Optional. The reason for contacting a customer.
verbose Optional: true or false. verbose is the same as verbose=true. Verbose responses are slower than non-verbose responses. See the examples for a verbose response.

Example

Request for Multiaction URI structure

1curl https://MyDomainName.my.salesforce.com/services/data/v67.0/consent/multiaction?actions=track,geotrack,email&ids=003xx000008TiyY,00Qxx00000skwO,dek65@tf7h.com -H "Authorization: Bearer token"

Request for email addresses as IDs, specified purpose and timespan, and a verbose response

1curl https://MyDomainName.my.salesforce.com/services/data/v67.0/consent/action/email?ids=j0t5t5b2@tkbxp5ia.com,4quxlswo@23wj7pwh.com&datetime=2018-12-12T00:00:00Z&purpose=billing&verbose=true -H "Authorization: Bearer token"

Response Body

1{
2  "j0t5t5b2@tkbxp5ia.com" : {
3    "result" : "Success",
4    "proceed" : {
5       "email" : "false"
6      "emailResult" : "Success"
7      "track" : "false"
8      "trackResult" : "Success"
9      "solicit" : "false"
10      "solicitResult" : "Success"
11    },
12    "explanation" : [ {
13      "objectConsulted" : "ContactTypePointConsent",
14      "status" : "opt_in",
15      "purpose" : "billing",
16      "recordId" : "003xx000004TxyY",
17      "value" : "true"
18    },{
19      "objectConsulted" : "Individual",
20      "field" : "HasOptedOutOfTracking",
21      "recordId" : "0PKx000006JkyZ",
22      "value" : "true"
23    }]
24  },
25  "4quxlswo@23wj7pwh.com" : {
26    "result" : "Success",
27    "proceed" : {
28       "email" : "false"
29      "emailResult" : "Success"
30      "track" : "false"
31      "trackResult" : "Success"
32      "solicit" : "true"
33      "solicitResult" : "Success"
34    },
35    "explanation" : [ {
36      "objectConsulted" : "Contact",
37      "field" : "HasOptedOutOfEmail",
38      "recordId" : "00Qxx00000skwO",
39      "value" : "true"
40    },{
41      "objectConsulted" : "Individual",
42      "field" : "HasOptedOutOfSolicit",
43      "recordId" : "0PKx000003JcpK",
44      "value" : "false"
45    }]
46  }
47}