Salesforce

Using the Asynchronous Request Creation API

« Go Back
Information
Using the Asynchronous Request Creation API
UUID-c35a2967-4869-e091-b957-f3819f20d55e
Article Content

You can call OneTrust asynchronously from a published web form or external application to dynamically create a request that will appear in the Web Form Configuration screen.

Note

This documentation uses the Postman tool to test API integrations.

To copy the API URL

  1. On the Privacy Rights Automation menu, select Web Forms. The Web Forms Templates screen appears.

  2. Click on a published web form. The Web Form Customization screen appears.

    Note

    This feature is compatible only with published web forms. For more information on creating new web forms, see Creating a Web Form.

  3. Go to the Integrate tab, then click the API tab.

    integrate-api-tab.png
  4. Click the Copy URL button in the Your API URL block.

    your-api-url.png
  5. In Postman, select POST from the endpoint field.

  6. Paste the Your API URL in the URL field.

    post-url-postman.png

To copy the API Token

  1. On the API tab in OneTrust, then click the Copy Token button in the Your API Token block.

    your-api-token.png
  2. In Postman, click the Headers tab.

  3. Enter accessToken in the Key field.

  4. Paste the API token from OneTrust in the Value field.

    access-token-postman.png

To copy the Expected Payload

  1. On the API tab in OneTrust, click the Copy Expected Payload button in the Expected Payload block.

    Note

    Any edits made to the web form fields will dynamically update in the expected payload.

    expected-payload.png
  2. In Postman, click the Body tab.

  3. Enable raw as the preview type.

    Note

    Ensure JSON is the selected file type.

  4. Paste the expected payload in the body.

    Tip

    You can add the details of a request by editing the payload. Remove any additional parameters that you don't want to send to create the request or have null values (e.g. no attachments). The call won't send with null parameter values.

    body-payload-postman.png
  5. Click the Send button.

  6. Verify the call was sent by checking the status code. If performed correctly, it should return a requestTraceId value.

    requesttraceid-postman.png
  7. Copy the requestTraceId.

To verify the request in OneTrust

  1. Create another call in Postman using the GET request status by Trace ID endpoint: GET /api/datasubject/v2/requestqueues/status/{traceId}

  2. Append the newly created requestTraceID to the end of the endpoint.

    requesttraceid-url-get.png
  3. In the Header tab, enter another API key.

  4. Click the Send button.

  5. If the call was successful, it will return a creationstatus:SUCCESS and a new requestReId.

    requestReID2.png
  6. Return to OneTrust to see if the newly created request appears in the Request Queue with the matching requestReId.

 
Article Visibility
7,710
Translation
English
Checked

Powered by