Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Invoking a REST service rule

Updated on April 6, 2022

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.

Note: 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
    For example:
    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.
    Note: 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/...
    For example: 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 groupApplicationApplication alias
    AG1application1app1
    AG2application2app2
    AG3application3app3
    Result: 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.

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us