πŸ“˜

This section contains APIs to Gett server from the partner

Fleet Client API is to be used by Fleet to submit all ride-related information to Ride Exchange, such as:

  • Future order confirmation
  • Future/ASAP order driver assignment
  • In-ride Status upgrade process
  • In-ride Driver location updates
  • Ride completion
  • Price finalization

API endpoint

Gett provides static domain to client with unique endpoint for each request.

https://example.com/v1/{request_unique_path}

Contact Gett to receive actual web endpoint.

Authentification

Each Fleet Client API request needs to be signed by 2 tokens:

  • Oauth 2.0 with Bearer token
  • Constant Fleet token

Oauth 2.0

All client requests should contain an Oauth 2.0 Bearer token.

The token can be generated using client_id and secret_id.
Please contact Gett to receive your credentials.

Auth scope should be "ride_exchange"

In order to authenticate with the service, token needs to be obtained using

curl -X POST \
  https://example.com/v1/oauth/token \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'cache-control: no-cache' \
  -d 'grant_type=client_credentials&client_id={your_client_id}&client_secret={your_client_secret}&scope=ride_exchange'
{
    "access_token": "{temporary_bearer_token}",
    "created_at": 1574381724,
    "expires_in": 7200,
    "scope": "ride_exchange",
    "token_type": "bearer"
}

Response will contain the token and its validity time.

Using token

All subsequent Client API calls should include it in the Header:

-H 'Authorization: Bearer {temporary_bearer_token}'

The token should be renewed before expiration.

For sandbox access replace scope with ride_exchange_sandbox

Fleet token

Contact Gett to receive your Fleet token.

Constant Fleet token needs to be provided in each request Header along with Oauth.

-H 'fleet-token: {your_fleet_token}'

Rate limit

Ride Exchange takes control of request rate submitted by Fleet to avoid any undesired load.
In HTTP response to each request, Fleet will receive headers stating current rate

  • x-rate-limit-limit – stating given quota
  • x-rate-limit-remaining – stating remaining # of requests
  • x-rate-limit-reset – stating time of quota renewal
    Contact Gett if rate quota needs to be increased.

Error 429 will be returned when limit reached

Ride Exchange Response logic

Ride Exchange Business logic

Ride Exchange uses HTTP responses to Fleet Client API requests to acknowledge Fleet about both technical and business decisions.

  • 2XX response will be returned with Ride Exchange business decision in body when applicable. Response body will contain business action either confirming of declining Fleet action. Specific variants of responses are described per request.
  • 4XX will be returned if Fleet submitted invalid request (method, endpoint or structure).
  • 5XX will signify that Ride Exchange experienced server error processing request. We recommend to perform 1 to 4 retries with 5 seconds interval.
  • With any network issue (timeout/handshake problem) we recommend to perform 1 to 4 retries with 5 seconds interval.