Displaying API response

Hello Team, I am saving below API response in Journey variable ‘OTPVerResponse’ and want to specifically display and use value of ‘otpReference’ as received in below response.

requestID": “49280c48-518a-4d40-b4e2-0da2e8397d22”,
** “errorLevel”: 0,**
** “procResponse”: “Message enqueued successfully”,**
** “campaignID”: “16afddd9-bb6d-43af-a-XXXXXXXXXXXXX”,**
** “otpReference”: “852ca479-2409-4adf-8160-XXXXXXXXXX”**

I am trying to do this by {{variables.OTPVerResponse.otpReference}} but it is not working.

1 Like

Hey @Murtuza_Jeeranwala
Can you please a screenshot of the API response?

Hi Pratik,
Here is snapshot

image

1 Like

Can you please check if OTPVerResponse is an object data type variable?
Alternatively you can look into Transformation function to parse response from an API: Transformation Function | yellow.ai

Hi Pratik, I have changed variable type to Object for OTPVerResponse.

Will this expression work now to reflect value for otpReference

{{variables.OTPVerResponse.otpReference}}

1 Like

Yeah, {{variables.OTPVerResponse.otpReference}} should work just fine.

No dear.

It still shows same.

No value is reflecting.

I added one text node to even reflect OTP reference before going to OTP verification but it shows like this:
image

1 Like

In that case, it seems like you need to parse the API response as JSON using the transformation function. You can learn more about it here: Transformation Function | yellow.ai