Create and manage web request templates

License:

This functionality requires a license for the ArcGIS Workflow Manager Server Advanced role.

Web request templates can be configured with job activities to automatically send web requests to REST endpoints when specific job activities are performed in a workflow. For example, a web request template can be configured to retrieve data or post updates to a third-party system when a job is updated. The response can then be stored as custom output values to direct workflow paths or update job properties.

Create web request templates

Complete the following steps to create a web request template:

  1. Access the Workflow Manager web app.
  2. Click the Design tab.

    The Design page appears.

    Note:

    If you don't have sufficient privileges, the Design tab is not available.

  3. Click Templates Templates.
    Note:

    If you don’t have sufficient privileges, Templates Templates is not available.

  4. Click the Web Request tab.

    The Web Request panel appears.

    Note:

    If you don’t have sufficient privileges, the Web Request tab is not available.

  5. Click Create New in the Web Request panel.
  6. Provide a name for the web request template in the Name text box.
  7. Click the URL drop-down arrow and choose the type of request you want to send.
  8. Type the URL of the REST endpoint in the URL text box.
  9. Optionally, add path variables to the URL using the following syntax:
    https://gisserver.domain.com/webadaptorname/apps/workflowmanager/:pathVariable/

    Path variables appear in the Path Variables section.

  10. Optionally, add query parameters to the web request template.
    1. Click Add Key & Value in the Query Parameters section.
    2. Provide a key in the Key text box.

      You can also use ArcGIS Arcade expressions to provide a dynamic value.

    3. Provide a value in the Value text box.

      You can also use ArcGIS Arcade expressions to provide a dynamic value.

    4. Leave the Enabled check box checked.
    5. Repeat substeps a through d to add more key-value pairs.
  11. If you added path variables to the URL, provide a value for each variable in the Path Variables section.

    You can also use ArcGIS Arcade expressions to provide a dynamic value.

    Tip:

    Click This input supports Arcade Expressions This input supports Arcade expressions and choose an ArcGIS Arcade expression to add it to its associated text box.

  12. Click the Authorization tab.
  13. Choose the REST endpoint's authentication method and provide authentication information as necessary.
    Caution:

    Authentication information you provide in the step is not encrypted. You can store information securely by adding an encrypted user-defined setting that can be referenced in the step using dynamic job properties.

    Note:

    The Federated Token option allows you to authenticate web requests as the user performing the step. The Federated Token option is only compatible with services published to the same Enterprise site as Workflow Manager.

    1. Optionally, if you chose the API Key or Bearer Token option, click Alternatively Generate Token from Endpoint.

      The Generate Token from Endpoint dialog box appears.

    2. Configure token settings to generate a token for the web request.
  14. Optionally, click the Headers tab to add custom header key-value pairs to the web request template.
    1. Click Add Key & Value in the Custom Headers section.
    2. Provide a key in the Key text box.

      You can also use ArcGIS Arcade expressions to provide a dynamic value.

    3. Provide a value in the Value text box.

      You can also use ArcGIS Arcade expressions to provide a dynamic value.

    4. Leave the Enabled check box checked.
    5. Repeat substeps a through d to add more key-value pairs.
  15. Optionally, click the Body tab to add data to the web request.

    The request body supports form data key-value pairs, URL encoded key-value pairs, and raw data in JSON or plain text format.

    Tip:

    You can also use an ArcGIS Arcade expression to retrieve user-defined settings or provide dynamic values in the body text.

  16. Optionally, if you have a license for the ArcGIS Workflow Manager Server Advanced role, configure the web request template's output settings.
    Note:

    The job activity for which the template is configured must be completed before you can test the output value of the web request.

  17. Optionally, click the Test tab and click Test Response to send the configured request and show its response.

    If the web request contains job-specific Arcade expressions, you must turn on Include Job ID and provide a job ID in the Job ID text box to properly format the request.

Configure token settings

If the REST endpoint requires a token for authentication, complete these steps to configure the web request template to generate a token that can be used to authenticate the web requests.

  1. On the Authorization tab, choose the API Key or Bearer Token option, and click Alternatively Generate Token from Endpoint.

    The Generate Token from Endpoint settings appear in the Web Request panel.

  2. Click the URL drop-down arrow and choose the type of request you want to send.
  3. Type the URL of the REST endpoint in the URL text box.
  4. Optionally, add path variables to the URL using the following syntax:
    https://gisserver.domain.com/webadaptorname/apps/workflowmanager/:pathVariable/

    Path variables appear in the Path Variables section.

  5. Optionally, add query parameters to the web request.
    1. Click Add Key & Value in the Query Parameters section.
    2. Provide a key in the Key text box.

      You can also use ArcGIS Arcade expressions to provide a dynamic value.

    3. Provide a value in the Value text box.

      You can also use ArcGIS Arcade expressions to provide a dynamic value.

    4. Leave the Enabled check box checked.
    5. Repeat substeps a through d to add more key-value pairs.
  6. If you added path variables to the URL, provide a value for each variable in the Path Variables section.

    You can also use ArcGIS Arcade expressions to provide a dynamic value.

    Tip:

    Click This input supports Arcade Expressions This input supports Arcade expressions and choose an ArcGIS Arcade expression to add it to its associated text box.

  7. Optionally, click the Headers tab to add custom header key-value pairs to the web request.
    1. Click Add Key & Value in the Query Parameters section.
    2. Provide a key in the Key text box.

      You can also use ArcGIS Arcade expressions to provide a dynamic value.

    3. Provide a value in the Value text box.

      You can also use ArcGIS Arcade expressions to provide a dynamic value.

    4. Leave the Enabled check box checked.
    5. Repeat substeps a through d to add more key-value pairs.
  8. Optionally, click the Body tab to add data to the web request.

    The request body supports form data key-value pairs, URL encoded key-value pairs, and raw data in JSON or plain text format.

    Tip:

    You can also use an ArcGIS Arcade expression to retrieve user-defined settings or provide dynamic values in the body text.

  9. Click the Token tab.
  10. Click the Test Mode toggle button in the Token section.
  11. Paste an example of the REST endpoint's response in the Sample Response text box.

    Example response in JSON format:

    {"access_token": "12345abcde",
    "expires_in":7199,
    "spatialReference": {
      "wkid": 4326,
      "latestWkid": 4326
    },
    "location": [
      {
        "name": "380 New York Street",
        "extent": {
          "xmin": -117.196701,
          "ymin": 34.055489
        }
      }
    ]}
  12. Provide a name for the token in the Output Value text box.

    This is the name that is used by the web request template to reference the generated token.

  13. Provide a JSONPath expression in dot notation or bracket notation in the Extraction Path text box to parse the response and return the generated token.

    Example JSONPath in dot notation:

    $.access_token

    Example JSONPath in bracket notation:

    $['access_token']

    The value appears in the Sample Result column.

  14. Click Back to continue configuring the web request.

Configure output settings

License:

This functionality requires a license for the ArcGIS Workflow Manager Server Advanced role.

You can save the REST endpoint's response as a file, attach it to the template, and configure it as custom output values. The output values can be used to direct workflow paths or be used as inputs for steps. If an output value is not configured for the template, the request's HTTP status code is stored as the template's output value. Complete the following steps to configure the template's output settings:

  1. Click the Output tab.
  2. Optionally, click the Enabled toggle button in the Attach Response section to save the REST endpoint's response as a file and attach it to the template.
  3. Optionally, configure the attachment name and folder where the response will be stored:
    1. Provide the name of the folder where the attachment will be stored in the Folder Name text box.

      The folder name can't contain a file system path or special characters. If a folder name isn't provided, a folder named General is automatically created.

      Note:

      The folder is contained within the workflow item and is not a file system path.

    2. Choose one of the following Attachment Name options:
      • Autogenerated—Automatically names the attachment using the following syntax: <StepName>_<RunDate>_<RunTime>
      • Custom—Allows a custom attachment name to be provided
  4. Optionally, configure custom output values for the REST endpoint's response:
    1. Click the Test Mode toggle button in the Output Values section.
    2. Paste an example of the REST endpoint's response in the Sample Response text box.

      Example response in JSON format:

      {"access_token": "",
      "expires_in":7199,
      "spatialReference": {
        "wkid": 4326,
        "latestWkid": 4326
      },
      "location": [
        {
          "name": "380 New York Street",
          "extent": {
            "xmin": -117.196701,
            "ymin": 34.055489
          }
        }
      ]}
    3. Click Add Output & Path.
    4. Provide a name for the output value in the Output Value text box.

      This is the value name that is used to obtain the custom output value.

    5. Provide a JSONPath expression in dot notation or bracket notation for the value that you want to store in the Extraction Path text box.

      Example JSONPath in dot notation:

      $.location.0.name

      Example JSONPath in bracket notation:

      $['location'][0]['name']

      The value appears in the Sample Result column.

    6. Optionally, repeat substeps c through e to add more custom output values.
  5. Click Save to save changes.

Edit web request templates

Complete the following steps to edit web request templates:

  1. Access the Workflow Manager web app.
  2. Click the Design tab.

    The Design page appears.

    Note:

    If you don't have sufficient privileges, the Design tab is not available.

  3. Click Templates Templates.
    Note:

    If you don’t have sufficient privileges, Templates Templates is not available.

  4. Click the Web Request tab.

    The Web Request panel appears.

    Note:

    If you don’t have sufficient privileges, the Web Request tab is not available.

  5. Click the name of the web request that you want to edit in the Web Request panel.
    Tip:

    You can filter the list of web requests in the Web Request panel by typing a search term in the Search Web Request Templates text box.

  6. Update the web request as necessary.
  7. Click Save to save the changes.

Delete web request templates

Deleting a web request template is permanent and can’t be undone. Complete the following steps to delete web request templates:

  1. Access the Workflow Manager web app.
  2. Click the Design tab.

    The Design page appears.

    Note:

    If you don't have sufficient privileges, the Design tab is not available.

  3. Click Templates Templates.
    Note:

    If you don’t have sufficient privileges, Templates Templates is not available.

  4. Click the Web Request tab.

    The Web Request panel appears.

    Note:

    If you don’t have sufficient privileges, the Web Request tab is not available.

  5. Click the name of the web request you want to delete in the Web Request panel.
    Tip:

    You can filter the list of web requests in the Web Request panel by typing a search term in the Search Web Request Templates text box.

  6. Click More Actions More Actions and click Delete.

    A confirmation message appears.

  7. Click Yes to delete the web request or click No to cancel.

Related topics