Digital Exchange

last person joined: an hour ago 

This community is a place to discuss the Blue Prism DX and all of the assets hosted there.
Expand all | Collapse all

Web API Service - Response Content is undefined

Jump to Best Answer
  • 1.  Web API Service - Response Content is undefined

    Posted 08-06-2020 09:24
    Edited by Ian Lumbang 08-10-2020 06:33
    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
    ------------------------------


  • 2.  RE: Web API Service - Response Content is undefined

    Posted 08-06-2020 12:53
    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
    ------------------------------



  • 3.  RE: Web API Service - Response Content is undefined

    Posted 08-07-2020 02:11
    Edited by Ian Lumbang 08-11-2020 08:04
    Hi Charles,

    The response should be like this.



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



  • 4.  RE: Web API Service - Response Content is undefined
    Best Answer

    Posted 08-07-2020 12:42
    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.

    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:



    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
    ------------------------------



  • 5.  RE: Web API Service - Response Content is undefined

    Posted 08-10-2020 04:03
    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
    ------------------------------



  • 6.  RE: Web API Service - Response Content is undefined

    Posted 08-10-2020 12:47
    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
    ------------------------------



  • 7.  RE: Web API Service - Response Content is undefined

    Posted 08-11-2020 03:45
    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
    ------------------------------