REST API Client Service

The REST API Client Service is a Business Process used to call the REST APIs and process the response accordingly.

You can invoke the RESTAPIClient Business Process to access any REST web service.

From the Administration menu, click Business Processes > Manager. Search for RESTAPIClient.

The following table provides an overview of the REST API client service:

System Name

RESTAPIClient

Graphical Process Modeler (GPM) category

None (Out of the box Business Process)

Description

Generic REST API Client to invoke/access REST Web services

Business usage

Access the REST services and process the output

Preconfigured?

No

Requires third-party files?

Yes, json-simple-1.1.1.jar

Platform availability

All supported Sterling B2B Integrator platforms

Related services

None

Application requirements

None

Initiates business processes?

Yes

Invocation

Included in a predefined RESTAPIClient business process

Business process context considerations


RESTAPIClient invocation
Operations supported: GET, PUT, POST, DELETE
Protocols: HTTP and HTTPS
Input type: JSON
Output type: XML 
Proxy Supported: HTTP Proxy only with/without Authentication

Returned status values

Standard HTTP Responses. Example: 200, 202, 400

Restrictions

Supports only basic authorization

Persistence level

None

Testing considerations

None

Input Parameters

The following table describes the parameters input from the business process to this service:

Parameter

Description

url

URL of the REST resource, which needs to be accessed.

delim

Allows for the override of the URL delimiter. This is a string, which should be unique and not found in URL.

Rest Operation

GET,POST,PUT, and DELETE operations are supported.

Authorization

Type of Authorization. Only basic authorization is supported.

auth

Username or password to access the rest URL, if required.

isProxy

Supports HTTP proxy only. The values are true/false.

proxyPort

Port of the proxy server.

proxyHost

Hostname of the proxy server.

isProxyAuth

Supports proxy authentication. If yes, proxyUser and proxyPassword needs to be populated.

jsoninput1

For POST and PUT request, the json data is specified here.

Content-type

Type of the content type. Example: Application/JSON, Application/XML

outputpath

The Path and Filename where the Response document from a REST GET Request is written. This parameter is necessary when the Content-type of the Response document is Application/JSON.

Accept

Type of request accepted. Example: Application/JSON, Application/XML

headers

Type of HTTP header specified in a key:value format separated by commas.

Business Process Example


<process name="RESTAPIClient">
  <sequence>
        <operation name="Request">
          <participant name='RESTAPIClient'/>
            <output message='xout'>
             <assign to=i></assign>
             <assign to="url">https://graph.microsoft.com/v1.0/sites/company.sharepoint.com,6b47dfce-
                           ea4a-4de1-8ec2-38c6264fc4cd,b1e6932f-273d-4330-b6ba-11e04e073904/drives</assign></assign>
             <assign to="delim">CUSTOM-DELIM</assign>            
             <assign to='restoperation'> </assign>
	      <assign to='auth'> </assign>  
             <assign to='Authorization'>Basic</assign>
	      <assign to='isProxy'> </assign>
             <assign to='proxyHost'></assign>
	      <assign to='proxyPort'></assign>
	      <assign to='isProxyAuth'></assign>
	      <assign to='Content-type'>Application/json</assign>
             <assign to='outputpath'>/home/test/install/logs/json.out.txt</assign>
	      <assign to='Accept'>Application/json</assign>
             <assign to='headers'>key1:value1,key2:value2</assign>
             <assign to='proxyUser'></assign>
             <assign to='proxyPassword'></assign>
             <assign to='jsoninput1'> 
                       "key1": "value",
                       "key2": "value2"
             </assign>
             <assign to='.' from='*' />
           </output>
         <input message="xin">
        <assign to='.' from='*' />
      </input>
    </operation>
  </sequence>
</process>