Choose where you’d like to start

Get record by ID from Zoho Bookings

Overview

This task is used to fetch a record from the specified module using its ID.

This task is based on Zoho Bookings API.

Syntax

<response> = zoho.bookings.getRecordById(<module>, <record_id>, <connection>);

where:

ParamsData typeDescription

<response> 

KEY-VALUE

Variable which will hold the returned response.

<module> 

TEXT

The name of the module from which the record will to be fetched.

The applicable modules are:
  • Resources
  • Staff
  • Workspaces
  • Services

<record_id>

NUMBER

The ID of the record that will be fetched.

Note:
  • You can get the ID of the record from the URL. For example, the URL of a record in the resources module is in the following format:
    https://bookings.zoho.com/#/app/manage-business/resource/<record_id>/resource-info
  • You can also use the invoke URL task to fetch records from the required module. Visit Zoho Bookings API help and navigate to the details of the required module. The response will contain the IDs of all the records in the module, which can be extracted as illustrated in this sample snippet
  • You can also use zoho.bookings.getRelatedRecords task to fetch records from Services, Staff, and Resources module and then the IDs of those records can be extracted as illustrated here.
<connection>TEXT

The name of the connection.

Note:

  • In view of stopping new authtoken generation, a Zoho OAuth connection with appropriate scopes is mandatory for new integration tasks (created after the deadline specified in the post) to work as expected. Existing integration tasks will continue to work with or without the connections parameter unless the authtoken is manually deleted from accounts.
  • Add relevant scopes while creating the connection.
  • Refer to this post for the list of Zoho services that support the connections page.
  • Learn more about connections

Example

The following script fetches the record with ID - 3883XXXXXXXXXXX7032 from the module - services:

response = zoho.bookings.getRecordById("services", 3883XXXXXXXXXXX7032, "bookings_oauth_connection");

where:

response
The variable which holds the response in KEY-VALUE format.
"services"
The TEXT that represents the name of the module.
3883XXXXXXXXXXX7032
The NUMBER that represents the ID of the record that needs to be fetched.
"bookings_oauth_connection"
The TEXT that represents the name of the connection.

Response Format

Success Response

  • The success response returned will be returned in the following format:
     {
     "response": {
     "returnvalue": {
     "data": [
     {
     "duration": "60 mins",
     "buffertime": "10 mins",
     "price": "1500",
     "name": "Technical counseling",
     "currency": "INR",
     "id": "3883XXXXXXXXXXX7032"
     }
     ]
     },
     "status": "success"
     }
     }

Failure Response

  • The failure response for an invalid or non-existent record ID will be returned in the following format:
     {
     "response": {
     "returnvalue": {
     "mesage": "There is no active service for the criteria",
     "status": "failure"
     },
     "status": "success"
     }
     }

Related Links

Get Started Now

Execute