Skip to main content
Version: 8.0

Retrieve data from Creatio using OAuth 2.0 authorization and DataService

Level: intermediate

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 >>>

Example

Retrieve the names of all accounts from the Accounts section. Use OAuth 2.0 authorization and DataService to integrate the app with Creatio.

Response
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

  1. Set up the Identity Service. Instructions: Set up the Identity Service.
  2. Set up the OAuth 2.0 authorization. Instructions: Set up the OAuth 2.0 authorization.
  3. 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

  1. Create a request to retrieve data using DataService.

    1. Add a request to the collection. Instructions: Adding requests to the collection.

    2. 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

    3. Add the request body.

      1. Open the Body tab.

      2. 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" } } } } }

    Request
    POST http://mycreatio.com/0/DataService/json/SyncReply/SelectQuery

    {
    "RootSchemaName": "Account",
    "columns": {
    "items": {
    "Name": {
    "expression": {
    "columnPath": "Name"
    }
    }
    }
    }
    }
  2. Set up the authorization. Instructions: Retrieve data from Creatio (step 2).

  3. Execute the request.

As a result, you will retrieve the names of all accounts. View result >>>


Resources

Creatio API documentation