Response: JSON object containing the port and ping_timeout for RTMP, public and private play endpoints, and whether adaptive livestreaming and VOD recording are enabled.
Example:
```
{
rtmp: {
port: 1935,
ping_timeout: 60
},
media: {
vods: false,
publicEndpoint: 'live',
privateEndpoint: 'stream',
adaptive: true
}
}
```
Public and private endpoints work like this, from the above example:
stream to: rtmp://example.com/stream
play from: rtmp://example.com/live/username or https://example.com/live/username/index.mpd
Response: If successful, returns a json object with the users stream key. Otherwise returns `{error: "error reason"}`
Examples:
`{stream_key: "asdfghjkltyuiop12345"}`
`{error: "registration disabled"}`
### /api/login
Obtain a signed json web token for authentication
Method: POST
Authentication: no
Parameters: Username and password OR a valid JWT cookie expiring in less than 24 hours
Response: If succesful, will return `{success: ""}` or `{success: "already verified"}` if the JWT provided is too early to be renewed. If unsuccesful, will return `{error: "invalid password"}` or `{error: "Username or Password Incorrect"}` depending on the authentication method. Note that if a JWT is available, the parameters will be ignored.
Notes: I've already listed nearly every response. My final note is that the JWT is set as the cookie 'Authorization', not returned in the response.
### /api/user/update
Update the current user's information
Method: POST
Authentication: yes
Parameters: title, bio, rec
Rec is a boolean (whether to record VODs), others are strings. Parameters that are not included in the request will not be updated.
Response: Returns `{error: "error code"}` or `{success: ""}`
### /api/user/update/chat
Update the chatrooms on other platforms to integrate with the user's stream chat
Method: POST
Authentication: yes
Parameters: discord, xmpp, twitch irc
All strings corresponding to a channel name to mirror to. XMPP is currently unused. Parameters not included in the request will not be updated.
Response: Returns `{error: "error code"}` or `{success: ""}`
Response: Returns a JSON object with available information about the user. If the user is authenticated and searching for their own information, will return all available information. Otherwise it will return only the stream title and bio. In the case of searching for a user that does not exist, the returned object will contain only the username searched for.