API Documentation
General information
Authenticating requests
Axeptio API use OAuth1.0. You pass a Bearer Token in the Authorization header of your requests or append an ?access_token={your Token} to the URLS you request. Any unauthenticated request on a private resource will result in a 403 HTTP Error.
Versioning
The API version is the first part of the path. Only v1 for now.
Services
Axeptio API exposes different services. They are the second part of the paths:
/app
is the business layer of Axeptio, used to collect / import / export consent proofs/vault
is the document store where we put all the configurations (cookies, projects, etc.)/vendors
is the document store where you can find all axeptio vendors/auth
is the authentification gateway that issues access tokens and allow 3rd party logins/webhooks
allows customers to register endpoints that we will call on specific events/assets
is a file upload service that can handle and serve optimized renders of image files (using imgix)/publish
is the orchestration service that packages and deploy the project configurations (relies on AWS S3 and Cloudfront)/billing
is the Stripe Billing gateway service
Authentification
Authentification, password reset, invitations are all handled by the Auth service. Users can have several identities, provided by social login providers or by the API itself.
Sign up
To create an API user account with a local identity, you have to proceed to a local signup flow :
POST https://api.axept.io/v1/auth/local/signup
If the username and emails aren't already in use, you'll receive a payload containing the access token. This token has a limited lifetime (15d). Nota: the API does not enforce password complexity nor renewal. This is actually delegated to the application that makes the call.
This token can be appended to the URLs: ?access_token=${response.body.token}
Or passed as a HTTP header: Authorization: Bearer ${response.body.token}
Sign in
Sign in with the Axeptio API is basically getting a fresh token. To do this:
POST https://api.axept.io/v1/auth/local/signin
If you intend to sign in programmatically, you will have to store the user password. This is because the authentification service is not designed to be called that way in the first place. We'll be working on a route to renew an access_token programmatically in the next months.
The vault service
Create and manipulate Axeptio documents
This service is a RESTful CRUD that allows us to store and manipulate various types of documents. Think of it like a RESTful ORM over a document-oriented DB. Every request to the vault service has to be authentified.
Create an instance of this resource (send the "body" of the document directly)
POST https://api.axept.io/vault/${resource}
Update an instance of a resource
PUT https://api.axept.io/vault/${resource}/${documentId}
Delete an instance of a resource
DELETE https://api.axept.io/vault/${resource}/${documentId}
Add a user to the instance
POST https://api.axept.io/vault/${resource}/${documentId}/users
Creating a project (aka: website)
A client configuration is based on a Project
document. This project contains:
basic information (websiteURL, title, organization id)
design and customization props (colors, fonts, etc.)
billing data (subscription, payment source, etc.)
Data Protection Officer identity
To create a working project, only websiteURL and title are required. If you don't specify an organization id ,the project will be considered as free tier, as long as the subscription process has not been completed on the Axeptio admin app.
POST/PUT/GET/DELETE https://api.axept.io/v1/vault/projects(/${project._id})
Creating a cookie configuration
POST/PUT/GET/DELETE https://api.axept.io/v1/vault/cookies(/${cookieConfiguration._id})
The Configuration
object
Configuration
objectYou need a working project to create a coookie configuration. A cookie configuration is composed of the following props:
steps
: an array ofstep
, corresponding to the consecutive steps in the cookie widget.strings
: an object containing the user-facing messages of the widgetsettings
: an object containing apparition and UX settingsprojectId
: the ID of the project (used for joining projects and configuration in the admin panel)
The Step
object
Step
objectIt is a bit more complex, composed of the following props:
name
is the unique string identifiertitle
,topTitle
,subTitle
: plain text stringsmessage
: HTML text content displayed under the titlesimage
URL or asset identifier for the upper right imagelayout
is a string that can take one of the following options:welcome
category
info
: (Not free)soft_consent
: (Not free)
vendors
is an array containing vendor ids (not compatible withwelcome
layout)strings
is an object overriding the Cookie Configurationstrings
proptimeout
number in ms, is the time before the step goes away, only available insoft_consent
andinfo
layouts.showToggleAllSwitch
boolean that dictates whether there's a big toggle switch to rule all the vendors or not
Get a Vendor
Axeptio vendors vs Custom vendors
To add vendors to your configuration, you can either use a vendor managed by Axeptio or create a custom vendor. By default, we recommend using Axeptio vendors. These vendors are regularly updated and automatically translated into the language of your cookie configuration, with regular updates and additions.
However, there are two cases where you may want to create your own vendor:
The vendor does not exist in Axeptio's vendor database.
You are using a language that is not yet available.
In both cases, we need the vendor id
to add it to your cookie configuration.
Browse Axeptio vendors
GET https://api.axept.io/v1/vendors/solutions?data.__enable[bool]=true&data.deprecated[bool]=false&embed=categories&embed=company
These results are paginated. You can control pagination using the page
and perPage
parameters. The current pagination state can be found in the headers:
An id
is used to identify each vendor, which we will use in our cookie configuration. You will also find the main information about a vendor in the data
property, which includes the following properties:
title
: The display name of the solution.shortDescription
and longDescription: Short and long descriptions of the solution.website
: A link to the product.policyUrl
: A link to the privacy policy.categories
: The categories in which this vendor belongs.company
: The company that publishes the solution.
Create and browse Custom vendors
Custom Vendors are managed within a collection in the vault service. The API documentation provides methods for accessing, creating, and deleting an object within a collection.
POST/PUT/GET/DELETE https://api.axept.io/v1/vault/vendors(/${vendorId})
A vendor must have the following structure:
You can find the id
either during the creation of your vendor or by browsing the list of vendors.
Creating a Consent Box
POST/PUT/GET/DELETE https://api.axept.io/v1/vault/processings(/${consent._id})
A consent box configuration is made of the following properties:
projectId
:string
ID of the project (used to join project and Consent box in the admin panel)title
:string
subTitle
:string
picture
:url
icon displayed in the top right placeholdermessage
: text of the widget (can be html)purpose
: Purpose of the data processing (GDRP compliant explanation for the data processing)buttons
: it's anarray
that contains the definition of each button displayed at the bottom of the consent box. This definition consists of the following fields :text
,color
(primary or default),value
confirmations
:object
defines the content and behaviour of confirmation screens. Each screen is described by the fieldstitle
,message
andbackButtonText
processors
: anarray
of data processorsobjects
. A processor is defined by the propertiesname
,shortDescription
,role
, andwebsite
.personalDataTypes
: anarray of strings
describing every type of personal data involved in the data processing (ex: 'first name', 'last name', 'phone number', etc.)automatedDecisions
: booleanautomatedDecisionsContact
: text person to contact in case of automated decisions related claimautomatedDecisionsDetails
: text GDPR compliant explanation of automated decisionsconsentWithdraw
: text GDPR compliant explanation of the consent withdrawal procedurestorageDuration
: number in month, how long are the data collected will be stored.
Creating a Contract Box
POST/PUT/GET/DELETE https://api.axept.io/v1/vault/contracts(/${consent._id})
To create a widget for contractual consents or approval, you need to declare it in the "contracts" collection of the vault service. These contract box work by simply opening a target file or resource in a new tab of the browser, but the consent collection mechanic stay the same.
A contract box configuration is made of the following properties:
projectId
:string
ID of the project (used to join project and Consent box in the admin panel)file
:string
URL of the file that will be opened in the browser.title
:string
subTitle
:string
name
:string
attribute of the<input>
checkbox that will be appended to the parent formmessage
: text of the widget (can be html)idRequired
: Boolean that will be translated torequired="required"
in the<input>
tag.buttons
: it's anarray
that contains the definition of each button displayed at the bottom of the consent box. This definition consists of the following fields :text
,color
(primary or default),value
Publish a client configuration
Publish a configuration consists of the following steps:
User requests a publish for a specific project
The Axeptio API creates a Publish Job and returns its ID immediately
Using this ID, the calling application polls the API to get status updates about the job, respecting the specified
timeout
property in the payload or defaulting to 500ms between polls.In the meantime, the Publish service updates the job at each step of the process and...
Fetches all the widgets and creates an optimized build of every config
Checks if the resulting file exceed the free tier limitations
Checks if there's an organization attached to the project.
Checks both project and organization subscription status on Stripe
Uploads the config file on our AWS S3 Bucket
Invalidate the file in our Cloudfront Distribution.
When it's done, the publish job is marked as completed and the config is live.
To create a job, simply hit https://api.axept.io/v1/publish/jobs/${project._id}
with a POST request (no payload required). You shall receive a similar payload:
You can then use the payload.links.self
to start your polling. Beware, there is no quota policy enforced, we expect our customer to be responsible. Do not DDOS the API by forgetting to delay your polling.
Once the process is done, you will receive the URL to the CDNized config file, directly in the payload:
Dernière mise à jour