Versions Compared

Key

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

Using OAuth 2.0 for Service Applications

...

ParameterValuesDescription
grant_typeclient_credentialsThis must be client_credentials.
scopeThe permissions your application requests.A scope is used to convey what permissions your application requires when requesting permission from the end-user. Current available scopes are:
  • read(all) - Read only access to all data the user owns or has access to including personal information, and
  • write(all) - Read and write access to all data the user owns or has access to including personal information.
  • read({resource}) - Read only access to data related to the {resource} object.
  • write({resource}) - Read and write access to data related to the {resource} object.

Scope resources can be any of our endpoints. For example, companies, contacts or issues. The scope can be concatenated and delimited by a comma. For example:

  • read(all),write(companies,contacts) - read all information and write to only companies and contacts.
  • write(contacts,issues) - Read and write access to contact and issue data.

Here is what a request may look like, where the client id and secret are encoded using base-64.

...

Info

The request must authenticate using HTTP basic. The format is client_id:client_secret. Use your applications client id as the username and its client secret as the password encoded with base-64 encoding.

For example,

 

Code Block
linenumberstrue
POST /oauth2/v0/token HTTP/1.1
Host: hq.api.accelo.com
Content-Type: application/x-www-form-urlencoded
Authorization: Basic {client_id}:{client_secret}NzY1NzVmYzJAaHEuYWNjZWxvLmNvbTpSYWp3MGFhc0g1YUU1X2lDbTc=
  
grant_type=client_credentials

For example, using curl expecting a JSON response
For this example client_id and client_secret are not encoded.

Code Block
curl \
-u {client_id}:{client_secret} \
--data "grant_type=client_credentials" \
"https://{deployment}.api.accelo.com/oauth2/v0/token.json"

 

...