Creating a Service REST rule
You can create Service REST rules to expose the REST APIs that can be called by another application to invoke an action or to retrieve data from Pega Platform. You need a service package and a Service REST rule to create and expose a Service REST from your application.
- In the header of Dev Studio, click .
- In the Service REST Record Configuration section, in the Service name field, enter a label for the Service REST rule.
- In the Service package name field, press the Down arrow key, and then select the service package for the Service REST rule.
- In the Service version field, enter the implementation version for the Service REST rule.
- Create a new URI template to map a resource URI with a service REST rule:Use a URI template to define multiple URIs with similar structures. Templates contain a path and a query. For more information, see Distinct URI specification for service REST rules.
- Click Build URI.
- In the Build URI Template window, click Add.
- In the URI component column, specify the name of the URI component.
- In the URI component type column, specify one of the
following values:
- Literal: A literal value does not change. For example, if you are configuring a service endpoint URL to fetch the next stage of a case, the literal value could be /cases.
- Variable: A variable value can change depending on the information that the service is fetching. For example, for a service endpoint that is fetching the next stage of a case, {caseID} is a variable value. The case ID can change based on the case for which you are fetching the next stage.
For more information, see URI template component requirements. - Click Submit.
- Click Create and open.
- On the Service tab, configure the URL path parameters mapping,
data transform, and other configuration options for your service.For more information, see Defining resource and processing details for a Service REST rule.
- On the
Methods tab,
identify
the activity that is
called by each method in the service REST rule.For more information, see Service REST methods.
Previous topic Service REST rules Next topic Defining resource and processing details for a Service REST rule