Fetch Applications
Fetch Applications is how we call apps that fetch data in real time from an endpoint from your own API in certain processes of our application. For example:
Transport rentals, to transfer your team from the airport to the accommodation, and viceversa.
Availability of meeting spaces.
Sport events taking place in a destination.
Emissions calculation.
To create a Fetch Application, you need to provide a REST endpoint accepting JSON payload with a predefined format, depending on the app type and subtype, and return a JSON response with the expected format. The HTTP request method will always be POST.
Troop Marketplace currently supports the following types and subtypes for Fetch Applications.
Use type Local Transport and subtype Local Transport Rentals if your endpoint retrieves transport rental options.
Use type Place Data and subtype Place Events if your endpoint retrieves transport rental options.
Use type Emissions and subtype Emissions Calculation if your endpoint calculates the emissions from a trip by plane, train, car or bus.
Authentication
Fetch Applications can be configured to use different authentication methods to connect your API in a secure way. When you create the new app you can enable the following metadata that will be used to fetch your API.
apiAuthMethod: values
headers
,query
, orbody
.If
headers
: The endpoint will be called with the auth parameters in the HTTP request headers.If
query
: The endpoint will be called with the auth parameters in the query parameters.If
body
: The endpoint will be called with the auth parameters in the request payload (it's always a POST).
apiAuthKey: string (max. 64 characters). This represents the name of the attribute that will carry the secret.
liveApiAuthValue: string (max. 256 characters). This represents the value of the secret for the LIVE environment.
sandboxApiAuthValue: string (max. 256 characters). This represents the value of the secret for the SANDBOX environment.
Example
For auth based on HTTP header
Authorization: Bearer dfi7vhrdf7ihv7idfhvfdi
apiAuthMethod:
headers
apiAuthKey:
Authorization
liveApiAuthValue:
Bearer dfi7vhrdf7ihv7idfhvfdi
sandboxApiAuthValue:
Bearer dfi7vhrdf7ihv7idfhvfdi
(equivalent value for sandbox environment)
For the same values of the previous example, if
apiAuthMethod
wasquery
, then there would be no custom request headers, and the endpoint would be called withhttp://my-live-api-url.com?Authorization=Bearer+dfi7vhrdf7ihv7idfhvfdi
Last updated