Let's get you set up with the Affelios Platform API so you can interact with the Affelios system programmatically.
Get your API key
Your API requests are authenticated using an API key sent in the X-Api-Key HTTP Header:
-H 'X-Api-Key: YOUR_API_KEY'
Any request sent to an endpoint that requires Authorization and doesn't include an X-Api-Key will return a 401 (Unauthorized) error.
You can generate an API key from your Dashboard at any time by navigating to Settings > API Keys
Once created click Copy to Clipboard and store the key somewhere safe ensuring that it is not exposed.
Important note: Do NOT store your API Key in any client-side or accessible code and ensure you only set permissions that are specifically required for the use case needed. Permission modules can be added or removed at any time, however, the API Key itself will only be accessible at the point of creation.
Make your first request
To make your first request, send an authenticated request to the customer endpoint using an External Customer Id and a Click Id.
Field
Description
ExternalId*
Required. The Customer Id from your system.
ExternalBrandId*
Required. The identifier that you configured in Affelios for the Brand or Shop that this customer registered to.
RegistrationDate*
Required. An ISO-8601 Zulu Timestamp of the date and time when the customer registered in your system.
ClickKey
The ClickKey is generated by Affelios and passed to your website or application. If no ClickKey exists, Affelios will either reject this customer or assign it to an internal Organic Tracking campaign which can be configured in System Settings.
Take a look at a few examples of how you might call this method using curl, Node, or C#: