Accessing API endpoints with authorization

Most clients access the video list, video data, etc. using the appropriate vzaar library code. But it can be convenient to access the vzaar endpoints directly.

If your public API feed is set to "Off", you'll need to authorize to access the data.

A great tool for this is Chrome Postman and we'll use that tool for this example.

Let's try to just confirm the authorization is working by hitting the whoami endpoint: http://app.vzaar.com/api/test/whoami.json

If you just hit that endpoint in a browser window, you'll see an error:

{
    "vzaar-api": {
        "error": {
            "type": "Not Authorized"
        }
    }
}

So how can we get that data with authorization? You'll need to set up a request in Postman using the following values:

Token: <your_vzaar_username>

Token Secret: <your_vzaar_api_token> (from http://app.vzaar.com/settings/api)

Signature Method: HMAC-SHA1

Timestamp: 1451438525 (will be different)

Nonce: TZHE80 (will be different)

Version: 1.0

Add params to header: checked

Auto add parameters: checked

Other fields are blank/unchecked. Here's how it looks in Postman:

postmanrequest01.jpg

The response will be:

{
    "vzaar_api": {
    "test": {
        "login": "<your_vzaar_username>"
        }
    }
}