LinkedIn
Copied!

Table of Contents

Invoking a REST service rule

Version:

Only available versions of this content are shown in the dropdown

Call a REST service rule from an external system to invoke an action in your application or retrieve data from Pega Platform. For example, you can call a REST service to get the details of a case or assignment. You can specify the application context in which to run the API by using the application alias URL.

Service REST rules that are created in 8.1 cannot be invoked with partial resource URIs. For more information, see Distinct URI specification for service REST rules and URI template component requirements.
  • To call a REST service rule, use api in the URL, and append the three-part key to the rule to the URL. Use the following syntax:

    https://appname.pegacloud.io/contextroot/api/packageName/version/resourcepathURL
    https://appname.pegacloud.io/prweb/api/application/v2/messages
    Although you can still call a REST service by specifying /PRRestService, as a best practice, use api.
  • To call an authenticated REST service in the context of the access group of a specific application, specify the application alias in the endpoint URL:

    If your application does not have an application alias, the system uses the application identifier.
    You can use any servlet name except /PRRestService for alias-based calls. You cannot invoke an application alias URL for unauthenticated services.
    • For non-multitenant environments, enter: http://host/prweb/<servletname>/app/appAlias/api/<service package>/...
    • For multitenant environments, enter: http://host/prweb/<servletname>/app/appAlias/api/TenantHash/<service package>/...
    • For calls without a servlet, enter: http://host/prweb/app/appAlias/api/<service package>/...
    • For API service packages, enter: http://host/prweb/app/appAlias/api/...
    The following access groups are listed in your operator record. To run a service in the context of the AG2 access group, invoke the following application alias URL: http://host/prweb/<servletname>/app/app2/api.
    Access group Application Application alias
    AG1 application1 app1
    AG2 application2 app2
    AG3 application3 app3
    The system chooses the first access group listed in the operator record that matches the application alias. The service then runs in the context of the selected access group.
Did you find this content helpful?

Have a question? Get answers now.

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