An open API service indexing awesome lists of open source software.

https://github.com/pathikrit/node-joan

Thin nodejs client around the Joan API
https://github.com/pathikrit/node-joan

Last synced: over 1 year ago
JSON representation

Thin nodejs client around the Joan API

Awesome Lists containing this project

README

          

This is a lightweight nodejs Promise based wrapper around the [Joan API](https://portal.getjoan.com/api/docs/)

## Installation [![NPM Package Version](https://img.shields.io/npm/v/node-joan.svg?)](https://www.npmjs.com/package/node-joan)
```sh
npm add node-joan
```

## Example
```js
const {JoanAPIClient} = require('node-joan');

const joan = new JoanAPIClient('client_id', 'client_secret')

joan.devices().then(res => console.log(res))

joan.book({
source: "conf_room_one.calendar.google.com",
start: "2019-11-05T13:00:00-05:00",
end: "2019-11-05T14:00:00-05:00",
})
.then(res => console.log(res))
.catch(err => console.error(err))

joan.accessToken().then(token => console.log(token))
```

## APIs
```js
joan.accessToken()
joan.me()
joan.devices()
joan.users()

// Rooms APIs
joan.rooms.get()
joan.rooms.get(id)
joan.rooms.post(data)
joan.rooms.put(id, data)
joan.rooms.patch(id, data)
joan.rooms.delete(id, data)
joan.rooms.book(data)

// Events APIs
joan.events.cancel(data)
joan.events.checkin(data)
joan.events.extend(data)
joan.events.move(data)
joan.events.book(data)
joan.events.invite(data)
joan.events.confirm(data)
joan.events.reject(data)
```

### Primitive APIs
Directly call any HTTP endpoints using the following low level utils:
```js
joan.get(path)
joan.post(path, data)
joan.put(path, data)
joan.patch(path, data)
joan.delete(path, data)
joan.options(path)
```