External Consent Form Controller

findAll

MethodGET
Prod URLhttps://cpm.trustarc.com/server/api/v1/external/consent-forms
EU URLhttps://cpm.trustarc.eu/server/api/v1/external/consent-forms
HeadersAuthorization: Bearer <access_token from 'Token Access' section>
URL ParametersRequired Query Parameters
NameValueDescription
namestringConsent Form name filter
pageinteger($int32)Results page you want to retrieve (0…N).
sizeinteger($int32)Number of records per page.
sortarray[string]Sorting criteria in the format: property(,asc|desc)
Example: createdDate,asc
Sample RequestN/A
Sample Success Response
{
 "content": [{"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", ...}],
 "numberOfElements": "10",
 "totalElements": "99",
 "number": "0",
 "size": "10",
}

 

Where:

  • content – list of consent form objects
  • numberOfElements – number of elements in content
  • totalElements – number of total elements in the database
  • number – page number
  • size –size from url parameter
Success ResponseCode: 200 OK
Error Response

Code: 401 Unauthorized

Code: 403 Forbidden

Code: 404 Not Found

findById

MethodGET
Prod URLhttps://cpm.trustarc.com/server/api/v1/external/consent-forms/{id}
EU URLhttps://cpm.trustarc.eu/server/api/v1/external/consent-forms/{id}
HeadersAuthorization: Bearer <access_token from 'Token Access' section>
URL ParametersRequired Query Parameters
NameValueDescription
idstring($uuid)The id (UUID) is the ID of the consent form
Sample RequestN/A
Sample Success Response

 

{
 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
 "accountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",,
  ...
}

 

Where:

  • response – the consent form object
Success ResponseCode: 200 OK
Error Response

Code: 401 Unauthorized

Code: 403 Forbidden

Code: 404 Not Found

submitForm

MethodPOST
Prod URLhttps://cpm.trustarc.com/server/api/v1/external/consent-forms/submit
EU URLhttps://cpm.trustarc.eu/server/api/v1/external/consent-forms/submit
HeadersAuthorization: Bearer <access_token from 'Token Access' section>
URL ParametersRequired Query Parameters
NameValueDescription
consentFormSubmissionDto(body)is a DTO of data needed when submitting a form.
Sample Request
{
  "brandId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "formFieldIdValues": [
        { "00000000-0000-0000-0000-100000000000": ["EU_AD"] },
        { "18d15e23-0ff1-4d8b-8533-11cca7e62a03": ["123"] },
        { "8f9ed74f-f9c4-4de3-a785-4d776df017b6": ["test.email@gmail.com"] }
]
  "channel": "API",
  "consentFormId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "formFieldIdValues": [
    {
      "formFieldId": [
        "value"
      ]
    }
  ],
  "locale": "string",
  "websiteSource": "string"
}
Sample Success Response
{
  "brandId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "channel": "API",
  "consentFormId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "formFieldValues": [
        {
            "field": {
                "id": "00000000-0000-0000-0000-100000000000",
                "display": "Jurisdiction"
            },
            "formValues": [
                {
                    "value": "EU_AD",
                    "display": "Andorra, Europe"
                }
            ]
        },
        {
            "field": {
                "id": "8f9ed74f-f9c4-4de3-a785-4d776df017b6",
                "display": "Email Address"
            },
            "formValues": [
                {
                    "value": "test.email@gmail.com",
                    "display": "test.email@gmail.com"
                }
            ]
        },
        {
            "field": {
                "id": "18d15e23-0ff1-4d8b-8533-11cca7e62a03",
                "display": "Single Line"
            },
            "formValues": [
                {
                    "value": "123",
                    "display": "123"
                }
            ]
        }
    ],
  "locale": "string",
  "websiteSource": "string"
}

 

Where:

  • brandId– Brand UUID associated with the consent form.
  • channel– mode of submitting the form.
  • formFieldValues– Consent Form form field values
  • locale– language code
  • websiteSource– where the  data is collected.
Success ResponseCode: 200 OK
Error Response

Code: 401 Unauthorized

Code: 403 Forbidden

Code: 404 Not Found