Retrieve data from Creatio using OAuth 2.0 authorization and DataService
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 >>>
Retrieve the names of all accounts from the Accounts section. Use OAuth 2.0 authorization and DataService to integrate the app with Creatio.
Status: 200 OK
{
"rowConfig": {
"Id": {
"dataValueType": 0
},
"Name": {
"dataValueType": 1
},
"AccountLogo": {
"dataValueType": 16,
"isLookup": true,
"referenceSchemaName": "SysImage"
}
},
"rows": [
{
"Name": "Accom (sample)",
"Id": "405947d0-2ffb-4ded-8675-0475f19f5a81",
"AccountLogo": ""
},
{
"Name": "Our company",
"Id": "e308b781-3c5b-4ecb-89ef-5c1ed4da488e",
"AccountLogo": ""
}
],
"notFoundColumns": [],
"rowsAffected": 2,
"nextPrcElReady": false,
"success": true
}
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
{ "RootSchemaName": "Account", "columns": { "items": { "Name": { "expression": { "columnPath": "Name" } } } } }
-
RequestPOST http://mycreatio.com/0/DataService/json/SyncReply/SelectQuery
{
"RootSchemaName": "Account",
"columns": {
"items": {
"Name": {
"expression": {
"columnPath": "Name"
}
}
}
}
} -
-
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 >>>