Download Survey Rows
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({row_ids: {}, filter_hash: '<string>', excluded_ids: {}})
};
fetch('https://api.dcycle.io/v2/employees/survey-rows/export', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v2/employees/survey-rows/export"
payload = {
"row_ids": {},
"filter_hash": "<string>",
"excluded_ids": {}
}
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/v2/employees/survey-rows/export \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"row_ids": {},
"filter_hash": "<string>",
"excluded_ids": {}
}
'Download Survey Rows
Download the selected mobility survey rows as an Excel file, exactly as the table shows them
POST
/
v2
/
employees
/
survey-rows
/
export
Download Survey Rows
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({row_ids: {}, filter_hash: '<string>', excluded_ids: {}})
};
fetch('https://api.dcycle.io/v2/employees/survey-rows/export', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v2/employees/survey-rows/export"
payload = {
"row_ids": {},
"filter_hash": "<string>",
"excluded_ids": {}
}
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/v2/employees/survey-rows/export \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"row_ids": {},
"filter_hash": "<string>",
"excluded_ids": {}
}
'← Employees API
Download the selected rows of List Survey Rows as an Excel (
.xlsx) file: one
sheet, one line per row (answered, pending or blank), in the list’s order. The file always has the same columns in the
same order, whatever the table shows on screen, so queries built on it keep working: a new column is only ever added at
the end. It writes nothing, so a Viewer can download too.
Request
Headers
string
required
Your API key for authentication
string
required
Your organization UUID
Query Parameters
The list’s own query: the same perimeter,search and column filters as
List Survey Rows. With filter_hash they must be the ones the list was loaded
with.
string
The list’s sort (
field:asc$other:desc), so the file keeps the table’s order.string
Language of the headers and labels:
es or en. Catalan or no language gives Spanish; any other, English.Body
Send eitherrow_ids or filter_hash.
array[string]
The ticked rows (at most 5,000), looked up in the whole perimeter.
string
Every row the list matches: the
filter_hash of List Survey Rows.array[string]
With
filter_hash, the rows to leave out.Response
200 with the file (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet). Columns, in order (Spanish
headers in brackets): Organization (Organización), Email, Name or ID (Nombre o ID), Period start (Inicio del periodo),
Period end (Fin del periodo), Status (Estado), Source (Fuente), File (Archivo), Survey (Encuesta), Sent (Enviada),
Times sent (Nº de envíos), Answered (Respondida), CO₂e (kg), Number of commutes (Nº de trayectos), Commuting type
(Tipo de desplazamiento), Origin (Origen), Destination (Destino), Transport (Transporte), Fuel type (Tipo de
combustible), Km to work (Km hasta el trabajo), Daily trips (Trayectos diarios), Hours worked per day (Horas trabajadas
por día), Days per week (Días por semana), Telecommuting days (Días de teletrabajo), Carpool (Coche compartido),
Creation date (Fecha de creación), Update date (Fecha de actualización).
A response with several commutes leaves the mobility columns empty and counts them in Number of commutes. An anonymous
response shows Anonymous instead of the email and no name.
Errors
| Status | Code | When |
|---|---|---|
409 | FILTER_HASH_MISMATCH | The query params are not the ones the list hashed: reload the list. |
422 | TOO_MANY_ROWS | The selection holds more than 50,000 rows: narrow the filters. |
Was this page helpful?