tryingTheExamples - kewalsk/My-OpenPeriscope GitHub Wiki

How to try the examples

The examples in this documentation are prepared to be sent from any Linux box by curl utility, but you can easily convert them to Windows command line.

For most of calls the authorization token is needed so the first thing is to get one:

curl -H "Content-Type: application/json" -d '{"service": "channels", "cookie": "place_your_sid_here"}' https://api.periscope.tv/api/v2/authorizeToken

{"authorization_token":"***"}

and store the result in env variable $token (use for example %TOKEN% in Windows):

token="paste_your_token_here"; export token

Then the REST service calls can be sent by:

curl -H "Authorization: $token" https://channels.pscp.tv/v1/...

There is no need to get new token for each call because the one can be used until expired. After about hour the token is no longer valid, so you have to repeat the process.

To get more of useful information especially for debug purposes put -v in command line:

curl -v -H "Authorization: $token" https://channels.pscp.tv/v1/...

Then the result will show not only response body but also what was actually sent and received in headers and the HTTP response code and message.

⚠️ **GitHub.com Fallback** ⚠️