List Survey Rows
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v2/employees/survey-rows', 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"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v2/employees/survey-rows \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"items": {
"id": "<string>",
"row_type": "<string>",
"employee_id": "<string>",
"employee_survey_id": {},
"period_ids": {},
"commute_count": 123,
"status": "<string>",
"start_date": {},
"end_date": {},
"sent_at": {},
"send_count": 123,
"responded_at": {},
"co2e": {},
"calculation_status": {},
"employee_row_count": 123
},
"total": 123,
"filter_hash": "<string>"
}List Survey Rows
The employees table as one row per mobility survey: answered, pending or blank
GET
/
v2
/
employees
/
survey-rows
List Survey Rows
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v2/employees/survey-rows', 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"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v2/employees/survey-rows \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"items": {
"id": "<string>",
"row_type": "<string>",
"employee_id": "<string>",
"employee_survey_id": {},
"period_ids": {},
"commute_count": 123,
"status": "<string>",
"start_date": {},
"end_date": {},
"sent_at": {},
"send_count": 123,
"responded_at": {},
"co2e": {},
"calculation_status": {},
"employee_row_count": 123
},
"total": 123,
"filter_hash": "<string>"
}← Employees API
Retrieve the employees table as one row per mobility survey. There are three kinds of row:
response: an answered survey. One row however many commutes the answer holds (the respondent changed address or transport within the period):commute_count,period_idsand the summedco2e. A commute that answers no survey (QR, file upload, older data) is a response row of its own.pending: a survey sent and not answered yet. Sending the same survey again (same employee, period and template) updates this row instead of adding one.employee: a person with no response and no pending survey.
Request
Headers
string
required
Your API key for authentication
string
required
Your organization UUID
Query Parameters
It takes the same perimeter,search and column filters as List Employees (V2): consolidate_group, organization_id[], filter_by, filter_match, filter_or_fields, plus page and size. filter_by applies to the row columns below; period_date:rd[from,to] keeps the rows whose period lies in the range.
string
Sort as
field:asc$other:desc. Rows then follow the newest created, then the newest updated.Fields: email, name, organization_name, start_date, end_date, status, response_medium, survey_template_name, sent_at, send_count, responded_at, created_at, updated_at, co2e, commuting_type, transport_type, fuel_type, total_km, daily_trips, hours_worked_per_day, carpoolExample: sort_by=sent_at:descResponse
array[object]
Show properties
Show properties
string
Row id (the survey, the commute or the employee)
string
response, pending or employeestring
The row’s employee
string | null
The row’s survey, when there is one
array[string]
The commutes of the response
integer
How many commutes the response holds
string
pending, no_response, or the response’s situation (active, inactive, terminated)date | null
The survey’s (or commute’s) period start
date | null
The survey’s (or commute’s) period end
datetime | null
Last time the survey was sent
integer
How many times it was sent
datetime | null
When it was answered
number | null
kg CO2e of the response (null when not calculated)
string | null
calculated, calculating or not_calculatedinteger
Every row of the employee (unfiltered)
integer
Total rows matching the filters
string
Hash of the filters, required by the bulk actions over every matching row:
POST /v2/employees/survey-rows/delete-preview, /delete (with delete_orphan_employees), /resend-preview and /resend (with only_pending). They need write permission.Was this page helpful?