Passing Dynamic Key to REST API | Mobile | Outsystems

Hi,

I am using a REST API where the request is of below form:

{
  "DN8808": {    
    "lat": 12.5,
    "long": 5000
  }
}


Now If I consume this then the Request will be created with an entity name "DN8808".

My Problem is: The Key-name i.e "DN8808" is Dynamic, it can be changed anytime.


So while Submitting the Data I want to send the key as Dynamic like sometimes it might be:

{
  "DN8809": {    
    "lat": 12.5,
    "long": 5000
  }
}

or

{
  "DN8810": {    
    "lat": 12.5,
    "long": 5000
  }
}


Any Help Much Appreciated.

Thanks

Hey assif_tiger,

As you point out, the built in capabilities for OutSystems JSON structures do not account for dynamic keys.  The best way I've handled this in the past is with ardoJSON, which includes the ability to dynamically query for keys.

Let me know if you need more information on it!

Craig St.Jean wrote:

Hey assif_tiger,

As you point out, the built in capabilities for OutSystems JSON structures do not account for dynamic keys.  The best way I've handled this in the past is with ardoJSON, which includes the ability to dynamically query for keys.

Let me know if you need more information on it!

Hi Craig St.Jean,

How can I use this in Mobile?



Sorry assif_tiger, I misread.  I thought you were asking how to consume JSON data within the REST API, not how to consume a REST API in mobile with dynamic data.  I will have to defer to others in that case.

Craig St.Jean wrote:

Sorry assif_tiger, I misread.  I thought you were asking how to consume JSON data within the REST API, not how to consume a REST API in mobile with dynamic data.  I will have to defer to others in that case.

Sure No Worries - I Appreciate your  Kind help on Forum :)

That's why I asked you.. lol :)