Changes by blabdude: - added types (URL Param vs JSON body) to all API calls - removed md links: [category list]() - replace config.json.example with wiki/Types#category

Ajay Ramachandran
2021-06-21 15:13:41 -04:00
parent e8c5bc9d7a
commit f28b39d184

@@ -21,12 +21,13 @@ ________________________________________________________________________________
##### **GET** `/api/skipSegments`
**Input**:
**Input** (URL Parameters):
```js
{
videoID: string,
category: string, // Optional, defaults to "sponsor". See https://github.com/ajayyy/SponsorBlock/wiki/Types#category
category: string, // Optional, defaults to "sponsor", can be repeated for multiple categories.
// See https://github.com/ajayyy/SponsorBlock/wiki/Types#category
categories: string[], // Optional, use this instead of "category" if you want multiple categories. Will look like ["sponsor","intro"]
service: string // Optional, default is 'YouTube'. See https://github.com/ajayyy/SponsorBlock/wiki/Types#service
@@ -102,10 +103,11 @@ ________________________________________________________________________________
`sha256HashPrefix` is a hash of the YouTube `videoID`. It should be the first 4 - 32 characters (4 is recommended). This provides extra privacy by potentially finding more than just the video you are looking for. This makes the server not know exactly what video you are looking for.
**Input**:
**Input** (URL Parameters):
```js
{
category: string, // Optional, defaults to "sponsor". See [the category list](https://raw.githubusercontent.com/ajayyy/SponsorBlock/master/config.json.example)
category: string, // Optional, defaults to "sponsor", can be repeated for multiple categories.
// See https://github.com/ajayyy/SponsorBlock/wiki/Types#category
categories: string[], // Optional, use this instead of "category" if you want multiple categories. Will look like ["sponsor","intro"]
@@ -193,7 +195,7 @@ __________________________________________________________________
##### **GET** `/api/userInfo`
**Input**:
**Input** (URL Parameters):
```js
{
userID: string //the local user id
@@ -231,7 +233,7 @@ __________________________________________________________________
##### **GET** `/api/getViewsForUser`
**Input**:
**Input** (URL Parameters):
```js
{
userID: string //the local user id
@@ -253,7 +255,7 @@ __________________________________________________________________
##### **GET** `/api/getSavedTimeForUser`
**Input**:
**Input** (URL Parameters):
```js
{
userID: string //the local user id
@@ -300,7 +302,7 @@ __________________________________________________________________
##### **GET** `/api/getUsername`
**Input**:
**Input** (URL Parameters):
```js
{
userID: string //the local user id
@@ -324,7 +326,7 @@ __________________________________________________________________
##### **GET** `/api/getTopUsers`
**Input**:
**Input** (URL Parameters):
```js
{
sortType: int //0 for by minutes saved, 1 for by view count, 2 for by total submissions
@@ -349,7 +351,7 @@ __________________________________________________________________
##### **GET** `/api/getTotalStats`
**Input**:
**Input** (URL Parameters):
```js
{
"countContributingUsers": boolean //Optional, default false
@@ -396,10 +398,10 @@ __________________________________________________________________
##### **GET** `/api/segmentInfo`
**Input**:
**Input** (URL Parameters):
```js
{
UUID: string, // Can be used instead of UUIDs
UUID: string, // Can be used instead of UUIDs, can be repeated to fetch multiple segments
UUIDs: string[] // Can be used instead of UUID. Maximum 10 entries. Will look like ["a...0", "b...1"]
}
```
@@ -439,7 +441,7 @@ These can only be called by the users added to the VIP table.
##### **GET** `/api/isUserVIP`
**Input**:
**Input** (URL Parameters):
```js
{
userID: string, // private userID
@@ -605,7 +607,7 @@ These can only be called by the server administrator, set in the config.
VIPs have extra privileges and their votes count more.
**Input**:
**Input** (Request Body):
```js
{
userID: string, //public userID of the user you want to add to the VIP list