cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Getting 500 Error when Trying to execute POST request in Automation Pilot

Ron_Hagan
Product and Topic Expert
Product and Topic Expert
1,113

I'm trying to use the HttpRequest to run an Incentive Management Pipeline using POST request.  The command uses the clientId, clientSecret, body with the parameters needed, and the tokenUrl.

I can run the request in Postman successfully but in Automation Pilot, I'm getting a 500 (Internal Server Error) response.

When I run a GET request, such as searching for a specific period, it completes successfully.  Not with the POST request.

How can I figure out what's causing this error so that I can fix it?  Any and all suggestions are welcome.  😊

These APIs are in GCP.

Thanks in advance!

Ron

Accepted Solutions (1)

Accepted Solutions (1)

kostadin_karpachev
Product and Topic Expert
Product and Topic Expert
0 Likes

Hello Ron,

Sorry for experiencing such an issue. What I was able to find is that the authentication request succeeds, but the main request returns 500.
Since we do not have very helpful logs for the main request, I am looking at the REST API documentation and you can try the following:

- If not already, double check the headers in the request - if the 'Content-Type': 'application/json' or 'Accept': 'application/json' or both headers should be used (or any other).
- Try setting the timeout of the http request from the default 3 seconds to 10 seconds.
- Since it is a POST request, the body parameter could be problematic. Try to escape special characters if there are any (using dynamic expressions like toEscapedJson/toUrlEncoded/toPercentEncoded)

I hope these suggestions prove useful

kostadin_karpachev
Product and Topic Expert
Product and Topic Expert
0 Likes
Enabling the execution logs helped identify the where the issues was coming from. The request body was altered to fit the API validation. Note that execution logs cannot be enabled on provided commands (like the HttpRequest), so a wrapper command with it was used.

Answers (0)