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β
- From the toolbar of the REST data source main screen (AD052), click on the button.
- 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
- Token access URL:
- Authentication type:
In URLs denoted with β<my-domain>
β, this value must be changed to the domain
of the environment in which the source is being created.
- Click on the Next button, at the end of the configuration of each step.
- In the Input parameters step, just set the method to GET.
- In the Output parameters step, add the response body, as in the following example:
{
"message": "string",
"status": 0
}
- Move on to the Security step, without setting any configuration on it.
- 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.
- Your data source is properly configured and working correctly! Click on the Finish button to complete the creation.
Creating service with GET methodβ
- From the toolbar of the REST data source main screen (AD052), click on the button.
- 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
- ID #:
In URLs denoted with β<my-domain>
β, this value must be changed to the domain
of the environment in which the source is being created.
-
Click on the Next button, at the end of the configuration of each step.
-
In the Input parameters step, fill in the fields with the following values:
- Method:
GET
- ID #:β
term
- Parameter:β
QUERY
- Type:β
STRING
- Method:
-
In the Output parameters step, add the response body, as in the following example:
[
{
"identifier": 0,
"companyName": "string",
"state": "string",
"country": "string"
}
]
-
Move on to the Security step, without setting any configuration on it.
-
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.
- term:
-
Your data source is properly configured and working correctly! Click on the Finish button to complete the creation.
Creating service with POST methodβ
- From the toolbar of the REST data source main screen (AD052), click on the button.
- 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
In URLs denoted with β<my-domain>
β, this value must be changed to the domain
of the environment in which the source is being created.
- Click on the Next button, at the end of the configuration of each step.
- In the Input parameters step, fill in the fields with the following values:
- Method:
POST
- Request body:
{
"companyName": "string",
"state": "string",
"country": "string"
}
- In the Output parameters step, add the response body, as in the following example:
[
{
"identifier": 0,
"companyName": "string",
"state": "string",
"country": "string"
}
]
-
Move on to the Security step, without setting any configuration on it.
-
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.
- companyName:β
-
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"
}
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"
}
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"
}
The inserted corporation will not actually be removed, being just an example simulating the removal of a record.
In URLs denoted with β<my-domain>
β, this value must be changed to the domain
of the environment in which the source is being created.