Use OAuth 2.0 protocol to securely authorize third-party apps and web services you integrate with Creatio. This technology does not pass Creatio logins and passwords to third-party apps. OAuth 2.0 also lets you restrict Creatio permissions for the integrated apps.
General procedure to authorize external requests to Creatio using OAuth 2.0 authorization:
- Set up the integration of a third-party app with Creatio using Identity Service. Read more >>>
- Retrieve a Bearer token. Read more >>>
- Retrieve data from Creatio. Read more >>>
You can use Postman to test requests.
1. Set up the integration of a third-party app with Creatio using Identity Service
- Set up the Identity Service. Instructions: Set up the Identity Service.
- Set up the OAuth 2.0 authorization. Instructions: Set up the OAuth 2.0 authorization.
-
Make sure the Identity Service is running.
-
Add a request collection. Instructions: Adding a collection of requests.
For example, add the Identity Service request collection.
-
Create a request.
- Add a request to the collection. Instructions: Adding requests to the collection.
-
Fill out the request parameters.
Parameter Parameter description Parameter value Request method GET Request URL The URL of the Identity Service website that lets you view the settings. http://localhost:8090/ .well-known/ openid-configuration - Save the request.
- Execute the request.
-
As a result, you will ensure the Identity Service is running.
2. Retrieve a Bearer token
A Bearer token is an auto-generated token required for external requests that have OAuth 2.0 authorization. Each Bearer token has a finite lifetime, 3600 seconds by default. The [AccessTokenLifetime] column in the [Clients] database table stores the value of the token lifetime. To retrieve the value of the token lifetime, execute the following SQL query.
To change the token lifetime, execute the following SQL query.
To retrieve a Bearer token:
-
Create a request to retrieve a Bearer token.
- Add a request to the collection. Instructions: Adding requests to the collection.
-
Fill out the request parameters.
Parameter Parameter description Parameter value Request method POST Request URL The URL of the Identity Service website to retrieve a Bearer token. http://localhost:8090/ connect/ token -
Add the request body.
- Open the Body tab.
- Select x-www-form-urlencoded in the Body option parameter.
-
Fill out the body parameters.
Parameter (Key column) Parameter description Parameter value (Value column) client_id Use the “Client Id” parameter value that Creatio populates automatically. Learn more: Set up OAuth 2.0 authorization for third-party app. 4******6 client_secret Use the “Client secret” parameter value that Creatio populates automatically. Learn more: Set up OAuth 2.0 authorization for third-party app. 5******C grant_type client_credentials
- Save the request.
- Execute the request.
As a result, you will retrieve the Bearer token.
You can now integrate third-party apps or web services with Creatio using OAuth 2.0 authorization. Authorize all external requests to Creatio using the Bearer token.
3. Retrieve data from Creatio
You can retrieve data from Creatio in multiple ways:
- OData 4. Detailed example: Retrieve data from Creatio using OAuth 2.0 authorization and OData 4.
- OData 3. Detailed example: Retrieve data from Creatio using OAuth 2.0 authorization and OData 3.
- DataService. Detailed example: Retrieve data from Creatio using OAuth 2.0 authorization and DataService.
- Web service. Detailed example: Retrieve data from Creatio using OAuth 2.0 authorization and web service.
Regardless of the chosen method, to retrieve data from Creatio:
-
Create a request to retrieve data.
- Add a request to the collection. Instructions: Adding requests to the collection.
-
Fill out the request parameters:
- Request method required
- Request URL required
- Request body parameters. For example, Body option, Body type, Body value.
- Save the request.
-
Set up the authorization.
- Open the Authorization tab.
-
Fill out the authorization parameters.
Parameter Parameter value Type OAuth 2.0 Token e******w - Save the request.
As a result, the auto-generated header will be added to the Headers tab. The header has the following parameters.
Parameter Parameter value Key Authorization Value Bearer e******w - Execute the request.
If the token lifetime has expired, i. e. you got the 401 Unauthorized response, retrieve a new Bearer token.
To implement the example:
Step 1: Set up the integration of a third-party app with Creatio using Identity Service. Read more >>>
Step 2: Retrieve a Bearer token. Read more >>>
Step 3: Retrieve data from Creatio. Read more >>>
This example uses Postman to test requests.
1. Set up the integration of a third-party app with Creatio using Identity Service
- Set up the Identity Service. Instructions: Set up the Identity Service.
- Set up the OAuth 2.0 authorization. Instructions: Set up the OAuth 2.0 authorization.
- Make sure the Identity Service is running. Instructions: Set up the integration of a third-party app with Creatio using Identity Service (step 3).
2. Retrieve a Bearer token
Instructions: Retrieve a Bearer token.
You can now integrate third-party apps or web services with Creatio using OAuth 2.0 authorization. Authorize all external requests to Creatio using the Bearer token.
3. Retrieve data from Creatio
-
Create a request to retrieve data using OData 4.
- Add a request to the collection. Instructions: Adding requests to the collection.
-
Fill out the request parameters.
Parameter Parameter description Parameter value Request method GET Request URL The URL of the Creatio instance to retrieve data. http://mycreatio.com/ 0/ odata/ Account - Save the request.
- Set up the authorization. Instructions: Retrieve data from Creatio (step 2).
- Execute the request.
As a result, you will retrieve the list of all accounts. View result >>>
To implement the example:
Step 1: Set up the integration of a third-party app with Creatio using Identity Service. Read more >>>
Step 2: Retrieve a Bearer token. Read more >>>
Step 3: Retrieve data from Creatio. Read more >>>
This example uses Postman to test requests.
1. Set up the integration of a third-party app with Creatio using Identity Service
- Set up the Identity Service. Instructions: Set up the Identity Service.
- Set up the OAuth 2.0 authorization. Instructions: Set up the OAuth 2.0 authorization.
- Make sure the Identity Service is running. Instructions: Set up the integration of a third-party app with Creatio using Identity Service (step 3).
2. Retrieve a Bearer token
Instructions: Retrieve a Bearer token.
You can now integrate third-party apps or web services with Creatio using OAuth 2.0 authorization. Authorize all external requests to Creatio using the Bearer token.
3. Retrieve data from Creatio
-
Create a request to retrieve data using OData 3.
- Add a request to the collection. Instructions: Adding requests to the collection.
-
Fill out the request parameters.
Parameter Parameter description Parameter value Request method GET Request URL The URL of the Creatio instance to retrieve data. http://mycreatio.com/ 0/ ServiceModel/ EntityDataService.svc/ AccountCollection/ ?$select=Name -
Add the request headers.
- Open the Headers tab.
-
Fill out the body parameters.
Parameter (Key column) Parameter value (Value column) Accept application/json;odata=verbose
- Save the request.
- Set up the authorization. Instructions: Retrieve data from Creatio (step 2).
- Execute the request.
As a result, you will retrieve the names of all accounts. View result >>>
To implement the example:
Step 1: Set up the integration of a third-party app with Creatio using Identity Service. Read more >>>
Step 2: Retrieve a Bearer token. Read more >>>
Step 3: Retrieve data from Creatio. Read more >>>
This example uses Postman to test requests.
1. Set up the integration of a third-party app with Creatio using Identity Service
- Set up the Identity Service. Instructions: Set up the Identity Service.
- Set up the OAuth 2.0 authorization. Instructions: Set up the OAuth 2.0 authorization.
- Make sure the Identity Service is running. Instructions: Set up the integration of a third-party app with Creatio using Identity Service (step 3).
2. Retrieve a Bearer token
Instructions: Retrieve a Bearer token.
You can now integrate third-party apps or web services with Creatio using OAuth 2.0 authorization. Authorize all external requests to Creatio using the Bearer token.
3. Retrieve data from Creatio
-
Create a request to retrieve data using DataService.
- Add a request to the collection. Instructions: Adding requests to the collection.
-
Fill out the request parameters.
Parameter Parameter description Parameter value Request method POST Request URL The URL of the Creatio instance to retrieve data. http://mycreatio.com/ 0/ DataService/ json/ SyncReply/ SelectQuery -
Add the request body.
- Open the Body tab.
-
Fill out the body parameters.
Parameter (Key column) Parameter value (Value column) Body option raw Body type JSON Body value
- Set up the authorization. Instructions: Retrieve data from Creatio (step 2).
- Execute the request.
As a result, you will retrieve the names of all accounts. View result >>>
To implement the example:
Step 1: Set up the integration of a third-party app with Creatio using Identity Service. Read more >>>
Step 2: Retrieve a Bearer token. Read more >>>
Step 3: Retrieve data from Creatio. Read more >>>
This example uses Postman to test requests.
1. Set up the integration of a third-party app with Creatio using Identity Service
- Set up the Identity Service. Instructions: Set up the Identity Service.
- Set up the OAuth 2.0 authorization. Instructions: Set up the OAuth 2.0 authorization.
- Make sure the Identity Service is running. Instructions: Set up the integration of a third-party app with Creatio using Identity Service (step 3).
2. Retrieve a Bearer token
Instructions: Retrieve a Bearer token.
You can now integrate third-party apps or web services with Creatio using OAuth 2.0 authorization. Authorize all external requests to Creatio using the Bearer token.
3. Retrieve data from Creatio
-
Create a request to retrieve data.
- Add a request to the collection. Instructions: Adding requests to the collection.
-
Fill out the request parameters.
Parameter Parameter description Parameter value Request method POST Request URL The URL of the Creatio instance to retrieve data. http://mycreatio.com/ 0/ rest/ CryptographicService/ GetConvertedPasswordValue -
Add the request body.
- Open the Body tab.
-
Fill out the body parameters.
Parameter (Key column) Parameter value (Value column) Body option raw Body type JSON Body value
- Set up the authorization. Instructions: Retrieve data from Creatio (step 2).
- Execute the request.
As a result, you will retrieve the test value converted by the CryptographicService web service. View result >>>