...
Parameter | Values | Description |
---|---|---|
client_id | The 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_type | code | This value must be code for installed applications. |
scope | The 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:
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:
|
...
Code Block | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
GET https://hq.localapi.affinitylive.com/public_api/v0/companies/1?_bearer_token=frLA0s1m_D |
...
Code Block | ||
---|---|---|
| ||
GET /public_api/v0/companies/1 HTTP/1.1 Host: hq.localapi.affinitylive.com Authorization: Bearer frLA0s1m_D |
References and additional reading
...