Create Authorization Form Consent record using APEX API

Updated on February 26, 2023

The Authorization Form Consent record is created which is used as proof related to each customer’s consent to Terms & Conditions, Privacy policy, etc. This will help the user to create a full picture of the customer’s consent to the various authorization forms. In this APEX call, the API method is used to create a corresponding ‘Authorization Form Consent’ record that is linked to both the Individual Id and the T&C/Privacy Policy Id. 

The APEX API call for Authorization Form Consent record creation is as follows:-

map < String, Object > inputDataItem = new map < String, Object > {
PCCC_DM.PCL_Constants.CONSENT_GIVER_ID => '0PK0b000000Ckz4GAC',
PCCC_DM.PCL_Constants.PRIVACY_SITE_ID => 'a0R0b00000BAshKEAT',
PCCC_DM.PCL_Constants.AUTH_FORM_TEXT_ID => '0cN0b0000000001EAA',
PCCC_DM.PCL_Constants.STATUS => 'Signed',
map < String, Object > inputData = new map < String, Object > {
PCCC_DM.PCL_Constants.AUTH_FORM_REQUEST => new List < Object > {

The details of all input parameters are as follows – 

  1. CONSENT_GIVER_ID  is an Individual ID of the Contact/Lead record.
  2. PRIVACY_SITE_ID is the lookup of a field that will be useful to link privacy sites so as to store consent for the Privacy Policy, Terms & Conditions, or End User License agreements.
  3. AUTH_FORM_TEXT_ID Manages the text associated with the authorization form. Users can also include a summary to describe the form’s purpose and display it to customers when asking for their consent. This is the required field that can be hard coded.
  4. STATUS is the standard picklist field on the authorization consent form object with values as ‘Seen’ or ‘Signed’ (Restricted Picklist Field). This is the optional field that can be hard coded.
  5. CONSENT_CAPTURE_SRC_TYPE is a standard picklist field on the authorization consent form which highlights communication preference for the consent captured (Restricted Picklist Field). This is the required field that can be hard coded.
  6. CONSENT_CAPTURE_SRC is a standard field (Text Area 255)  on the authorization consent form which populates the channel or source by which the consent is acquired. This is the required field that can be hard coded.

Solution Steps

Prerequisite – It is necessary to have at least one record of the salesforce standard object “Authorization Form”, “Authorization Form Text” and  Cloud Compliance’s custom object “Privacy Site”.

1. Navigate to a salesforce contact record for which users want to manage their consents. This contact record will have an association with the Individual.

Note– If the individual is not associated with the contact record, the user can run the auto Individual batch provided by “Cloud Compliance”. It will automatically create individual records for each Contact record based on defined criteria. 

For more details about this batch refer to this link Grouping Rules for Individual.

2. Navigate to that Individual record to get its Id. Copy the record Id from the URL. The id is highlighted in the URL for reference in the screenshot below –

3. The user next needs to go to the “Privacy Site” record and get the Privacy site id.

4. Also, get the “Authorization Form Text” records id 

5. Open the Salesforce Developer Console. Prepare the createAuthFormConsent method along with the input parameters which will be passed to the apex script. Click on the Execute button. The authorization form consent creation API is already mentioned above.

6. This API returns Record creation Status as True in case of successful Authorization form consent creation and false otherwise. It also contains a record Id that is authFormSFId.

7. The authorization form consent record which can be called as Proof of Acceptance record will be as follows – 

Note – NAME is a standard field on the Authorization Form Consent object. If the user does not pass this value through APEX API  then it will be populated as a current date-time stamp with the “CC” as the prefix.