Skip to main content


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

Configuring the request and response in REST integration by adding a REST response

Updated on April 6, 2022

On the Data model page of the Create REST Integration wizard, you can obtain REST responses for each method that you selected on the Resource methods page of the wizard. The system uses this data to generate the request and response data models for each method. For example, add a REST response if you have a live REST endpoint from which to get sample data.

  1. Click Add a REST response.
  2. Select a method from the Choose method list.
  3. Enter the values of individual elements under Resource path parameters, Request headers, and Query string parameters.
    The system updates the endpoint URL with the values of the resource path parameters.
    Note: Consider the following points:
    • For POST and PUT methods, select the content type for the request (XML or JSON) and configure the body of the request by using the content type.
    • The REST Integration wizard does not support the use case in which you create XML payload that consists of only a single text element that has no attributes or child nodes, for example, <sampleElement>my_text</sampleElement>. To avoid errors, perform any of the following actions:
      • Make the XML payload more complex by adding child nodes or attributes.
      • Generate the connector without using a sample XML response, and then manually configure the Parse XML rule after running the wizard. For more information, see Creating a Parse XML rule.

    The parameter and header values are applicable only for the current instance of test execution for the method that you selected in step 2.

  4. If you are using OAuth 2.0 with the authorization grant type to authenticate your REST data source and if you did not connect to the OAuth 2.0 service provider on the Connection page of the wizard, click Connect to generate an access token. This action authenticates and authorizes your connection with the provider and allows you to access protected content.
    1. Once you are connected to the OAuth 2.0 service provider, click Run to view the response. The default response is displayed in XML format on the Body tab, and the header information is displayed on the Headers tab.
  5. Click Submit to save the response.
    The response is listed in the Sample section and is named by using the format <method> run. For example, if you save the response for a GET method, it is named GET run. You can click View next to the name to see the response.
  6. Continue with step 2 of Defining a data model for REST integration.
  • Previous topic Defining a data model for REST integration
  • Next topic Configuring the request and response in REST integration by adding a file

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