Resources API: Sample Use Cases and Flows

This article presents possible use cases that your app could support, along with sample flows to implement each use case. These examples can serve as a helpful starting point as you plan your app's functionality.

Create a bookable resource

You could create a resource that's bookable only at a specific location.

To create a bookable resource:

  1. Use Query Resource Types to retrieve the ID of the resource type.

  2. Use Query Locations to retrieve the ID of the business location.

  3. Use Create Resource to create the resource by providing a name, the ID of the resource type and the ID of the business location.

If the resource type of the created resource is not yet associated to the relevant services then perform the following steps:

  1. Use Query Services to retrieve the IDs of the relevant services that are not yet associated to the resource type. You can check this by inspecting the serviceResources.resourceType fields of the service. If this field does not contain the ID of the resource type then the service is not yet associated to the type.

  2. Use Update Service to associate each service to the resource type by providing the ID of the service and the ID of the resource type. To do so add an entry to the serviceResources array of which the resourceType.id field is set to the ID of the resource type.

Did this help?