cancel
Showing results for 
Search instead for 
Did you mean: 

Web API Service - Response Content is undefined

IanLumbang
Level 2
Hi,

Any idea why the response content is undefined even though the HTTP status code from the api is success? 

I'm attaching screenshot of the configuration in System>Web API Services and the result of the test.

Thank you!

------------------------------
Ian Lumbang
------------------------------
1 BEST ANSWER

Helpful Answers

Here are a few thoughts I had:

1. What happens if you use that exact same Request ID (2057Cjc4M) and Status (inprogress) now on the Blue Prism side? Perhaps that Request ID needs to be reset on the Azure web app to ensure the Blue Prism test is identical to Postman.

2. In the Web API Service, is there anything configured in the Response section for this request? If this section is blank, we will know that the Response Content is not being altered here.
6984.png

2. Are you using Blue Prism and Postman to send these API calls from the same computer? Would there be a network/IP reason to get different responses?

3. Do you have access to those Azure web app logs? This may reveal if the undefined values are being generated there.

4. Lastly, what happens if you set up the Response page to look something like this? You will need to declare those parameters listed here and then set them up as Data Items in your object/process:
6985.png



In my experience, Blue Prism does not alter the Response Content by default, so it would not quietly substitute an 'undefined' value into a JSON body. That Response Content should truly just be a string representation of what the server returned. Usually when Blue Prism fails to parse something, it will throw an exception message and stop the process/object.

------------------------------
Charles Kovacs
Developer Consultant
Blue Prism
America/Chicago
------------------------------
Charlie Kovacs

View answer in original post

6 REPLIES 6

Hi Ian,

I am curious what the response content looks like if you try the exact same request in Postman. Do you get undefined values there, too? Or is it different?

------------------------------
Charles Kovacs
Developer Consultant
Blue Prism
America/Chicago
------------------------------
Charlie Kovacs

Hi Charles,

The response should be like this.



------------------------------
Ian Lumbang
------------------------------

Here are a few thoughts I had:

1. What happens if you use that exact same Request ID (2057Cjc4M) and Status (inprogress) now on the Blue Prism side? Perhaps that Request ID needs to be reset on the Azure web app to ensure the Blue Prism test is identical to Postman.

2. In the Web API Service, is there anything configured in the Response section for this request? If this section is blank, we will know that the Response Content is not being altered here.
6984.png

2. Are you using Blue Prism and Postman to send these API calls from the same computer? Would there be a network/IP reason to get different responses?

3. Do you have access to those Azure web app logs? This may reveal if the undefined values are being generated there.

4. Lastly, what happens if you set up the Response page to look something like this? You will need to declare those parameters listed here and then set them up as Data Items in your object/process:
6985.png



In my experience, Blue Prism does not alter the Response Content by default, so it would not quietly substitute an 'undefined' value into a JSON body. That Response Content should truly just be a string representation of what the server returned. Usually when Blue Prism fails to parse something, it will throw an exception message and stop the process/object.

------------------------------
Charles Kovacs
Developer Consultant
Blue Prism
America/Chicago
------------------------------
Charlie Kovacs

Hi Charles,

Good day!

Please see my responses to some of your queries:
1. Tested the same request id but different status and still getting "requestid: undefined, status: undefined"
2.a. Response setting was blank when API calls was sent previously.
4. Tried it but ​got blank/empty string response from created Response parameters



------------------------------
Ian Lumbang
------------------------------

Hi Ian,

Sorry, I incorrectly numbered some of those questions. I would be curious on your findings to questions 2b and 3. For question 4, what did the Response Content data item look like?

Alternatively, you might try using the REST VBO or HTTP VBO to send these web requests to see if that changes anything. If they are not already imported, you will find them in your install directory: C:\Program Files\Blue Prism Limited\Blue Prism Automate\VBO

As a last resort, you could try writing a code stage as well in C# or VB.NET. I would write and test it in Visual Studio first. I have found this to be helpful as debugging in Visual Studio can give you a more precise and verbose set of information on where an error may be happening. If the code works in Visual Studio, it can be moved over to Blue Prism and should be expected to work the same there.

------------------------------
Charles Kovacs
Developer Consultant
Blue Prism
America/Chicago
------------------------------
Charlie Kovacs

Hi Charles,

I tried writing and altering some code stages in HTTP VBO to send POST request. So with the existing code in the object and the information from internet I was able to get it to work.

Thank you so much for your time.

------------------------------
Ian Lumbang
------------------------------