Authenticate with Write.as API Shortcut

Social


Video Demo

“Authenticates a user with WriteFreely, creating an access token for future authenticated requests.”

This shortcut exists for the sole purpose of obtaining an access token from the WriteFreely API. It uses two Ask For Input actions to prompt for the user’s Write.as username (alias) and password, which - when passed to api/auth/login - should return a JSON result looking something like this:

{“data”:{“user”:{“username”:”compaq”,”email”:”davidblue@extratone.com”,”created”:”2015-01-27T01:22:37Z”,”has_pass”:false,”status”:0,”subscription”:null},”access_token”:”00000000-0000-0000-0000-000000000000”},”code”:200}

By default, the shortcut will parse said JSON for the access_token key, exclusively, copy it to the system clipboard, and display it in a Show Result action. I’ve also included a Save File action with the full results above just in case you’d like to stash the whole bit somewhere.

While you’re here, this is almost certainly useful to know , going forward:

Authenticates a user with WriteFreely, creating an access token for future authenticated requests. Users can only authenticate with their primary account, i.e. the first collection/blog they created, which may or may not have multiple collections associated with it. -Authenticate a User – Write.as API Documentation