Forum Discussion
keetaya80
Jan 08, 2019Brass Contributor
SharePoint Online List querying with "app only" API: XML output vs JSON Output
Hi
We have created a new list in a modern site. This list contain a rich-text column containing string values with encoded characters like <, >. Then we try to query with "app only" API like below.
https://Sample.com/sites/ThanujaSite/_api/web/lists/getbytitle('SampleList')/items
if the XML out put is targeted, then the output coming would look like < and > for the characters mentioned above which is not usable for us. However if we target JSON output, characters retrieves properly. But we need the XML output since it is to be feed on to another application for processing; and re-creating that app to accept JSON is more work for us.
we would like to know, if this is a limitation in SP Online now?
NOTE: graph API is not used because it always provide JSON output not the XML output. So using Graph API is a blocker for this requirement.
Any help appreciated
- NotAlexIron Contributor
XML will encode those characters otherwise it could mess up the output.
You could decode the output of that after the fact with a html.decode for whatever language you are using :)
- keetaya80Brass ContributorNotAlex If I understood correctly, you suggest that we take the XML output with >, < etc then use decoding at the receiver module to get the >, < values, correct?However, do you have any information why this output retrieves this way? Is it limitation with Office 365 as when we query the same in our old 2010 on-premise list it works perfectlyTo note, when we request for JSON output with below GET request, it retrieves proper output (with values >,< etc)ThanksThanuja