REST API POST method, unable to get response in a variable

Hi, I am calling below API to fetch cities for a specific country.
https://countriesnow.space/api/v0.1/countries/cities
This is a post method and requires country name in the request body to return the belonging cities, so I added “country” to my custom request schema. Testing went all good and I could successfully SET SCHEMA FROM RESPONSE for Composer to recognize the response structure.

The issue I am facing is that it does not seem to let me fetch the response in the app. In my data variable “CityAPI1”, the logic tells me that POST response should be stored in CityAPI1 in “Set data variable” and I want to pass the response to my app variable in “Set app variable”. However, the response properties is for some reason only “country”, instead of “data”, “error” and “msg”. Any advise how I can get the response properties?





1 Like

Figured out how to get the POST response. I had to use Formula and use “Output of another node”. There I could specify “outputs[“Create record”].response.data”. The cities are returned in a list so that’s what I wanted. The validation says it’s incompatible because I was using the wrong receiving variable. After fixing the receiving variable, it’s working as expected now!

Not sure why response properties were not available when using “Data and Variables” though…

1 Like