Question regarding REST services

Posted by bheavican on 10-Dec-2014 09:18

In Rollbase Mobile I have created two REST services that call back to Rollbase.  The first is to the login REST method.  This method returns JSON formatted as I would have expected.  The second call then is to the selectQuery REST method.  This method returns JSON in an unfamiliar format.  Is that correct?  How would I map the result set to a list?

See attached.

Posted by matman on 10-Dec-2014 09:23

Hi bheavican,

The second output is a JavaScript array. In JavaScript you could interpret this result as var newArray = [QueryResult]; . To interpret it in another language you must convert this textual array to that language.

All Replies

Posted by matman on 10-Dec-2014 09:23

Hi bheavican,

The second output is a JavaScript array. In JavaScript you could interpret this result as var newArray = [QueryResult]; . To interpret it in another language you must convert this textual array to that language.

Posted by bheavican on 10-Dec-2014 09:26

Sorry, I didn't scroll down far enough in the documentation.  

Output example in JSON:

[

[ 131227, "Bill", "Smith" ],

[ 131228, "John", "Roth" ]

]

Thanks for the clarification matman.

Posted by matman on 10-Dec-2014 09:30

Glad I could help :) That output isn't JSON nor XML, so I hope this could be registered as a defect? (@Rollbase)

Posted by Santosh Patel on 11-Dec-2014 05:33

Agreed the output for selectQuery JSON is not truly JSON but we fear, correcting the format will result in integrations breaking for a lot of customers.

We have noted this and will most probably come out with a new API that gives back true JSON.

Posted by bheavican on 11-Dec-2014 07:58

Thanks Santosh.  For now it may be helpful to publish a best practice for mapping the data returned in the current format to items on a mobile page.

Posted by Santosh Patel on 12-Dec-2014 06:16

Can you check if this doc helps? community.progress.com/.../1133.aspx

This thread is closed