Authentication

OAuth 2

OAuth 2 Authentication starts with creating an app in an OfficeRnD account. You'll then use the Client ID and Client Secret from that app to retrieve an access token. Applications are created by organisation owners so you need to contact the respective owner and ask them to create an application for you. Then, they will need to send you the Client Id and Client secret for the newly created application.
The following scopes are available when requesting a token:

officernd.api.read

Provides read (GET) access to the OfficeRnD app endpoints for a particular organization.

officernd.api.write

Provides write (PUT, POST, DELETE) access to the OfficeRnD app endpoints for a particular organization.

Token Request

Pre-requisites for a successful token request.

Token Url

https://identity.officernd.com/oauth/token

Method

HTTP method POST must be used when making token requests.

Content-Type header

Content-Type header must be set to application/x-www-form-urlencoded.

Body

Body must contain the following fields:

  • client_id - the client id associated with your application provided by the organisation owner
  • client_secret - the client secret associated with your application provided by the organisation owner
  • grant_type - grant type to be used. We support client_credentials only
  • scope - scopes you are requesting concatenated into a single string divided by a blank space e.g. "officernd.api.read officernd.api.write"

Token Response

A successful token request would result in the following response:

  • access_token - the requested access token
  • token_type - the type of the token. This will always equal 'Bearer'
  • expires_in - the validity of the token in seconds. By default, tokens have a maximum validity of 3599 seconds
  • scope - scopes which this token has access to

Example

Request

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "client_id={client_id}&client_secret={client_secret}&grant_type=client_credentials&scope=officernd.api.read officernd.api.write" https://identity.officernd.com/oauth/token

Response

{"access_token":"{access_token}","token_type":"Bearer","expires_in":3599,"scope":"officernd.api.read officernd.api.write"}

Authorization Header
Once you have the token you need to add an Authorization header to every request. The value of the header should be "Bearer <access_token>". It should look like this:

Authorization: Bearer <access_token>

Did this page help you?