Getting Started

This is where you start appreciating the OPTIMO APIs and we have set up a nice guide for you on how to do it properly. As you spend more time with our APIS, you will feel like you cannot get enough of our APIs which is fair; there is no limit to what you can create using our APIs as a developer. So, hop on!

The Curious Case of Include

Well, as you may have realized by now, any API call at an OPTIMO endpoint would return resources related to the primary data requested. For example, in our previous API request, the Id of the Venue related to the asset would show up in the relationships of the JSON response. However, there is a way that you could request more fields (information) of those related resources; use include. Let's try one.

GET ../api/V4.1/assets?filters.assetClassId=1&filters.salesChannelId=5&filters.activeStatus=1&sort=venue.id&include=Venue

for which you are responded with

You will still find the related Venue Id in the relationships segment among other related resources, but if you scroll down further you find a new segment titled included which literally lists the resource(s) you wanted to be included in the JSON response; in this case, you find all fields of the related Venue resource. Actually you can include comma separated multiple resources in a single API request (include=Venue,Documents,Owner) and, as usual, all supported includes at a certain endpoint are listed in our API Reference. Now, do not go berserk and stuff your request with too many includes; the response would be unnecessarily long and would take longer to be delivered. Just use it wisely.

What's up with Clustered Includes?

As already mentioned, under each endpoint in our API Reference, you will find a list of supported includes. Sometimes you will notice that, in those lists, some includes are clustered into the same bullet point. In such cases, you have to include all resources in that bullet point in order to get the last one of those included in the JSON response.

For instance, to take a look at an extreme case, if you refer to the endpoint under Bookings > Bookings / Packages / Items - List, one has to include SplitBookingItems, Allocations, Timeslot and TeardownTimeslot in the API request to have TeardownTimeslot included in the response.

< Previous Next >