The OAuth scopes determine the range of permissions of an access_token. The OAuth application can perform one action or another, depending on the permissions the user provided.
The following scopes are currently available:
If the OAuth application performs a request to a resource using an access token without the proper scope, the request is denied.
OAuth resources are the available applications that accept an OAuth access token as an authorization method.
There are two resources available: Accounts and Auth API.
The Inbenta Accounts service has a specific endpoint to retrieve user information.
The amount of information that is returned in this endpoint depends on the scopes that have been accepted for the provided OAuth access token.
The following parameter can be returned:
Here is an example of a response from the Accounts service, to a request for user information with both the personal_information and personal_configuration scopes:
HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Cache-Control: no-store Pragma: no-cache { "id": "asd98e7ead7fac8sdb7fe123", "name": "Michael", "email": "michael@test.com", "locale": "en", "numberSeparators": { "thousands": ".", "decimal": "," }, "dates": { "format": "DD-MM-YYYY", "smart": "off" }, "timezone": "Europe/Madrid" }
For more information about the Auth API, see the API Authorization section
You can start an authorization process with an OAuth access token. To do this, you must request one of the following scopes when you create the OAuth access token:
If you do not request one of these two scopes, Auth API returns a 403 Forbidden
error response.
The first step is to obtain the OAuth token with the necessary scopes for the application. This is described in Getting the user authorization.
Once you have the OAuth token you can perform the request to the Authorization API using the ‘x-oauth-token’ Bearer header:
curl --request POST \ --url https://api.inbenta.io/v1/auth \ --header 'content-type: application/json' \ --header 'x-inbenta-key: yourAPIKeyValue' \ --header 'x-oauth-token: Bearer yourOAuthTokenValue' \ --data '{ "secret": "yourSecretKeyValue" }'