Create an OAuth token for a stream: Auth.CreateAccessToken
The method and parameters
This method generates an authorization token for a stream, if, when configuring a stream via Stream.Add, the private authorization method was specified.
string Auth.CreateApiToken (uid stream, unsigned ttl)
Parameters
uid stream REQUIRED – a unique identifier of a stream that requires an access token.
unsigned ttl = 3600 – the duration of the generated token, in seconds. If 0 is specified, the duration is unlimited.
Avoid using tokens with unlimited validity unless absolutely necessary.
bool live = false – the permission to watch Live. false – no access to Live, true – access to Live is allowed.
bool dvr = false – the permission to watch DVR. false – no permissions to watch DVR, true – it’s allowed to watch DVR.
bool copy = false – the permission to download DVR. false – it’s not allowed to download DVR, true – it’s allowed to download DVR.
unsigned from – a lower time bound for DVR, in seconds. If 0 is specified, the lower bound is unlimited. This parameter is only relevant if the DVR recording or the copy function is enabled.
unsigned to – the upper time bound for DVR, in seconds. If 0 is specified, the upper bound is unlimited. This parameter is only relevant if the DVR recording or copy function is enabled.
to must be greater than or equal to from.
POST /api/ |
200 |
An OAuth token
JSON
|
400 |
JSON-RPC error
JSON
|
500 |
A server error |