Choose where you’d like to start

Update record in Zoho Bookings

Overview

This task is used to update a record with the specified values using its ID.

This integration task is based on the Zoho Bookings API - Update Appointment.

Syntax

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

where:

ParamsData typeDescription

<response> 

KEY-VALUE

The variable which will hold the returned response.

<module> 

TEXT

The name of the module in which the record will be updated with new values.

The applicable modules are:

  • appointment

<record_id> 

TEXT

The booking ID of the appointment that will be updated.

Click here to learn how to get the booking ID while creating an appointment.

<new_values> 

KEY-VALUE

The new values with which the record will be updated.

The applicable key and values are:

  • key: action
  • value: completed, cancel, and noshow

<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 example changes the status of the appointment with booking ID - #PA-00002 to completed:

// Create a map to hold the new values of the record
valuesMap = Map();
valuesMap.put("action", "completed");
 
//Execute the bookings integration task to update an appointment with the new values
response = zoho.bookings.updateRecord("appointment", "#PA-00002", valuesMap, "bookings_oauth_connection");

where:

response
The variable which holds the response in KEY-VALUE format.
"appointment"
The TEXT that represents the module name.
"#PA-00002"
The TEXT that represents the booking ID.
valuesMap
The KEY-VALUE variable that holds the new values of the record.
"bookings_oauth_connection"
The TEXT name of the connection.

Response Format

Success Response

  • The success response will be returned in the following format:
     {
     "response": {
     "returnvalue": {
     "staff_name": "\"Shawn\"",
     "customer_more_info": {
     },
     "customer_booking_start_time": "\"2019-10-18 10:00:00\"",
     "customer_contact_no": "\"+919998979695\"",
     "booked_on": "\"17-Oct-2019 16:25:03\"",
     "booking_id": "\"#PA-00002\"",
     "workspace_id": "\"3883XXXXXXXXXXX6010\"",
     "duration": "\"70 mins\"",
     "service_id": "\"3883XXXXXXXXXXX7032\"",
     "staff_id": "\"3883XXXXXXXXXXX7016\"",
     "cost_paid": "\"1500.00\"",
     "currency": "\"INR\"",
     "workspace_name": "\"Soft skills\"",
     "cost": "\"1500.00\"",
     "service_name": "\"Technical counseling\"",
     "time_zone": "\"Asia/Calcutta\"",
     "start_time": "\"18-Oct-2019 10:00:00\"",
     "due": "\"0.0\"",
     "customer_email": "\"tim@gmail.com\"",
     "booking_type": "\"appointment\"",
     "customer_name": "\"Tim McGraw\"",
     "summary_url": "\"https://shawn24.zohobookings.com/#/customer/softskills/invoice/WuLKnVtF%2F08vVAJ2Tfm5r%2FLaM1ZRiYFBYbYq1PbO83qgDo%2BJD8E64BCcHAlR9UCq\"",
     "staff_email": "\"shawn@zylker.com\"",
     "customer_booking_time_zone": "\"Asia/Calcutta GMT +05:30\"",
     "status": "\"completed\""
     },
     "status": "success"
     }
     }

Failure Response

  • The failure response for an invalid or non-existent record ID will be returned in the following format:
     {
     "response": {
     "returnvalue": {
     "message": "Invalid appointment id",
     "status": "failure"
     },
     "status": "success"
     }
     }

Related Links

Get Started Now

Execute