LinkedIn
Copied!

Table of Contents

Creating a request for GET and DELETE methods by using an activity implementation

Version:

Only available versions of this content are shown in the dropdown

Create a request for your service so that you can define an external API over REST that customers can call for their application. To create the request, select an activity, and map the request headers, resource path parameters, and query string parameters to the parameters or primary page of the activity.

  1. Create a Service REST rule and configure the resource and processing details. For more information, see Creating a Service REST rule and Defining resource and processing details for a Service REST rule.
  2. Create an activity. For more information, see Creating an activity.
  1. In your Service REST rule, click the Methods tab, and then click the method for which you want to create the request body.

  2. In the Implementation section, select Activity.

  3. In the Activity field, press the Down arrow key and select an activity from the list, or click the rule opener to create a new activity.

    The parameters of the activity are displayed in the Parameters section.
  4. In the Parameters section, define values for the parameters listed in the input boxes in this section.

    The service REST rule will accept these values from an external application. You can provide the following types of values:
    • To map values directly to the clipboard, format the values as .<property>
    • To use constant values, format the values as "property"
    • To use values from the parameter page, format the values as param.<property>
  5. If you selected Enable service SLA with fallback activity on the Service tab of your Service REST rule, in the Fallback activity name field, select or enter a fallback activity to call during a time-out.

  6. If the activity you selected in step 5 has parameters, in the Parameters section, enter values for the parameters for the fallback activity.

  7. Optional:

    If the request is to include a header other than the default headers, on the Request tab, in the Headers section, configure the following information:

    Pega Platform provides the content-type default request header. Pega Platform accepts all standard, valid HTTP headers.
    1. In the Name field, enter the external name of the header field.

    2. In the Description field, describe the purpose of the header.

    3. In the Map to field, specify the destination or the type of destination for the value in Pega Platform:

      • Clipboard – Map to the page name or property on the clipboard specified by the Map to key field, or map to a parameter by specifying param.<some param name>.
      • MapTo functions – If additional choices appear, they identify a custom function rule (Rule-Utility-Function rule type) in a MapTo library. Review the function rule to determine what it does.
    4. In the Map to key field, specify the key to locating the property or the rule in the destination specified in the Map to field:

      • If the Map to value is Clipboard, enter the property name to which to map the data at run time. You can also map to a parameter by specifying param.<some param name>.
      • If the Map to value is a Rule-Utility-Function from a MapTo library, either select a property to hold the results of the function, or leave this field blank, as appropriate for the function.
    If you map to the clipboard on the Service tab of your REST service, the Resource path parameters section is read-only. All methods share the resource path parameters that you configure on the Service tab of your REST service. Resource path parameters are part of the request process of every method. For more information, see Defining resource and processing details for a Service REST rule.
  8. In the Query string section, enter the query string parameters:

    1. In the Name field, enter the name of the input query string.

    2. In the Description field, describe the purpose of the query string.

    3. In the Map to field, specify the destination or the type of destination for the value in Pega Platform:

      • Clipboard – Map to the page name or property on the clipboard specified by the Map to key field. You can also map to a parameter by specifying param.<some param name>.
      • MapTo functions – If additional choices appear, they identify a custom function rule (Rule-Utility-Function rule type) in a MapTo library. Review the function rule to determine what it does.
    4. In the Map to key field, specify the key to locating the property or the rule in the destination that is specified in the Map to field:

      • If the Map to value is Clipboard, enter the property name to which the data should be mapped at run time. You can also map to a parameter by specifying param.<some param name>.
      • If the Map to value is a Rule-Utility-Function from a MapTo library, either select a property to hold the results of the function, or leave this field blank, as appropriate for the function.
  9. Click Save.

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.