A very small wrapper for the Youcanbook.me api.
You set the credentials, it will grab the first profile on your dashboard and you can submit bookings to it.
import YouCanBookMeApi from './youcanbookme-api-wrapper'
Init:
const apiWrapper = new YouCanBookMeApi()
Note: I personally supply an isomorphic-fetch instance to the wrapper by using:
apiWrapper.fetch = fetch
Set your credentials:
apiWrapper.setCredentials(email, password)
Note: here password is the password you set explicitly on your dashboard.
Book:
apiWrapper.book(date, firstName, lastName, email)
Date is in the following format:
'Y-m-d H:i'
This is a WIP Todo:
- Support more profiles.
- Show availability (there is not api for this right now, support says it's not publicly available because of security reasons). We could, however, scrape the html.
- Get the fields we need to submit a booking to reflect the ones from the dashboard. Right now we only support first name, last name and email