Question
Pegasystems Inc.
JP
Last activity: 28 Jun 2023 23:20 EDT
Service REST returning status 302
Our Service REST rule is returning to the caller Status code 302, with nothing in the body. This does not appear to be generated by our code; under what circumstances does Pega Service REST return 302?
More generally, is there a listing of status codes returned by standard Service REST rules, and their reasons?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Updated: 27 Jun 2023 11:13 EDT
Pegasystems Inc.
GB
@tanm1 Pega Service REST does not return a 302 status code by default. However, it returns the following HTTP response codes by default:
- 200 – The request was processed without any errors.
- 500 – An error occurred during processing.
- 401 – An authentication problem occurred.
You can configure additional HTTP response codes and conditions in the Service REST rule by setting up custom responses based on specific conditions. For more information, refer to the "Creating a response for Service REST methods by using an activity implementation" section in the Pega Platform documentation.
Creating a response for Service REST methods by using an automation implementation
POST calls may not be redirected even with Lax redirect enabled. This bug is now fixed and is included in 8.8.3 release, and other releases. This will occur even with a working Lax redirect as documented in the 8.7 document. below
REST connector is not automatically redirecting
@tanm1 Pega Service REST does not return a 302 status code by default. However, it returns the following HTTP response codes by default:
- 200 – The request was processed without any errors.
- 500 – An error occurred during processing.
- 401 – An authentication problem occurred.
You can configure additional HTTP response codes and conditions in the Service REST rule by setting up custom responses based on specific conditions. For more information, refer to the "Creating a response for Service REST methods by using an activity implementation" section in the Pega Platform documentation.
Creating a response for Service REST methods by using an automation implementation
POST calls may not be redirected even with Lax redirect enabled. This bug is now fixed and is included in 8.8.3 release, and other releases. This will occur even with a working Lax redirect as documented in the 8.7 document. below
REST connector is not automatically redirecting
This may be happening because Postman natively maintains a session and reuses that existing POST Authentication call previously performed. To mimic this behavior in Pega, please enable "Maintain session" on both of the Connectors being used with the same "Connection ID" specified. With that set, after running the POST Authentication Data Page (D_AuthService), you should be able to run the actual GET call (D_GetRTCInfo) fine.
With your lder Pega 8.5.6 version you may be experiencing a known issue that has been resolved in Pega 8.8.3. ("REST connector Authentication redirection updated")
Pegasystems Inc.
JP
@MarijeSchillern we have configured a Service REST to which a remote system is connecting. Are you saying there is no way the 302 could have come from PRPC OOTB? This would mean our client must have programmed it in themselves, which is also unlikely... Also, the latter half of your response, including the known issue you mentioned, are about Connect REST, correct?
Pegasystems Inc.
JP
@JohnPaulRaja,C POST
Pegasystems Inc.
IN
I see that this issue is related to Connect Rest but title says Service REST. Could you please change the title from Service REST to Connect REST.