Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

http://hobson-automation.com/apidoc/

Authentication

Obtaining a Token

In order to use any secure REST API resources, you need a valid bearer token. This is generated by the Login User resource. You will find a "token" attribute in the JSON response after a successful login call. The returned token is a standard JSON Web Token (JWT) and will look something like this:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ0b3B0YWwuY29tIiwiZXhwIjoxNDI2NDIwODAwLCJodHRwOi8vdG9wdGFsLmNvbS9qd3RfY2xhaW1zL2lzX2FkbWluIjp0cnVlLCJjb21wYW55IjoiVG9wdGFsIiwiYXdlc29tZSI6dHJ1ZX0.yRQYnWzskCZUxPwaQupWkiUzKELZ49eM7oWxAQK_ZXw

Using a Token

You must pass a valid token to all secure REST API resources or you will get a 401 error response. To do that, add the HTTP Authorization header with the Bearer schema in your API request. For example:

Authorization: Bearer <token>