2khc / Meeting-Scheduler-Server

The server for the VSTS Meeting Scheduler
1 stars 0 forks source link

Table of Contents

Installation
Meetings

Headers

How To Use Kelvin's API??!?!?!

Installation

Firstly, you need to install the packages that is required for the server to run.

npm install

To start the development server with debug enabled:

DEBUG=*:server node ./bin/www

Currently, any requests made to your local server is then made on the existing DocumentDB server already hosted on Azure. In production, the server will also be hosted onto Azure (I think).

How to deploy server to Azure

From the root of the repository:

git subtree push --prefix src/server azure master

API

Make sure you set an 'application/json' header!!

Create a Document

In our system, every VSTS Account has it's own document, so if a VSTS account hasn't used the extension before you will have to create a Document for that account using this API call. IMPORTANT: Make sure the accountID you use to create this is the account-id of the VSTS account!!

Make a GET request on

localhost:3000/document/create/:documentId

For example:

localhost:3000/document/create/sajdhjqwe-id-2

At the moment this is a GET request, and is subject to change, though is a low priority

Create a meeting

create a POST request on

``` localhost:3000/:documentId/meeting/create ```

For example:

``` localhost:3000/ProperTestDocument/meeting/create/EatingChocolate ```

The body of the POST request is as follows:

``` { "meetingName": "Happy Birthday To the Ground!", "hostId": "123456789"", "hostAvailability": [ { "dateStart": 1, "dateEnd": 1 } ], "attendees": [ { "id": "118118118", "name": "Kelvin Chan" } ] } ```

Get all meetings of a user

Make a GET request on

``` 'localhost:3000/:documentId/meeting/get/:userId' ```

Alternatively, you can get all hosted meetings of a user with the request below

``` localhost:3000/:documentId/meeting/hosted/:userId ```

UPDATE: working now.

Add attendees to a meeting

Make a POST request on:

``` localhost:3000/:documentId/:meetingId/attendees/add ```

For example

``` localhost:3000/my-document-id/my-meeting-id/attendees/add ```

The POST body is as follows:

``` { "attendees": [ { "id": "user-id-here", "response": 0, "name": "user's name here", "availableTimes":[ { "dateStart": "some-date-object/string here", "dateEnd": "some-date-object/string here" } ] } ] } ```

Get a single meeting using meetingId

Make a GET request on:

``` localhost:3000/my-document-id/meeting-id/get ```

For example:

``` localhost:3000/ProperTestDocument/DdVqhdEV5gVuj/get ```

Edit data in an existing meeting

Make a POST request on:

``` localhost:3000/ProperTestDocument/14AjFg56Z86H8/edit ```

POST body is as follows:

``` { "hostId": "new host id mofo!!", "meetingName": "What is this", "meetingLocation": "Some where in the world", "hostAvailability": [], "finalDate": null, "attendees": [] } ```

You can include as little or as many parameters as you want. You cannot replace meetingID, you can try but it won't work.

Get responded meetings

POST request. No body needed for now, but I've made it a post request because we'll eventually have to attach auth headers for the server

``` localhost:3000/ProperTestDocument/meeting/responded/user-id ```

Get UNresponded meetings

POST request.

``` localhost:3000/ProperTestDocument/meeting/unresponded/user-id ```

Set final meeting date

POST request

``` localhost:3000/ProperTestDocument/oz5mUbpN05NIY/finalise ```