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/ |
country | The country from which the scan will run |
fr |
fr |
schedule |
Cron statement describing how often the report should run |
daily *: 0 0 * * * |
0 0 1 * * |
pages_count | Number of pages that needs 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) |
{ { |
{
|
scenarios * | An array of the scenarios that we will run and the custom action within it. |
[{ |
|
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 |
{ |
{ |
Example for standard compliance report
This example can also be used as a template.
[
{
"name": "Didomi France",
"website": "https://www.didomi.io/",
"schedule": "0 0 * * *",
"url": "https://www.didomi.io/",
"pages_count": 10,
"country": "fr",
"enabled": true,
}
]
Example for ACM compliance report
This example can also be used as a template.
[
{
"name": "Didomi France",
"website": "https://www.didomi.io/",
"country": "fr",
"pages_count": 10,
"enabled": "true",
"filters":[{
"type": "string",
"value": "products"
}],
"schedule": "0 0 * * *",
"userAgent": "my_custom_user_agent",
"login":
{
"enabled": true,
"selectors":
{
"pathToForm": "login.mywebsite.com"
},
"credentials":
{
"username": "my_username",
"password": "my_password"
}
},
"scenarios":
[
{
"enabled": true,
"type": "accept_all",
"scenario_actions":
[
{
"type": "accept",
"order": 0
}
]
},
{
"enabled": true,
"type": "refuse_all",
"scenario_actions":
[
{
"type": "refuse",
"order": 0
}
]
},
{
"enabled": true,
"type": "no_actions",
"scenario_actions":
[]
}
]
}
]
Using the API
More detailed documentation on how to use the didomi API can be found here
When creating the payload of the request you can add one or multiple properties at the same time. The expected payload is an array that can contain one or multiple properties to insert.
Endpoint
The endpoint that should be used is
https://api.didomi.io/reports/compliances/properties?organization_id=<organization_id>
Please make sure you replace <organization_id> with your organization id.