function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MaxFrielMaxFriel 

REST Api return in XML...

I am trying to query using the REST api.  If the result is under 2000 records it works great here is what I use...

https://na10.salesforce.com/services/data/v22.0/query.xml?q=SELECT+id+FROM+Message_vod__c

 

Then I add the session Id to the header and I am good to go.  If the query is over two thousand records the nextRecordsUrl is returned and then I will proceed to call something like this...

https://na10.salesforce.com/services/data/v22.0/query/01gF000000CNh00IAD-2000

 

Problem is that this is now returned via JSON rather than XML.  How do I get that next set of records in XML?  I tried changing the URL to...

https://na10.salesforce.com/services/data/v22.0/query.xml/01gF000000CNh00IAD-2000

with no luck.  Any thoughts?

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell

https://na10.salesforce.com/services/data/v22.0/query/01gF000000CNh00IAD-2000.xml

 

or set the Accept htttp header in your request (Accept: application/xml), which i would generally recommend over using the .xml extension.

All Answers

SuperfellSuperfell

https://na10.salesforce.com/services/data/v22.0/query/01gF000000CNh00IAD-2000.xml

 

or set the Accept htttp header in your request (Accept: application/xml), which i would generally recommend over using the .xml extension.

This was selected as the best answer
MaxFrielMaxFriel

Works perfectly, thanks a lot!!