42
Views
2
Comments
Consume REST API: Receieve json response as text
Question
Application Type
Reactive
Service Studio Version
11.54.66 (Build 63364)

I'm trying to fetch an api response as which sends a json object.
{
                "H": 1.0,
                "L": 1.0,
                "W": 1.0,
                "WT": 1.0,
                "rotation": [0.0, 0.0, 0.0, "XYZ"]

}
My expectation is, in my ConsumeRestApi method, I will receieve the json object as a text response.

2024-04-26 12-21-07
Anjali_Dange

Hi Nour Hasan,

If you want to receive JSON Object as text response. You need to change data type of response as Text and response format in Consume method as text/plain. Attached screenshot for reference. Hope this helps.


Thanks & Regards,

Anjali D.

2024-06-08 15-17-54
Nawaz Khan

@Nour Hasan you will receive the JSON response instead text and in order to receive the JSON response successfully you need to define structure having same fields names as per the consumed API response or you can create the JSON response object structure simply by the following option from the structures


Hope it will help

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.