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.

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, or body.

    • 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

  1. For auth based on HTTP header Authorization: Bearer dfi7vhrdf7ihv7idfhvfdi

    • apiAuthMethod: headers

    • apiAuthKey: Authorization

    • liveApiAuthValue: Bearer dfi7vhrdf7ihv7idfhvfdi

    • sandboxApiAuthValue: Bearer dfi7vhrdf7ihv7idfhvfdi (equivalent value for sandbox environment)

  2. For the same values of the previous example, if apiAuthMethod was query, then there would be no custom request headers, and the endpoint would be called with http://my-live-api-url.com?Authorization=Bearer+dfi7vhrdf7ihv7idfhvfdi

Last updated