Skip to main content
Version: 2.2.1

Usage examples

The examples described in this section contain real data and can be applied to any SoftExpert Suite instance. Thus, by following them, you will be able to create and consume data from REST sources used as example. This section also contains data on the services used in the records.

Creating service with OAuth Client Credentials authentication​

  1. From the toolbar of the REST data source main screen (AD052), click on the plus button.
  2. In the REST service data step of the wizard that will open, fill in these fields, as described:
  • ID #: sesuiteSampleOAuthService
  • **Name **: SoftExpert Suite OAuth Service Sample
  • Service URL: https://​<my-domain>​/softexpert/rest/sample/oauth
    • Authentication type: OAuth (client credentials) authentication
      • Token access URL: https://​<my-domain> ​/softexpert/rest/sample/oauth/token
      • Client ID: idsample
      • Client Secret: somesecret
caution

In URLs denoted with ​<my-domain>​, this value must be changed to the domain of the environment in which the source is being created.

  1. Click on the Next button, at the end of the configuration of each step.
  2. In the Input parameters step, just set the method to GET.
  3. In the Output parameters step, add the response body, as in the following example:
{
"message": "string",
"status": 0
}
  1. Move on to the Security step, without setting any configuration on it.
  2. In the Summary step, you can check the configurations set in the previous steps. Click on the Consumption test button to test the created service. On the screen that will open, click on the Run button.
  3. Your data source is properly configured and working correctly! Click on the Finish button to complete the creation.

Creating service with GET method​

  1. From the toolbar of the REST data source main screen (AD052), click on the plus button.
  2. In the REST service data step of the wizard that will open, fill in these fields, as described:
    • ID #: sesuiteSampleCompanyServiceQuery
    • Name: SoftExpert Suite Company Service Query Sample
    • Service URL: https://​<my-domain>​/softexpert/rest/sample/company
caution

In URLs denoted with ​<my-domain>​, this value must be changed to the domain of the environment in which the source is being created.

  1. Click on the Next button, at the end of the configuration of each step.

  2. In the Input parameters step, fill in the fields with the following values:

    • Method: GET
    • ID #:​ term
    • Parameter:​ QUERY
    • Type:​ STRING
  3. In the Output parameters step, add the response body, as in the following example:

[
{
"identifier": 0,
"companyName": "string",
"state": "string",
"country": "string"
}
]
  1. Move on to the Security step, without setting any configuration on it.

  2. In the Summary step, you can check the configurations set in the previous steps. Click on the Consumption test button to test the created service. In the Query section on the screen that will open, enter the following parameter:

    • term: canada

      After doing that, click on the Run button.
  3. Your data source is properly configured and working correctly! Click on the Finish button to complete the creation.

Creating service with POST method​

  1. From the toolbar of the REST data source main screen (AD052), click on the plus button.
  2. In the REST service data step of the wizard that will open, fill in these fields, as described:
  • ID #:​ sesuiteSampleCompanyServiceInsert
  • Name:​ SoftExpert Suite Company Service Insert Sample
  • Service URL:​ https://​<my-domain>​/softexpert/rest/sample/company
caution

In URLs denoted with ​<my-domain>​, this value must be changed to the domain of the environment in which the source is being created.

  1. Click on the Next button, at the end of the configuration of each step.
  2. In the Input parameters step, fill in the fields with the following values:
  • Method: POST
  • Request body:
{
"companyName": "string",
"state": "string",
"country": "string"
}
  1. In the Output parameters step, add the response body, as in the following example:
[
{
"identifier": 0,
"companyName": "string",
"state": "string",
"country": "string"
}
]
  1. Move on to the Security step, without setting any configuration on it.

  2. In the Summary step, you can check the configurations set in the previous steps. Click on the Consumption test button to test the created service. In the Request body section on the screen that will open, enter the following parameters:

    • companyName:​ CT - COMPANY FOR TESTS
    • state: ​SHANDONG
    • country: ​CHINA

      After doing that, click on the Run button.
  3. Your data source is properly configured and working correctly! Click on the Finish button to complete the creation.

Example service data​

The Company Service is a service that simulates the manipulation of information concerning data from fictitious corporations and is available for use in the REST data source. See below the available endpoints:

Retrieve all corporations​

  • URL: https://​<my-domain>​/softexpert/rest/sample/company
  • Method: GET
  • Response body:
[
{
"identifier": 0,
"companyName": "string",
"state": "string",
"country": "string"
}
]

Filter corporations​

  • URL: https://​<my-domain>​/softexpert/rest/sample/company/query
  • Method: GET
  • Parameters (Query Params): NAME​: term /TYPE: text
  • Response body:
[
{
"identifier": 0,
"companyName": "string",
"state": "string",
"country": "string"
}
]

Filter corporations with value range​

  • URL: https://​<my-domain>​/softexpert/rest/sample/company/between
  • Method: GET
  • Parameters (Query Params):
    • NAME​: minID / TYPE: numeric
    • NAME: maxID / TYPE: numeric
  • Response body:
[
{
"identifier": 0,
"companyName": "string",
"state": "string",
"country": "string"
}
]

Insert new corporation​

  • URL: https://​<my-domain>​/softexpert/rest/sample/company
  • Method: POST
  • Request body:
{
"companyName": "string",
"state": "string",
"country": "string"
}
  • Response body:
{
"identifier": 0,
"companyName": "string",
"state": "string",
"country": "string"
}
info
Additional information

The inserted corporation will not actually be persisted, nor saved in memory, being just an example simulating the insertion of a record.

Update corporation​

  • URL: https://​<my-domain>​/softexpert/rest/sample/company
  • Method: PUT
  • Request body:
{
"identifier": 0,
"companyName": "string",
"state": "string",
"country": "string"
}
  • Response body:
{
"identifier": 0,
"companyName": "string",
"state": "string",
"country": "string"
}
info
Additional information

The inserted corporation will not actually be updated, being just an example simulating the updating of a record. If a valid identifier is not entered, nothing is returned.

Remove corporation​

  • URL: https://​<my-domain>​/softexpert/rest/sample/company
  • Method: DELETE
  • Response body:
{
"message": "string"
}
info
Additional information

The inserted corporation will not actually be removed, being just an example simulating the removal of a record.

caution

In URLs denoted with ​<my-domain>​, this value must be changed to the domain of the environment in which the source is being created.