1. Help Center
  2. Compliance report

How to use the API to create a new report

The purpose of this document is to describe how to correctly use the API to create one or multiple new reports.

Configuration fields

The table below describes all the fields that are configurable when creating a new report via the API. 

⚠️ Fields and values with * are only available for the ACM solution

Label Description Possible values Didomi example
name Name of the report as it appears in the Didomi console string Didomi France
website The website to be scanned url starting with https:// https://www.didomi.io/
schedule

Cron statement describing how often the report should run

daily *: 0 0 * * *
weekly *: 0 0 * * 0 
monthly: 0 0 1 * *
single run: null

0 0 1 * *
url Same as website url starting with https:// https://www.didomi.io/
pages Number of pages that  to be scanned int <= 20 10
filters A filter on the pages that will be scanned. Can use a string (eg. "/products will scan only url pages containing /products) or a regular expression (eg. ^p will scan all url pages starting with p)
{
"type": "string",
"value": "string"
}
{
"type": "regex",
"value": "string"
{

"type": "string",

"value": "products"

 

country Country code from which our bot will access the url

France: fr,

Spain: es,

United States: us,

Canada: ca,

Belgium: be,

Germany: de,

Great Britain: gb

fr
actions -> actions Array of actions that will be executed in order
{ 
"type": "type",
"params":
{
"text":"<text to insert>",
"selector": "#css_selector"
}
}
{
"type": "clickOnElement",
"params":
{
"selector": "#css_selector"
}
}
{ 
"type": "eval",
"params":
{
"script":"<js script to run>"
}
}
{
"type": "clickOnElement",
"params":
{
"selector": "#didomi-notice-learn-more-button"
}
}

{
"type": "clickOnElement",
"params":
{
"selector": "#didomi-consent-popup > div > div > div > div > div.didomi-consent-popup-footer.didomi-popup-footer > div > button.didomi-components-button.didomi-button.didomi-button-standard.standard-button"
}
}
scenarios * An array of scenarios that will run

[  "CONSENT_TO_ALL", "REFUSE_TO_ALL", "NO_USER_CHOICE"]

[  "CONSENT_TO_ALL", "REFUSE_TO_ALL", "NO_USER_CHOICE"

]

user_agent * User agent that the bot will use when scanning.  string "my_custom_user_agent"
login * Credentials and settings for running a scan on a logged in environment
{
"enabled": true,
"selectors": {
"pathToForm": "string",
"usernameField": "string",
"passwordField": "string",
"submitButton": "string"
},
"credentials": {
"username": "string",
"password": "string"
}
{
"enabled": true,
"selectors": {
"pathToForm": "login.mywebsite.com"
},
"credentials": {
"username": "my_username",
"password": "my_password"
}
organisation_id Organisation id of the organisation where the property will be added string demo_org_id

 

Example for standard compliance report

This example can also be used as a template.

[
  {
  "name": "Didomi France",
  "website": "https://www.didomi.io/",
    "scraper": {
      "schedule": "0 0 * * *",
    "url": "https://www.didomi.io/",
    "pages": 10,
      "country": "fr",
      "enabled": "true",
    "actions": [{
"page":"first",
"actions":[{
"type":"clickOnElement",
"params":{
"selector":"#didomi-notice-learn-more-button"}}]}],
    },
  "organization_id": "demo_org_id"
  }
]

Example for ACM compliance report

This example can also be used as a template.

[
  {
  "name": "Didomi France",
  "website": "https://www.didomi.io/",
    "scraper": {
      "schedule": "0 0 * * *",
    "url": "https://www.didomi.io/",
    "pages": 10,
      "country": "fr",
      "enabled": "true",
    "actions": [{
"page":"first",
"actions":[{
"type":"clickOnElement",
"params":{
"selector":"#didomi-notice-learn-more-button"}}]}],
    },
   "scenarios": [
        "CONSENT_TO_ALL",
        "REFUSE_TO_ALL",
        "NO_USER_CHOICE"
      ],
    "userAgent": "my_custom_user_agent",
      "login": {
        "enabled": true,
        "selectors": {
        "pathToForm": "login.mywebsite.com"
        },
        "credentials": {
        "username": "my_username",
        "password": "my_password"
        }
      }
    },
  "organization_id": "demo_org_id"
  }
]