Chained Workflows

Some Spotnana APIs rely on a chained workflow where the response from one API call is used as part of the request body in subsequent API calls. For example, the Get Air Itineraries API provides a unique searchId as a result of a successful POST API call. This unique searchId is required as part of the request body in the Get Flight Attributes API that must be called next.

Chained Workflows

Fig: Visual representation of a chained workflow.

Sample Use Case

Consider the following scenario that uses our Air APIs to illustrate a typical chained workflow:

You need to retrieve a selected itinerary and its corresponding information such as the leg details, number of travelers, ticket fare, ticket type, policy information and so on. You could use the Get selected itinerary API to retrieve this information. However, that API requires a searchId and itineraryId as mandatory parameters as part of the request body.

To retrieve the unique searchId and itineraryId, you’ll first need to run the Get air itineraries API and the Get flight attributes API in sequential order. These two APIs will return the searchId and itineraryId along with other relevant information. You can now copy and use these two parameters to run the Get selected itinerary API.

Air Workflow

Fig: Chained workflow to run the Get Selected Itinerary API.

Some of Spotnana's other APIs also use similar chained workflows. You can find the documentation for these workflows under each API-specific reference topic.

Copyright © 2020-2024 Spotnana Technology, Inc.