Access your interface

Enter your email address to access your personal interface.

Technical best practice - Eulerian Marketing Platform API

Updated 12 June 2026

Best practice - Eulerian Marketing Platform API

1. Authentication and security

API token

The Eulerian API uses a Bearer token sent in the HTTP Authorization header.

Authorization: Bearer <votre_token_api>

Best practice:

  • Never hard-code the token in your source code. Use an environment variable or a secrets vault (Vault, AWS Secrets Manager and so on).
  • Restrict tokens to the permissions strictly needed (principle of least privilege).
  • Do not write authorisation headers to your application log files.

HTTPS required

Every request must go over HTTPS.

2. General integration principles

URL structure

https://<votre_domaine_eulerian>/ea/v2/<endpoint>

The domain is specific to your Eulerian account (e.g. dem.api.eulerian.com).

Standard headers

Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Rate limiting

  • Respect the rate limits set by Eulerian (see the documentation for your contract).
  • Implement exponential backoff when you receive a 429 Too Many Requests response.
  • Do not parallelise calls excessively: prefer ordered processing queues.

Idempotence

  • For job creation requests, use a business identifier (a client-side jobrun_id) to avoid duplicates when you retry.
  • Check whether a similar job already exists before creating a new one.

3. Batch Reporting · Overview

Batch Reporting is the main way to extract large volumes of analytics data from the Eulerian platform. Unlike synchronous requests (limited to small volumes), Batch works asynchronously:

  1. You submit a report request → Eulerian creates a job and returns a jobrun_id.
  2. You check the job’s status at regular intervals (polling).
  3. Once the job is finished (DONE), you download the results file.

When should you use Batch Reporting?

Use caseRecommendation
Extracting data over more than 7 daysBatch required
More than 10,000 rows expectedBatch recommended
Scheduled processing / nightly ETLBatch
Real-time dashboards (< 1,000 rows)Synchronous API
Tests / ad hoc explorationSynchronous API

4. Life cycle of a Batch job

[SUBMIT]  →  PENDING  →  RUNNING  →  DONE
                                  ↘  FAILED
                                  ↘  EXPIRED
StatusDescription
PENDINGJob queued, not yet processed
RUNNINGBeing processed on the Eulerian side
DONEReport ready to download
FAILEDError during processing (see the error field)
EXPIREDThe results file was not downloaded in time

How long results are kept: the files Eulerian generates are available for a limited time (usually 24 to 72 hours). Download and archive the results as soon as the status is DONE.

5. Polling and status handling

Status endpoint

GET /ea/v2/report/batch/status.json?jobrun-id={jobrun_id}

Never poll too aggressively: it uses up your API call quota for nothing.

Suggested interval:

Time since submissionPolling interval
0 – 2 minEvery 30 seconds
2 – 10 minEvery 60 seconds
10 – 60 minEvery 5 minutes
> 60 minEvery 15 minutes

Maximum timeout: set an overall timeout (e.g. 4 hours). Beyond it, treat the job as failed and raise an alert.

Implementation:

  • Store the jobrun_id persistently (database, file) so that polling can resume after your application restarts.
  • Do not start a new job if an identical one is already in progress (PENDING or RUNNING).

Example polling loop (pseudo-code)

ATTENDRE 30 secondes
TANT QUE timeout non atteint :
    statut = GET /batch/status.json?jobrun-id{jobrun_id}
    SI statut == DONE → télécharger résultat → FIN
    SI statut == FAILED → logger erreur → FIN
    SI statut == EXPIRED → relancer job → FIN
    ATTENDRE intervalle_adaptatif()
SINON → alerter équipe ops

7. Retrieving and processing the results

Download endpoint

GET /ea/v2/report/batch/download.json?jobrun-id={jobrun_id}

The response contains either the file itself, streamed, or a temporary download URL.

Download best practice

  • Stream the download rather than loading the whole file into memory (files can reach several hundred MB).
  • Archive the raw file before any processing (so that processing stays idempotent).

Processing the CSV

  • Always specify UTF-8 encoding when opening the file.
  • Handle header rows dynamically (columns can change).
  • Check the number of columns in each row before inserting it into the database.
  • Handle null values and empty strings explicitly (do not confuse them with 0).

Handling large volumes

For files over 100 MB:

  • Process line by line as a stream (never load everything into RAM).
  • Insert into the database in batches of 1,000 to 5,000 rows (bulk insert).
  • Implement error recovery that records the last line processed.

8. Error handling

HTTP codes to handle

CodeMeaningRecommended action
200SuccessNormal processing
400Invalid requestLog the response, fix the parameters
401Invalid/expired tokenRenew the token, raise an alert
403Insufficient permissionsCheck the token’s rights
404Job not foundThe job has expired or the ID is wrong
429Rate limit reachedExponential backoff (min. 60s)
500Eulerian server errorRetry after a delay, contact support if it persists
503Service unavailableRetry with backoff, keep an eye on Eulerian’s status

Retry strategy

Tentative 1 : immédiate
Tentative 2 : +5 secondes
Tentative 3 : +15 secondes
Tentative 4 : +60 secondes
Tentative 5 : +300 secondes
Au-delà : alerter et abandonner

Never retry on 400, 401 or 403 errors (client errors: fix the problem first).

Logging

  • Always log: timestamp, endpoint called, HTTP code received, job_id, request duration.
  • Never log the API token or end users’ personal data.
  • Keep error logs for at least 30 days to make debugging easier.

9. Go-live checklist

Security

  • API token stored in an environment variable (never hard-coded)
  • HTTPS enforced on every call
  • Logs contain neither the token nor personal data

Robustness

  • Retry with exponential backoff implemented
  • Overall polling timeout set (recommended: 4 hours)
  • jobrun_id persisted so you can resume after a crash
  • Status checked before restarting an identical job

Performance

  • Date ranges split into windows of ≤ 90 days
  • Column selection limited to what is strictly needed
  • Download streamed (the file is never loaded whole into memory)
  • Database insertion in batches (bulk insert)

Monitoring

  • Alerts on jobs in FAILED or KILLED
  • Alerts on 401/403 errors (expired token)
  • Dashboard tracking job processing times
  • Raw files archived before processing

Tests

  • Tests on short date ranges before going live
  • Output CSV format validated (number of columns, encoding)
  • Behaviour tested on a 429 (rate limiting)
  • Recovery tested after an interruption during polling

In this section

1 page