[#1522] API integration with Zapier and SBM

Migrated from Redmine #1522 | Author: Steven Hearn
Status: New | Priority: Normal | Created: 2026-02-13


Having so.e challenges as a new automation developer / consultant…My scope of work is as follows.

Using a zapier form (change request submission) triggered by a customer’s end user off a website, perform the following:

1.Trigger authentication to SBM to enable full access to existing bookings.
2. Zapier ZAP will obtain the unique booking code from the completed zapier change request form submitted off a website.
3. Lookup the booking code in SBM and using the new preferred date and time from the zapier change request form, look to see whether there is a booking conflict on that preferred day with the same artist.
4. If no conflict, zapier will send an sms to the artist requesting their agreement to proceed with the booking on the new date and time.
5. If the artist response is affirmative, then create the new booking and cancel the old booking, all to be done via API programmatic calls issued via a zapier zap that is authenticated to SBM.

I will be using Zapier AI to assist me with API coding and logic.

Can you confirm that the above
approach work and desired outcomes can be achieved, and please provide any feedback or advice on the approach outlined.
Thank you
Steve

Redmine Admin wrote:

hi, Steven, congratulations with your new position!
It should be possible to write what you want using our Zapier integration and some Zaps for 3rd party stuff (e.g. sms send)

Steven Hearn wrote:

Steven Hearn wrote:

Having so.e challenges as a new automation developer / consultant…My scope of work is as follows.

Using a zapier form (change request submission) triggered by a customer’s end user off a website, perform the following:

1.Trigger authentication to SBM to enable full access to existing bookings.
2. Zapier ZAP will obtain the unique booking code from the completed zapier change request form submitted off a website.
3. Lookup the booking code in SBM and using the new preferred date and time from the zapier change request form, look to see whether there is a booking conflict on that preferred day with the same artist.
4. If no conflict, zapier will send an sms to the artist requesting their agreement to proceed with the booking on the new date and time.
5. If the artist response is affirmative, then create the new booking and cancel the old booking, all to be done via API programmatic calls issued via a zapier zap that is authenticated to SBM.

I will be using Zapier AI to assist me with API coding and logic.

Can you confirm that the above
approach work and desired outcomes can be achieved, and please provide any feedback or advice on the approach outlined.
Thank you
Steve

Can you share any examples of code that may assist me

Redmine Admin wrote:

you can find all resources available here API documentation | SimplyBook.me Online Scheduling

Steven Hearn wrote:

Hello, I have used the API guide however I cannot get the authentication to work with my instance of SB M. My code appears below…can you advise what I am doing wrong and what has to be changed ?

We’re trying to call the JSON-RPC method getBookings on https://user-api.simplybook.me with parameters [{ booking_code }], but we’re getting ‘Method not found’. What is the correct method name to retrieve a booking by booking code?"

Here’s the exact raw code being used in my Zapier step:

const LOGIN_URL = “https://user-api.simplybook.me/login”;
const API_URL = “https://user-api.simplybook.me”;
const COMPANY_LOGIN = “my company name”;
const API_KEY = “the api key”;

const booking_code = inputData.booking_code || “TEST_BOOKING”;
const new_date = inputData.new_date || “15/03/26”;
const new_time = inputData.new_time || “14:00”;

function convertDateFormat(dateStr) {
if (!dateStr) return “2026-03-15”;
if (dateStr.includes(“-”) && dateStr.length === 10) return dateStr;
const parts = dateStr.split(“/”);
if (parts.length === 3) {
const [day, month, yearShort] = parts;
const fullYear = parseInt(yearShort) < 50 ? “20” + yearShort : “19” + yearShort;
return ${fullYear}-${month.padStart(2,"0")}-${day.padStart(2,"0")};
}
return “2026-03-15”;
}

const apiDate = convertDateFormat(new_date);

async function getToken() {
const response = await fetch(LOGIN_URL, {
method: ‘POST’,
headers: { “Content-Type”: “application/json” },
body: JSON.stringify({
jsonrpc: “2.0”,
method: “getToken”,
params: [COMPANY_LOGIN, API_KEY],
id: 1
})
});
const data = await response.json();
if (data.error) throw new Error(Token error: ${data.error.message});
return data.result;
}

async function getBookings(token) {
const response = await fetch(API_URL, {
method: ‘POST’,
headers: {
“Content-Type”: “application/json”,
“X-Company-Login”: COMPANY_LOGIN,
“X-Token”: token
},
body: JSON.stringify({
jsonrpc: “2.0”,
method: “getBookings”,
params: [{ booking_code }],
id: Date.now()
})
});
const data = await response.json();
if (data.error) throw new Error(Booking error: ${data.error.message});
return data.result;
}

const token = await getToken();
const bookingList = await getBookings(token);
if (!bookingList || !bookingList[0]) throw new Error(Booking not found);
const booking = bookingList[0];

return {
timestamp: new Date().toISOString(),
booking_id: booking.id,
booking_code: booking.booking_code,
client_name: booking.client_name,
client_email: booking.client_email,
client_phone: booking.client_phone,
service_name: booking.service_name,
service_id: booking.service_id,
location_id: booking.location_id,
artist_name: booking.unit_name || “Unknown”,
artist_mobile: booking.unit_phone || “”,
original_date: booking.start_date,
requested_date_input: new_date,
requested_time_input: new_time,
api_date: apiDate,
api_time: new_time,
availability_status: “Pending”,
sms_status: “Pending”,
client_email_status: “Pending”,
artist_response_status: “Awaiting Response”,
escalation_status: “Not Triggered”,
full_booking_json: JSON.stringify(booking)
};
Key Details
Credentials being used:

Company Login: Carinda
API Key: 8d9b4bbcd47ddc85c568f357d8fb033f10e0bb32e0d9228bb161d13d57182ea2
API Endpoints:

Login: https://user-api.simplybook.me/login
API: https://user-api.simplybook.me
JSON-RPC Methods being called:

getToken with params: [COMPANY_LOGIN, API_KEY]
getBookings with params: [{ booking_code }]
Error we’re getting:

“Method not found” on the getBookings call
Error: API Error: Method not found at jsonRpcCall (line 42, column 21)
Are these the correct method names?
Are the parameters in the correct format?
Should I be using different headers or authentication approach?

steve

Redmine Admin wrote:

Hi Steven,
Thanks for sharing your code. There are a few issues I can see:

  1. Wrong API endpoint for getBookings
    The user-api.simplybook.me is the login API — it’s only used for obtaining a token via getToken. Once you have the token, all subsequent API calls should go to:
    https://user-api.simplybook.me/admin
    So your API_URL should be:
jsconst API_URL = "https://user-api.simplybook.me/admin";
  1. The method getBookings doesn’t accept booking_code as a filter parameter
    The getBookings method expects a date range filter, not a booking code lookup. To find a booking by its code, you should use the getBookingDetails method instead:
jsasync function getBookingByCode(token, code) {
  const response = await fetch("https://user-api.simplybook.me/admin", {
    method: 'POST',
    headers: {
      "Content-Type": "application/json",
      "X-Company-Login": COMPANY_LOGIN,
      "X-Token": token
    },
    body: JSON.stringify({
      jsonrpc: "2.0",
      method: "getBookingDetails",
      params: [code],
      id: Date.now()
    })
  });
  const data = await response.json();
  if (data.error) throw new Error(`Booking error: ${data.error.message}`);
  return data.result;
}
  1. Checking availability & rescheduling
    For the rest of your workflow, these are the key methods you’ll need:

getStartTimeMatrix — to check available time slots for a specific date/provider, which will help you detect conflicts
book — to create the new booking
cancelBooking — to cancel the old one

All methods are documented here: API documentation | SimplyBook.me Online Scheduling — make sure you’re looking at the Admin section of the API, since you’re performing admin-level operations (looking up bookings, cancelling, etc.).
4. Security note
Please rotate your API key as soon as possible — you’ve posted it publicly in this ticket. You can generate a new one from your SimplyBook.me dashboard under Settings → API.