A UK traveler from London, Heathrow to JFK on August 30, 2022, for tourism purposes.
Using the v3 trips endpoint reference we can build out the following Request Headers, URL & Body:
|Accept-Encoding||gzip, deflate, br||Recommended|
|x-api-key||*Your API Key*||Required|
Now let’s look at the API response (attached).
We can see a lot more data being returned in this endpoint versus the procedures endpoint (most notably COVID restrictions). However, in our current use case, we are only interested in Visa Requirements.
If we look carefully at the response we can see data.attributes.informationGroups contains a procedure with the type=VISA_REQUIREMENTS. In addition, data.attributes.informationGroups.groupings.data.id will give us the following procedure ID:
Since this is the only VISA procedure within the included array, this is the correct procedure to display.
If we want more information about this procedure we can filter the included array for this procedure ID. included.attributes will give us all the relevant information we need.