Testing APIs
Test an API from command line (with curl)
Get an access tokenThe simplest way to obtain an access token for testing purposes is to use the implicit OAuth 2.0 flow. This flow allows clients to get access tokens directly from the auth endpoint. However, for production purposes it is not recommended due to the inherent risks of returning access tokens in an HTTP redirect without any confirmation that it has been received by the client.
https://authentication.video.ibm.com/authorize?response_type=token&client_id=057ce944b015ec9fdf546dfbbe1b7af4b19e8158&redirect_uri=https://yourdomain.com/redirect&device_name=MyDevice&state=XYZ
After logging in, the browser is redirected to a special URL (defined by the client), passing the Access Token in the URL. As you can see in the examples below, you should use Authorization HTTP header with the token in the requests: Authorization: Bearer 3c2573673b782f6544405a22636f3d5d3b6f3950
curl \-i \-X POST \-H "Authorization: Bearer 3c2573673b782f6544405a22636f3d5d3b6f3950" \-d "title=Whatever+Test+1234" \https://api.video.ibm.com/users/self/channels.json
HTTP/1.1 201 Created{"channel":{"id":"13091307","title":"Whatever Test 1234","url":"whatever-test-1234","tiny_url":"http://ustre.am/SVE7"}}