GeoEvent-Poll an External Website for JSON

242
5
a month ago
RipaliBatra
New Contributor II

I have configured API in the Input connector, but the response of API is not correctly mapped when there is an array or nested JSON.It is only considering the parent JSON and thus all the content is not fetched properly.

Can someone please guide me if I am missing something, or this is how it behaves and there is some other approach to handle it.

API : api.waqi.info/feed/lucknow/?token=fa73462a52dbbb8848d20a0554fb72424af90975

tes.png

Incorrect JSON:

Screenshot 2024-03-28 192714.png

0 Kudos
5 Replies
Gene_Sipes
New Contributor III

Try putting "data" in the JSON object name parameter of the input connector.

Gene_Sipes_0-1711636487751.png

 

0 Kudos
RipaliBatra
New Contributor II

Thanks for your reply @Gene_Sipes 

I have already configured JSON Object Name with "data" for my case and therefore it is returning the properties correctly which are inside the "data" JSON. But  for the nested json the response is not correctly mapped. Eg:- In the below api response sample, properties such as iaqi, attributions are not correctly mapped.

api.waqi.info/feed/lucknow/?token=fa73462a52dbbb8848d20a0554fb72424af90975

Can you please help me on this?

0 Kudos
Gene_Sipes
New Contributor III

This might be worth a read, hopefully it helps:
https://community.esri.com/t5/arcgis-geoevent-server-blog/json-data-structures-working-with-hierarch...

Also, I have a JSON feed with multi-cardinality structure, albeit a simple one, but in the input definition the property with multi-cardinality looks like that below. Maybe you can adjust your definition similarly. It's the rental uris.

Gene_Sipes_0-1711718978440.png

 

0 Kudos
RipaliBatra
New Contributor II

Hi @Gene_Sipes ,

I have validated the multi-cardinality structure, but not sure why nested json properties are still not correctly mapped.

Consider the "attributions" (for example ) in the api response, it does not even map url ,name and logo.I tried multiple ways to map it out but no luck

api.waqi.info/feed/lucknow/?token=fa73462a52dbbb8848d20a0554fb72424af90975

GE1.png

GE2.pngGE3.png

0 Kudos
Gene_Sipes
New Contributor III

Hi @RipaliBatra,

 

Try changing the group cardinality from many to one? 

Gene_Sipes_1-1713966829785.png

 

0 Kudos