Salesforce

REST Client - XML (Magic xpi 4.9)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

REST Client - XML (Magic xpi 4.9)

The REST Client component allows the user to invoke RESTful Web Service from the Magic xpi flow. When you place the REST Client component as a step into a flow, the Properties pane opens. Double-click or right-click on the component and select Configuration from the context menu to open the REST Client Configuration dialog box.

This dialog box contains the following fields:

Property

Description

Connection

Resource Name

The name of the REST Client resource that you selected in the component's Properties pane. The resources are defined in the Settings dialog box's Resources section.

Operation

Path

Select the REST path from the drop-down list. The list is populated from the resource. Selected path will be used form the Endpoint RESTful Resource (entity)

Operation

Select one of the following operations from the drop-down list:

  • Get (default)

  • Post

  • Put

  • Patch

  • Head

  • Delete

Security

Select the security to be associated with REST invoke call. The security options are configured as a part of the REST Client Resource configuration.

The default value is Yes, so the REST call will be secured unless specified otherwise.

For example, for the Post operations when security is required, keep the value as Yes whereas for the Get operation when security is not required to invoke the REST operation, keep the field as No.

Request Content Type

Select the Request Content Type to be sent as a part of the REST request. This will set HTTP Header called Content-Type.

Click to open the Content Type list. Select the required Content Type.

The default list contains following Content Types:

  • application/json

  • application/pdf

  • application/xml

  • image/jpeg

  • image/png

  • multipart/form-data

  • text/plain

  • text/html

  • text/xml

Response Content Type

Select the Response Content Type to be received as a part of the REST response. This will set HTTP Header called Accept.

Click to open the Content Type list. Select the required Content Type.

The default list contains following Content Types:

  • application/json

  • application/pdf

  • application/xml

  • image/jpeg

  • image/png

  • multipart/form-data

  • text/plain

  • text/html

  • text/xml

Desired Encoding

Select the desired encoding of the data to be sent as a part of the REST request. Desired encoding will convert the data into the selected Encoding type. In this scenario (except Keep Existing) the HTTP Header Content-Type will contain Charset option.

For example, if the desired encoding is selected as UTF-8 and Request Content-Type is selected as application/json then Content-Type HTTP Header will be set as Content-Type = application/json; Charset = UTF-8

The default value is Keep Existing. In this case the user can provide Charset value.

The supported encoding values are Keep Existing, UTF-8 with BOM, UTF-8, Unicode, Ansi and Binary.

The runtime conversion will be done to the Data BLOB. See: REST Client - Conversion Table

This field is disabled when the Request Content Type is set as multipart/form-data.

Charset

Click to open the Encoding Type list and select the Encoding Type.

This field is disabled when the Request Content Type is set as multipart/form-data or the Desired Encoding is set other than Keep Existing.

Output

Store Result In

This is the result sent by RESTful API.

Defines whether you want to store the result in file or variable. Select one of the following from the drop-down list:

  • File: Select a file to hold the object data that is returned by REST body. Click to open the Expression Editor or click and enter the file path where this information is to be stored.

  • Variable (default is C.UserBlob): Select a variable to hold the object data that is returned by REST body.
    Click to open the Variables List. Select a variable where this information is to be stored.

Header Filter

Enter the response header(s) text or an expression that will be added to the REST body header.

Headers are delimited by commas (,). If any header value contains a comma (.), then the value must be escaped with a backslash.

If no header is specified or if the field is left blank, then by default all the headers will be saved in the Header field.

Header

Click to open the Variable List and select a variable which will hold the output header.

The headers filtered by the Header Filter will only be available here.

To save the Header information while running the project, setting the Header variable is mandatory.

Status Code

This is the HTTP Response Code returned by the REST request.

For example, 200, 201, 401 etc.

Message

This is the HTTP Response Message returned by the REST request.

For example, OK, Created, Unauthorized etc.

Operation Success

This field lets you easily determine if the data object was successfully located in REST invoke. Select one of the following from the drop-down list:

  • None (default): Select this option if you do not want to save the connector’s success or failure status.

  • Variable: Select the variable where you want to store the connector's success or failure status.

The REST Client Configuration dialog box contains the following additional button:

Button

Description

Parameters

The Parameters button allows the user to configure the Header and Query parameter values per REST invoke.

When you click the Parameters button, the Parameters Configuration dialog box opens where you can overwrite the default parameters' values inherited from the selected REST Client resource.

Once the Parameters Configuration is saved, the changes made to the REST Client Resource do not get reflected here.

The changes can be seen in the newly added step after the re-configuration of the resource.

For more in information on Parameters Configuration, click here.

Refresh Schema

The Refresh Schema button keeps the Form parameters on the REST Client component in sync with the REST Client Resource.

When you click the Refresh Schema button, the current schema is overwritten and is synced with the REST Client Resource configuration.

The schema generated will be used to reflect the Form Parameters in the Data Mapper. The destination tab of Data Mapper will allow the user to set these values of the Form Parameters.

Click OK to complete the REST Client configuration. If a schema does not exist, the schema is created as per the configurations on the REST Client Resource. The configuration information is saved, and the Data Mapper window opens with the selected schema as the Destination. Here the user can map the required values for the Form parameters to complete the desired operation in REST Client.

Alternatively, you can click Cancel to exit the REST Client Configuration dialog box without saving your settings or modifications.

Reference
Attachment 
Attachment