diff --git a/API-Docs.md b/API-Docs.md index 77d9735..105f348 100644 --- a/API-Docs.md +++ b/API-Docs.md @@ -16,7 +16,7 @@ ________________________________________________________________________________ ``` { videoID: string, - 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". See [the category list](https://raw.githubusercontent.com/ajayyy/SponsorBlock/master/config.json.example) categories: string[] // Use instead of "category" if you want multiple categories. Will look like ["sponsor","intro"] } @@ -79,11 +79,40 @@ __________________________________________________________________ 409: Duplicate +________________________________________________________________________________ + +**GET** `/api/skipSegments/:sha256HashPrefix` + +`sha256HashPrefix` is a hash of the YouTube `videoID`. It should be the first 3 - 32 characters. 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**: +``` +{ + category: string, // Optional, defaults to "sponsor". See [the category list](https://raw.githubusercontent.com/ajayyy/SponsorBlock/master/config.json.example) + + categories: string[] // Use instead of "category" if you want multiple categories. Will look like ["sponsor","intro"] +} +``` + +**Response**: +``` +[{ // Array of this object + "videoID": string, + "hash": string, // The full hash + segment: float[], //[0, 15.23] start and end time in seconds + UUID: string, + category: string +}] +``` + +**Error codes**: + +404: Not Found __________________________________________________________________ **POST** or **GET** (legacy) `/api/voteOnSponsorTime` -**Input**: +**Input** (URL Parameters): ``` { UUID: string, //id of the sponsor being voted on @@ -109,7 +138,7 @@ __________________________________________________________________ **POST** or **GET** (legacy) `/api/viewedVideoSponsorTime` -**Input**: +**Input** (URL Parameters): ``` { UUID: string @@ -175,7 +204,7 @@ __________________________________________________________________ **POST** `/api/setUsername` -**Input**: +**Input** (URL Parameters): ``` { userID: string, //local user id normally, public user id if adminUserID is specified @@ -292,15 +321,15 @@ __________________________________________________________________ None __________________________________________________________________ -### Admin Calls +### VIP Calls -These can only be called by the server administrator, set in the config. +These can only be called by the users added to the VIP table. **POST** `/api/shadowBanUser` Shadow banned submissions are hidden for everyone but the IP that originally submitted it. Shadow banning a user shadow bans all future submissions. -**Input**: +**Input** (URL Parameters): ``` { userID: string, //public userID of the user you want to shadowBan @@ -323,6 +352,10 @@ Shadow banned submissions are hidden for everyone but the IP that originally sub 403: Unauthorized (You are not an admin) __________________________________________________________________ +### Admin Calls + +These can only be called by the server administrator, set in the config. + **POST** `/api/addUserAsVIP` VIPs have extra privileges and their votes count more.