Space banner

 

This documentation supports the 20.02 version of BMC Digital Workplace Advanced.

To view the latest version, select the version from the Product Version menu.

REST connector

The REST connector enables you to add calls to RESTful web services inside a process workflow. You can then process the response through a parameterized template, which can be used as the body of an HTTP request in later steps in a workflow.

Configuration parameters

You can configure the default settings for the REST connector as described in Configuring service connectors. The following table describes the parameter required to create a connection:

ParameterExampleDescription
Default Base URL

http://server1-example.com

The base URL to enable workflow actions to use relative URLs.

A base URL enables the workflow action to target the endpoint by relative URL: /method.

The workflow action can override the base URL by specifying the full URL to an endpoint: http://server2-example.com/method

Workflow actions available through the REST connector

The following table provides an overview of all REST connector actions:

Action

Description

Input parameters

Output parameters

Send HTTP RequestSends an HTTP request to a RESTful web service.Send HTTP Request input parametersSend HTTP Request output parameters
Render Template

Processes parameterized template, inserts passed arguments into the template’s parameters, and returns the rendered template as a string.

Template argument values are processed before they are inserted into the template so that special characters are escaped by the rules specified in the Template Type parameter.

Render Template input parametersRender Template output parameters
Generate JWTGenerates a signed or unsigned JSON web token.Generate JWT input parameters

Generate JWT output parameters


Input and output parameters for actions

Send HTTP Request input parameters 

RequiredParameter nameData typeExampleDescription
RequiredConnection IdStringConnection > Connection IDDefault Connection ID for this connector.
RequiredBody ParserString

Can be one of the following string constants:

  • auto
  • text
  • json
  • xml
A type of the body specified in the previous parameter.
OptionalSessionSessionAR-JWT=eyJhbGciOiJIUzI1NiJ9...

If the session value is not specified, a new session value is created by default.

Authentication session data can be used across several HTTP requests. The Session value output from one Send HTTP Request action can be passed to the Session value input of another action.

The session is valid for the duration allowed by the policy of the connected service.

Optional MethodString

Can be one of the following string constants:

  • GET
  • PUT
  • POST
  • DELETE
  • HEAD
  • OPTIONS
  • PATCH
HTTP method
Optional UriString

http://server2-example.com/method /method

Endpoint URI for the request. Can be relative or absolute.

A relative URI is appended to the Base URL specified in the connection options.

An absolute URI overrides the Base URL configuration setting.

OptionalHeadersInputSetBuild Input Set > Output > InputsA collection of HTTP headers of an HTTP request to be sent.
OptionalBodyString
A body of an HTTP request to be sent.

Send HTTP Request output parameters 

Parameter nameSub parameterData type
Request   BodyString
HeadersString
MethodString
URIString
Response   BodyString
HeadersString
StatusString
Status ReasonString
SessionCookiesString

Render Template input parameters 

RequiredParameter nameData typeExampleDescription
RequiredTemplateString

"{""First_Name"":""${First_Name}"",""Last_Name"":""${Last_Name}""}"

Template to process
Optional Template TypeString

Can be one of the following string constants:

  • URL
  • JSON
  • XML
  • TEXT
Type of the template arguments needed for selection of escaping rules.
 OptionalArgsInputSetBuild Input Set > Output > InputsA set of arguments to be passed to the template.

Tip

Import the ServiceExport.zip as a service for an example with the Render Template input parameters.

Render Template output parameters
Parameter nameData typeExampleDescription
OutputString

A string that contains a template with arguments substituted with their values.

Special characters are escaped according to the format selected in the Template Type input parameter.

Generate JWT input parameters 

RequiredParameter nameData typeExampleDescription
RequiredJwt HeadersInputSet

Build Input Set > Output > Inputs that contain the following parameters:

alg is equal to one of the following values:

  • none
  • RS256

typ=JWT

Other JWT headers also possible.

A set of JWT headers to be added to the token.

If alg is not specified, JWT is unsigned.

If typ is not specified, JWP is specified by default.


OptionalIssuerString

Identifies the principal that issued the JWT, a Client ID of a service.

Optional SubjectString
Identifies the principal that is the subject of the JWT.
OptionalAudienceString
Identifies the intended recipients of the JWT.
OptionalExpires inInteger
The number of seconds in which the generated token will expire. The default is 60 seconds, unless a value greater than 0 is specified.
OptionalOther JwtBody ClaimsInputSetBuild Input Set > Output > InputsA set of non-standard JWT body claims.
OptionalPath to Signature KeyString
A fully qualified path to a private key that is to be used to sign the generated JWT. Required only if the token must be signed.

Generate JWT output parameters

Parameter nameData typeExampleDescription
OutputStringBuild Input Set > OutputGenerates a JWT token that can be used as a parameter in other activities in a workflow.

Was this page helpful? Yes No Submitting... Thank you

Comments

  1. Adam Neuman

    The Error Boundary for the HTTP Request (part of the REST API Connector) is not returning the actual HTTP errors, instead it sends a generic exception which is the same for all types of errors. Can this be corrected or is there another approach for receiving and handlinf the actual HTTP error responses inside the workflow?

    Jun 28, 2021 06:35
    1. Olha Horbachuk

      Hello Adam Neuman, thanks for an interesting question.

      The Error Boundary event is applicable to all the connectors (not only REST). Currently, it is a designed approach to send a generic exception. As a workaround, we recommend using the "if" condition (by adding the Exclusive gateway). Thus, error messages will be sent on the defined condition (in this case, if an in-app notification failed). 


      Jun 30, 2021 07:37
  2. Pankaj Sud

    How can you use REST connector to do operations in Microsoft Active Directory connector? For example, if an external application would like to interface with DWP to call the REST API in order to add/remove a user/member from a Microsoft Active Directory Security Group, how this can be done? Could you please provide an example how to query membership of a Microsoft Active Directory Security Group using RES API end-point? Also, what kind of training is required to be able to perform Business-to-Business integration like REST APIs?

    May 26, 2022 01:33
    1. Aaditi Lakade

      Hello, Pankaj Sud 

      Thank you for your queries and your interest in using REST APIs for B2B integrations. Please allow me some time to consult with the engineering team and we shall get back to you. 

      Thanks, 

      Aaditi

      May 30, 2022 05:36
      1. Aaditi Lakade

        Hello Pankaj Sud

        We do have a Microsoft Active Directory connector, which would make it easier to achieve the use case. Did you get a chance to look at the Microsoft Azure connector topic? As for the training for B2B integration using REST APIs, BMC does not recommend any specific training. 

        Hope this helps with your queries, 

        Aaditi

        Jun 01, 2022 04:04
    1. Nick Cui

      I have the same requirement ,need to add OU and have solution now ?

      Jun 08, 2023 02:49
      1. Aaditi Lakade

        Hello Nick, 

        Thank you for your comment. Could you please elaborate on your requirement for us to respond to you effectively? 

        Aaditi

        Jun 11, 2023 11:22
        1. Aaditi Lakade

          Hello, Nick Cui

          It would be great if you can elaborate on your requirement for us. Meanwhile, I am closing this comment thread. 

          You can always reopen it when you are ready with the requirements. 

          Thanks, 

          Aaditi

          Jun 16, 2023 02:52
          1. Nick Cui

            I mean the AD connector can only create user ,create group now,but can not create Organizational unit . so is there a solution now ?

            Jun 16, 2023 03:07
            1. Aaditi Lakade

              Hello Nick Cui

              This would require a product enhancement. You can vote on, comment on, and submit product ideas in BMC Community. To see BMC Helix community ideas, click Digital Workplace community 

              Thanks, 

              Aaditi

              Jun 18, 2023 11:40
  3. Jan Hartung

    Is there any timeout for the Send Http Request node and can it be configured somewhere?

    Nov 22, 2022 01:52
    1. John Taylor

      Hi Jan Hartung,

      For versions of Digital Workplace prior to 21.02, you can set the timeout using the following environment variables:

      • CLIENT_CONNECT_TIMEOUT
      • CLIENT_READ_TIMEOUT

      These timeout values are in milliseconds.

      For Digital Workplace 21.02 and later, there is unfortunately no way to specify a timeout.

      If you need further help with this, you can submit a support ticket via this URL - https://www.bmc.com/support/support-central.html#/dashboard

      Thank you,

      -John Taylor

      Nov 23, 2022 04:39
  4. Jan Hartung

    Hi John,

    Thanks for the explanation, that is what I was looking for.

    Jan

    Nov 24, 2022 01:15