Engage API for data export
This section will be your guide on how to export data from the Engage platform with help of Engage API.
Longenesis.Engage provides API for eligible clients. Endpoints to export participants' responses in JSON and Excel formats are available. Check the python code sample provided below to see how to obtain the token, as well as download the export file.
Additionally, interactive API documentation is available here: https://engage-openapi.longenesis.com/docs.

import requests
AUTH_ENDPOINT = "https://auth.longenesis.com/realms/curator-engage/protocol/openid-connect/token"
USERNAME = "<your username>"
PASSWORD = "<your password>"
CLIENT_ID = "<Longenesis issued client id>"
CLIENT_SECRET = "<Longenesis issued client id>"
ENGAGE_ORG_SLUG = "<orgagization slg>"
ENGAGE_ACTIVITY_SLUG = "<activity slug>"
access_token = requests.post(
        "username": USERNAME,
        "password": PASSWORD,
        "grant_type": "password",
        "client_id": CLIENT_ID,
        "client_secret": CLIENT_SECRET,
response = requests.get(
        "activity_filter": ENGAGE_ACTIVITY_SLUG,
        "date_filter": ["2022-01-01", "2023-01-31"],
    headers={"Authorization": f"Bearer {access_token}"},
with open("report_file.xlsx", "wb") as f:
How to run the sample script
We provide the sample script in the python programming language. However, the workflow illustrated here will be the same in any other language.
To run the sample script you will need credentials (username, password, client_id, client_secret are issued by Longenesis) and the ID of the activity (you can find it in the Engage platform).
Apart from having Python installed, you will also need the popular requests library to make API calls and optionally a virtual environment too.
Assuming you have saved the sample code in a file my_sample_script.py and have set the credentials and activity ID correctly, you can create the virtual environment, run the script and have your export file by running the following commands in terminal:

python3 -m venv venv
source venv/bin/activate
pip install requests
python3 my_sample_script.py
A new file report_file.xlsx should now appear in the same folder.
Full API documentation is available here.