Appointment Scheduling API for Group Meetings
Tags: writing, productivity, programming, devops
Published: 2021-05-17 12:17:18

Spurwing is for Scheduling what Stripe is for Payments. Our Appointment Scheduling API enables software teams to deliver quicker, cheaper and better scheduling features.

In this post we'll explore some of the coolest features and use cases possible with the Spurwing API.

## Scheduling SDKs
We've updated our SDKs with Group Scheduling features from our API. These booking features were already present in the API but they weren't yet implemented in our official [JavaScript](https://github.com/spurwingio/Spurwing-API-Javascript-Library), [NodeJS](https://github.com/spurwingio/Spurwing-API-NodeJS-Library), [Python](https://github.com/Spurwingio/Spurwing-API-Python-Library) and [Java](https://github.com/Spurwingio/Spurwing-API-Java-Library) Libraries.

A group appointment allows us to add multiple people to a bookable slot, below is a NodeJS snippet that illustrates how this is achieved:

```js
async function demo() {
    let sp = new Spurwing();
    // let KEY = '' // spurwing private key
    // let PID = '' // spurwing provider id

    let A = await sp.get_appointment_types(PID)
    let appointment_type_id = A[3].id; // get id of group appointment type

    // create empty group appointment
    let B = await sp.create_group_appointment(KEY, PID, appointment_type_id, dateTomorrow() + ' 16:00:00')
    let apid = B.data.appointment.id

    // add john & bill as attendees
    await sp.complete_booking(PID, appointment_type_id, 'john@nevolin.be', 'john', 'Gale', null, null, apid);
    await sp.complete_booking(PID, appointment_type_id, 'bill@nevolin.be', 'bill', 'Hale', null, null, apid);

    // await sp.delete_appointment(KEY, apid)
}
```

If we now look on our dashboard, we'll see a group appointment with our two attendees:

![group scheduling api dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2umk39hvaej8vd3vb4lp.png)

The full Spurwing API is documented [here](https://docs.spurwing.io/), it contains many more endpoints we haven't added to our SDKs yet. If your project/business requires any of these please let us know asap.

## Use cases
Let's have a look at some of projects on our Marketplace and discuss how we can extend them with group booking features.

### Discord and Slack Bots
Our [Discord Bot](https://github.com/Spurwingio/Chat-Bots) allows for 1-on-1 scheduling. Our Slack bot(s) which are being developed will have a similar functionality and interface.

![discord chatbot with booking](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zlowt546lyeyts44w1v0.png)

The basic mechanism for making an appointment is using a command like:
```!book May 18 at 3pm EDT with karen@dev.to```

To facilitate multiple people we can reference Discord users like `@john @ana @karen ...`. But to notify these users of the event we should also be able to send them an email, so it'll be added to their personal calendars. One way is to manually create a mapping of <user, email> and store it in a database/file to be used by the bot (the Discord API does not reveal users' email addresses). We can also omit using email addresses entirely, and just extend the Discord Bot to notify/remind users of upcoming meetings inside the app (this works well if users are familiar with and active on Discord). Lastly, the most basic (but also manually intensive) method is to provide the email addresses explicitly.

### ChatBots

ChatBots, like our [Facebook Messenger Bot](https://github.com/Spurwingio/Chat-Bots/tree/main/Facebook/NodeJS) can be extended just as easily.

![fbchat](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ja2jtcxcyksumra71f6i.gif)
 
As shown on the gif above, we can add a third step after having received the user's date and time slot. This will ask for a list of attendees' email addresses for that meeting. These should then all receive a confirmation email (and optional reminders).

We have many more ChatBot integrations in the pipeline: WhatsApp, Amazon Lex, Intercom, Skype, Google Chat, ... If you wish to contribute to our **Open Source** projects let us know.

### Booking Widgets

Embeddable Scheduling Widgets and pages, as shown below, can be extended by allowing users to add more attendees (eg: plus/add button). This will consequentially dispatch the RSVP email to all attendees.

![scheduling widget](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c8uzt2zlv6pat08v0vb4.png)

To send **RSVP emails** to multiple attendees at once we have two options:
1. use our [iCalendar](https://github.com/Spurwingio/iCalendar-Integrations) module and program it to dispatch for each attendee separately.
2. extend our iCalendar module to facilitate multiple receivers (inside `index.js`).

![rsvp nodejs scheduling api](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/blpts782tgrpo7zmtne2.png)
 
## Conclusion
These open source examples and resources should give you a head start for building any kind of Scheduling or Booking solution. No matter the scale and stack of your project, the Spurwing [**Scheduling API**](https://www.spurwing.io/) is capable of handling **high stress** and integrating into **complex environments**.

For more information visit the links below or schedule an intro call with our engineers at https://www.spurwing.io/contact