Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated outdated urls

...

ParameterValuesDescription
client_idThe applications client id obtained from the API Control Panel.Indicates what API application is making the request. It is a unique string allocated to your application, which can be used across multiple deployments. For example: 34ad67fa2f@hq.local.affinitylive.com
response_typecodeThis value must be code for installed applications.
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.

...

 

Code Block
linenumberstrue
https://hq.localapi.affinitylive.com/oauth2/v0/authorize?
scope=read(all)&
 
redirect_uri=https://app.com/oauth_callback&
response_type=code&
client_id=34ad67fa2f@hq.local.affinitylive.com

 

Please note that the above sample url should be encoded. For example purposes it was left in plain text.

...

 

Code Block
linenumberstrue
POST /oauth2/v0/token HTTP/1.1
Host: hq.localapi.affinitylive.com
Content-Type: application/x-www-form-urlencoded
Authorization: Basic {client_id}:{client_secret}
 
code=frLA0s1m_D&
 
grant_type=authorization_code

 

Upon a successful request , the response contains the following fields:

...

Code Block
linenumberstrue
GET https://hq.localapi.affinitylive.com/public_api/v0/companies/1?_bearer_token=frLA0s1m_D

...

 

Code Block
linenumberstrue
GET /public_api/v0/companies/1 HTTP/1.1
Host: hq.localapi.affinitylive.com
Authorization: Bearer frLA0s1m_D

References and additional reading

...