How to…

Automate DADI API authentication in Paw

Paw, much like Postman, is an app for interacting with REST APIs. Unlike Postman, however, it’s a native Mac OS app and does have a one-off cost of £39.99 (~$55 USD) — but the designer in me prefers Paw’s more polished interface so I’m happy to spend the money (you may be too, now, as Paw is offering a 20% discount to DADI users).

So, just as Eduardo’s productivity hack helped automate authentication in Postman, this tip will save you the pain of having to refresh your Bearer token frequently when working with DADI API. Except with Paw, it’s even easier.

Setting up the token fetch

The first thing you want to do after setting up your DADI API is to create a request to the /token endpoint. With my development API running locally on http://127.0.0.1:8081 , the token endpoint is available at http://127.0.0.1:8081/token .

The key steps are:

Make sure your DADI API is running Set the method to POST Make sure the endpoint is /token (unless you specifically changed it in API) In Body > JSON set your clientID and secret key/values. Send the request using ⌘ + Enter or the refresh icon.

If successful you will receive a JSON response containing an access token, similar to the below image: