## **Upload Video Data To MongoDB**
- **URL**
`/uploadToMongo`
- **Method:**
`POST`
- **Data Params**
Body must contain video_title as `title`, video_description as `description`and videoId as `videoId`.
**Required:**
`title=[text]`
`description=[text]`
`videoId=[numeric]`
- **Success Response:**
- **Code:** 200 <br />
**Content:** `{ video : ef19ba00-18ab-411c-9360-e9c8f69eddb8 }`
- **Error Response:**
- **Code:** 401 UNAUTHORIZED <br />
**Content:** `{ error : "No authorization token was found" }`
- **Sample Call:**
```
axios.post('/uploadToMongo', {
body: {
title: "any_title",
description: "any_description",
videoId: "ef19ba00-18ab-411c-9360-e9c8f69eddb8"
},
headers: {'Authorization': 'Bearer <token>'},
})
.then(function (response) {
console.log(response);
})
```
## **Get Video Information**
- **URL**
`/video/:videoId`
- **Method:**
`GET`
- **URL Params**
url must contain a parameter as `videoId`
**Required:**
`videoId=[numeric]`
- **Success Response:**
- **Code:** 200 <br />
**Content:** `video_data`
- **Error Response:**
- **Code:** 401 UNAUTHORIZED <br />
**Content:** `{ error : "No authorization token was found" }`
- **Sample Call:**
```
axios.post('/video/ef19ba00-18ab-411c-9360-e9c8f69eddb8', {
headers: {'Authorization': 'Bearer <token>'},
})
.then(function (response) {
console.log(response);
})
```
## **Set Video Share Permission**
- **URL**
`/updateShareInfo`
- **Method:**
`POST`
- **Data Params**
Body must contain shareType as `shareType`, participantEmail as `email`and videoId as `videoId`.
**Required:**
`email=[email@email.com]`
`shareType=[public/private]`
`videoId=[numeric]`
- **Success Response:**
- **Code:** 200 <br />
**Content:** `{ video_data }`
- **Error Response:**
- **Code:** 401 UNAUTHORIZED <br />
**Content:** `{ error : "No authorization token was found" }`
- **Sample Call:**
```
axios.post('/updateShareInfo', {
body: {
email: "email@email.com",
shareType: "private",
videoId: "ef19ba00-18ab-411c-9360-e9c8f69eddb8"
},
headers: {'Authorization': 'Bearer <token>'},
})
.then(function (response) {
console.log(response);
})
```
## **Revoke Watch Video Permission**
- **URL**
`/disallowUser`
- **Method:**
`POST`
- **Data Params**
Body must contain participantEmail as `email` and videoId as `videoId`.
**Required:**
`email=[email@email.com]`
`videoId=[numeric]`
- **Success Response:**
- **Code:** 200 <br />
**Content:** `{ video_data }`
- **Error Response:**
- **Code:** 401 UNAUTHORIZED <br />
**Content:** `{ error : "No authorization token was found" }`
- **Sample Call:**
```
axios.post('/disallowUser', {
body: {
email: "email@email.com",
videoId: "ef19ba00-18ab-411c-9360-e9c8f69eddb8"
},
headers: {'Authorization': 'Bearer <token>'},
})
.then(function (response) {
console.log(response);
})
```
## **Delete Video**
- **URL**
`/deleteVideo`
- **Method:**
`POST`
- **Data Params**
Body must contain videoId as `videoId`.
**Required:**
`videoId=[numeric]`
- **Success Response:**
- **Code:** 200 <br />
**Content:** `{ delete_response }`
- **Error Response:**
- **Code:** 401 UNAUTHORIZED <br />
**Content:** `{ error : "No authorization token was found" }`
- **Sample Call:**
```
axios.post('/deleteVideo', {
body: {
videoId: "ef19ba00-18ab-411c-9360-e9c8f69eddb8"
},
headers: {'Authorization': 'Bearer <token>'},
})
.then(function (response) {
console.log(response);
})
```