Corporate Mobility API

API backend for visualising corporate mobility data
More information: https://helloreverb.com
Contact Info: dev@triply.at
Version: 0.0.1
BasePath:/triply/corporate-mobility-planner/0.0.1
All rights reserved
http://apache.org/licenses/LICENSE-2.0.html

Access

Methods

[ Jump to Models ]

Table of Contents

Default

Default

Up
get /companies/{companyId}/catchment
calculate catchment area for mode (companiesCompanyIdCatchmentGet)
<p>In V1 the catchment area for a specific mode is calculated whenever this REST service is called. One request can only calculate the catchment area for one transport mode and a given set of time steps.</p> <p>The response is a geojson <a href="https://tools.ietf.org/html/rfc7946#section-3.3">FeatureCollection</a> that consists of one <a href="https://tools.ietf.org/html/rfc7946#section-3.1.6">Polygon</a> or <a href="https://tools.ietf.org/html/rfc7946#section-3.1.7">MultiPolygon</a> per time step. The properties object of each polygon should contain a <code>time</code> field with the travel time of that catchment area. An example response can be found <a href="http://data.triply.ai/data/example_iso.json">here</a>.</p> <p>In future versions, calculating catchment areas for multiple catchment areas could be supported by changing the <code>mode</code> parameter into an array.</p>

Path parameters

companyId (required)
Path Parameter

Query parameters

mode (required)
Query Parameter — mode of transport for calculating the catchment area
times (required)
Query Parameter — travel time steps for calculating catchment area in minutes format: int32

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK

Example data

Content-Type: exampleIsochrone

Up
get /companies/{companyId}/employees
get employee addresses (companiesCompanyIdEmployeesGet)
List all saved employee address data for the company. A successful response also contains the geocoded centroid of each district identified by the zipcode uploaded.

Path parameters

companyId (required)
Path Parameter

Return type

array[EmployeeInfo]

Example data

Content-Type: application/json
[ {
  "zipcode" : "A-4020",
  "count" : 34,
  "latitude" : 48.2890788,
  "longitude" : 14.2532453
}, {
  "zipcode" : "A-4030",
  "count" : 27,
  "latitude" : 48.2485449,
  "longitude" : 14.3007944
}, {
  "zipcode" : "A-4040",
  "count" : 89,
  "latitude" : 48.344745,
  "longitude" : 14.2548773
} ]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK

Up
post /companies/{companyId}/employees
upload employee address data (companiesCompanyIdEmployeesPost)
<p>The address data that comes from the company-internal HR department. This data is usually exported as a CSV or excel file.</p> <p>For the sake of simplicity, V1 of the API will only work with CSV file in the form of <code>zipcode,count</code> in each line. In later versions, it will be possible to furhter narrow down employee locations by providing street and city names alongside the zipcode.</p> <p>The CSV file is then parsed on the server and geocoded to the centroid of the zip code for easier display on the client later.</p>

Path parameters

companyId (required)
Path Parameter

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

body EmployeeInfo (optional)
Body Parameter

Responses

201

Added employee data to service

Up
get /companies/{companyId}/mobilityScore
calculate mobilityScore for current situation at company (companiesCompanyIdMobilityScoreGet)

Path parameters

companyId (required)
Path Parameter

Return type

MobilityScore

Example data

Content-Type: application/json
{
  "mobilityScore" : 72.3,
  "stats" : {
    "car" : 0.5,
    "transit" : 0.25,
    "carUtilization" : 1.4,
    "walk" : 0.1,
    "bike" : 0.15
  },
  "totalDistance" : 92342.2,
  "totalEmissions" : 927394.25
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK MobilityScore

Up
get /companies/{companyId}/mobilityStats
get mobility statistics about company (companiesCompanyIdMobilityStatsGet)
Mobility statistics (modal split + car utilization) should be set to sensible defaults whenever a new company is created. This defaults can either be set through a per-country pre-defined dataset or on a more granular level in the future

Path parameters

companyId (required)
Path Parameter

Return type

MobilityStats

Example data

Content-Type: application/json
{
  "car" : 0.5,
  "transit" : 0.25,
  "carUtilization" : 1.4,
  "walk" : 0.1,
  "bike" : 0.15
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK MobilityStats

Up
put /companies/{companyId}/mobilityStats
update company mobility statistics (companiesCompanyIdMobilityStatsPut)
Allows manually overwriting the default modal spliat and car utilisation for a given company when more detailed data already exists (e.g. from a previously done employee survey).

Path parameters

companyId (required)
Path Parameter

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

body MobilityStats (optional)
Body Parameter

Responses

201

Created

Up
get /companies/{companyId}/packages
See improvements for mobility packages (companiesCompanyIdPackagesGet)
<p>Calculate the improvements to the by a (or a combination of) mobility package mobility score and mobility stats.</p> <p>TODO: how should we visualize these improvements?</p>

Path parameters

companyId (required)
Path Parameter

Query parameters

active (optional)
Query Parameter

Return type

array[inline_response_200]

Example data

Content-Type: application/json
[ {
  "score" : {
    "mobilityScore" : 72.3,
    "stats" : {
      "car" : 0.5,
      "transit" : 0.25,
      "carUtilization" : 1.4,
      "walk" : 0.1,
      "bike" : 0.15
    },
    "totalDistance" : 92342.2,
    "totalEmissions" : 927394.25
  },
  "package" : "walk"
}, {
  "score" : {
    "mobilityScore" : 72.3,
    "stats" : {
      "car" : 0.5,
      "transit" : 0.25,
      "carUtilization" : 1.4,
      "walk" : 0.1,
      "bike" : 0.15
    },
    "totalDistance" : 92342.2,
    "totalEmissions" : 927394.25
  },
  "package" : "walk"
} ]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK

Up
get /companies
list all Companies (companiesGet)

Return type

array[Company]

Example data

Content-Type: application/json
[ {
  "shiftWork" : true,
  "name" : "voestalpine AG",
  "industry" : [ "Steel-based technology", "Capital goods" ],
  "location" : {
    "zipcode" : "A-4020",
    "country" : "Austria",
    "city" : "Linz",
    "street" : "Industriezeile 28",
    "latitude" : 48.313394,
    "description" : "voestalpine Linz",
    "longitude" : 14.311394
  },
  "employeeCount" : 2500,
  "perceivedTransportQuality" : 6
}, {
  "shiftWork" : true,
  "name" : "voestalpine AG",
  "industry" : [ "Steel-based technology", "Capital goods" ],
  "location" : {
    "zipcode" : "A-4020",
    "country" : "Austria",
    "city" : "Linz",
    "street" : "Industriezeile 28",
    "latitude" : 48.313394,
    "description" : "voestalpine Linz",
    "longitude" : 14.311394
  },
  "employeeCount" : 2500,
  "perceivedTransportQuality" : 6
} ]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

OK

Up
post /companies
create company (companiesPost)

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

body Company (optional)
Body Parameter

Responses

201

Add a new company

Models

[ Jump to Methods ]

Table of Contents

  1. Company
  2. EmployeeInfo
  3. Location
  4. MobilityScore
  5. MobilityStats
  6. inline_response_200

Company Up

name
example: voestalpine AG
industry (optional)
example: ["Steel-based technology","Capital goods"]
shiftWork (optional)
example: true
employeeCount (optional)
example: 2500
perceivedTransportQuality (optional)
example: 6
location (optional)

EmployeeInfo Up

zipcode
example: A-2020
count
example: 28
latitude (optional)
example: 48.313394
longitude (optional)
example: 14.311394

Location Up

description (optional)
example: voestalpine Linz
latitude (optional)
example: 48.313394
longitude (optional)
example: 14.311394
street (optional)
example: Industriezeile 28
city (optional)
example: Linz
zipcode (optional)
example: A-4020
country (optional)
example: Austria

MobilityScore Up

mobilityScore (optional)
example: 72.3
totalDistance (optional)
example: 92342.2
totalEmissions (optional)
example: 927394.25
stats (optional)

MobilityStats Up

walk (optional)
example: 0.1
bike (optional)
example: 0.15
transit (optional)
example: 0.25
car (optional)
example: 0.5
carUtilization (optional)
example: 1.4

inline_response_200 Up

package (optional)
Enum:
walk
car
bike
transit
carsharing
transit_and_bike
score (optional)