Extracting result from HTTP response

Hi.

I am sending an HTTP call and the response back is a link to a document. WHat is the correct process to deserialize the response to get the result from the “message” key value pair. Once I have the address I will then use this in another HTTP Request to obtain the document.

This is an example of the response that I will be getting.

{“message”:“https://server.com.au/doc.docx”}

Thanks.

@craig.norton

you can use deserialize json activity pass the request response in to the activity and access the address. with something like var('message').tostring

@craig.norton

After executing the HTTP action, check for status code whether you are hitting API failed or success . Make a condition there(Status Code = 200 or any success code)
based on your response whether you need to extract a json data you can use deserialization activity. in this activity give the output of HTTP activity
then you can get Json data, from there you can get your required data by using the Key.

Note if it is array format you deserialization array and use loop inside loop extract your required data

Happy Automation!!

@craig.norton

please use Deserialize JSON activity to convert json string into jobject.

after that you can retrieve message value by following expression

jsonObject is output variable of Deserialize JSON activity.

messageValue = jsonObject("message").ToString

Hi @craig.norton

Try this pls

Send an HTTP request, deserialize the JSON response, retrieve the URL using - response(“message”).ToString(), and then use this URL in another HTTP request to fetch the document.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.