Mobiwijs WMO API
Number of APIs: 34
This API is the node for the different stakeholders in a specialized transport branche, focusing on establishing interaction between agencies, carriers and issuers. All documentation regarding this API is stored and updated here.
General
Security
The API will be secured at different levels as described in the sections below.
Network Layer
TLS will be used to provide end-to-end encryption.
Business Layer
Calls to the REST API will be secured using access-tokens (according to the OAuth 2.0 specification). An access token should be specified in the Authorization HTTP header for each request.
Example:
php
$response = $client->request('GET', '/api/v1/<context>', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer ' . $accessToken,
],
]);
Endpoints
An endpoint consists of the prefix api followed by the version of the API. After that a context must be provided followed by the action and an identifier (if needed) resulting in the following URL:
/api/<version>/<context>/<action>/(<identifier>)
The following contexts can be provided in a call:
Context | |
---|---|
agency | Responsible for booking new rides. |
carrier | Responsible for transporting customers. |
issuer | Responsible for providing physical cards to identify customers to the carriers. |
Success and error responses
A call has succeeded if an HTTP response code of 200 is returned in the call. Additional information might be present in the body of the response.
If an error has occurred an HTTP response code between 400 - 599 will be returned. The body can contain additional information about the error.
For a list of HTTP Status Codes and descriptions, see https://en.wikipedia.org/wiki/List_of_HTTP_status_codes.
Data formats
The API supports two data formats: application/json (JSON) and application/xml (XML).
With the 'Accept' header the data format can be specified for responses. The 'Content-Type' header specifies the data format when sending information to the API.
If no 'Accept' or 'Content-Type' header is present then 'application/json' will be used by default.
Example for a GET request
No information is sent to the API. The 'Accept' header is only required in this situation.
$response = $client->request('GET', '/api/v1/<context>', [
'headers' => [
'Accept' => 'application/xml',
'Authorization' => 'Bearer ' . $accessToken
]
]);
Example for a POST request
Information is sent to the API and received in the response. The 'Content-Type' and 'Accept' headers are required.
$response = $client->request('POST', '/api/v1/<context>', [
'headers' => [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'Authorization' => 'Bearer ' . $accessToken
]
]);
Throttling
Calls to the API are throttled. Currently there is a limit of 300 requests per minute.
Changelog
1.0.0 - 25-01-2019
First stable release of the MaasHub API.
-
Agency-JSON - Create ride POST {{AppUrl}}/api/v1/agency/ride
-
Agency-JSON - Update ride by ID PUT {{AppUrl}}/api/v1/agency/ride/{{Ride ID}}
-
Agency-JSON - Get ride by ID GET {{AppUrl}}/api/v1/agency/ride/{{Ride ID}}
-
Agency-JSON - Cancel a ride by ID DELETE {{AppUrl}}/api/v1/agency/ride/{{Ride ID}}
-
Agency-JSON - Get customer by ID GET {{AppUrl}}/api/v1/agency/customer/{{Customer ID}}
-
Agency-XML - Search customers GET {{AppUrl}}/api/v1/agency/customer/search?last_name={{LastName}}
-
Agency-XML - Create ride POST {{AppUrl}}/api/v1/agency/ride
-
Agency-XML - Update ride by ID PUT {{AppUrl}}/api/v1/agency/ride/{{Ride ID}}
-
Agency-XML - Cancel a ride by ID DELETE {{AppUrl}}/api/v1/agency/ride/{{Ride ID}}
-
Carrier-JSON - Get all rides GET {{AppUrl}}/api/v1/carrier/ride