APEX API – Verified Privacy Policy Link

Users can use this APEX API to receive a Privacy Site URL present on particular Contact or  Lead record in an encrypted format. After passing the parameters in API, it will verify all the details and will return the verified Privacy Site URL for verified Contact or Lead record.


APEX call to get a verified Privacy Site URL for Contact/Lead as follows.

String input = '{"email":"marksth@gellcsop.com","siteId": a0L2w000000ihrrEAA","sendEmail":true,"individualInfo":{"FirstName":"Mark","LastName":"Smith","Giver_Number__c":"555"}}';
PCCC_DM.SelfServiceInfo obj = PCCC_DM.SelfServiceInfo.parse(input);
String response = PCCC_DM.SelfServiceUtils.generateEncodedURL(obj);
System.debug('response: ' + response);
 

The details of all these parameters are as follows – 

  • email – This field contains the Email Id of Contact/Lead record that the user wants to send an Email with Privacy Site Url.
  • siteId – The appropriate Privacy Site record ID.
  • sendEmail – To send Privacy Site URL on email to the Contact/Lead. Pass the boolean value “True” or “False” based on the requirement.
  • individualInfo – User can pass Individual info to verify the user and receive the appropriate Privacy Site URL.


Prerequisites:

At least one Privacy Site record must be created.

To create a Privacy Site record refer to the following link.

https://kb-cloudcompliance-knowledgebase.cs126.force.com/articles/s/article/Privacy-Policy-Creation

Solution Steps


1. Navigate to a Salesforce record (Contact record in this example) and get all the required information to pass in API call.

E.g. First Name, Last Name, Giver Number.

Note – Make sure an Individual record is created with all the necessary fields which are going to be used in REST call and it is associated with the corresponding Contact record.
Refer article Grouping Rule for Individual  to create Individual record for Contact/Lead record

1.png

2.  Navigate to the Privacy Site record and copy the record Id from the URL (a0L2w000000ihrqEAA in this example).

2.png

3. Open the Salesforce Developer Console.

3.png

4. The APEX API will return a Privacy Site URL and a success message(hasError: false).

4.png

Note: To check the Privacy Site Portal user can copy the generated link and open it in a new tab. Also if a user has passed sendEmail parameter’s value as true then Contact must have received an email containing the Privacy Site URL.

Powered by BetterDocs