API Docs: Difference between revisions

Jump to navigation Jump to search
1,520 bytes added ,  3 January 2022
add changes from drafts
(fixed incorrect input)
(add changes from drafts)
Line 679: Line 679:
   startTime: int, // Unix time that request was received
   startTime: int, // Unix time that request was received
   processTime: int, // Seconds between startTime and sending response
   processTime: int, // Seconds between startTime and sending response
   loadavg: int[] // 5 and 15 minute loadavg
   loadavg: int[], // 5 and 15 minute loadavg
  statusRequests: int // number of /status requests in the last minute
}
}
</syntaxhighlight>
</syntaxhighlight>
Line 698: Line 699:
     // 1 for by view count
     // 1 for by view count
     // 2 for by total submissions
     // 2 for by total submissions
}
</syntaxhighlight>
'''Response''':
<syntaxhighlight lang="ts">
{
  userNames: string[],
  viewCounts: int[],
  totalSubmissions: int[],
  minutesSaved: float[]
}
</syntaxhighlight>
'''Error codes''':
400: Bad Request (Your inputs are wrong/impossible)
-----'''GET''' <code>/api/getTopCategoryUsers</code>
Get top submitters by category
'''Input''' (URL Parameters):
<syntaxhighlight lang="ts">
{
  sortType: int,
    // 0 for by minutes saved
    // 1 for by view count
    // 2 for by total submissions
  category: string // category to fetch stats for
}
}
</syntaxhighlight>
</syntaxhighlight>
Line 975: Line 1,004:


403: Unauthorized (You are not a VIP)  
403: Unauthorized (You are not a VIP)  
-----
====='''POST''' <code>/api/addUserAsTempVIP</code>=====
Add temporary 24 Hour Channel VIP
A user cannot be a VIP of multiple channels, the most recent channel will take precedence and override
'''Input''' (Request Body):
<syntaxhighlight lang="ts">
{
  userID: string, // User to grant temp VIP to
  adminUserID: string, // Local userID of existing VIP
  channelVideoID: string, // videoID of channel to grant VIP on
  enabled: string // default "true" Enable or disable VIP status
}
</syntaxhighlight>
'''Response''':
<syntaxhighlight lang="ts">
{
  Temp VIP added on channel channelName (status code 200)
  Temp VIP removed (status code 200)
}
</syntaxhighlight>
'''Error codes''':
400: Bad Request (Your inputs are wrong/impossible)
403: Unauthorized (You are not a VIP)
404: Not Found (No channel found for videoID)
409: Duplicate (User is already a permanent VIP)
-----
-----
===Admin Calls===
===Admin Calls===

Navigation menu