You need to sign in to do that
Don't have an account?
Guna P 3
How to retrieve all contacts with paging through REST api?
I want to retrieve all contacts with paging support. Such that my organizaion has 7000 contacts, I need to read 100 contcats per api call with paging support. How to accomplish this using SSQL through REST API?
I'm using this api:
https://ap5.salesforce.com/services/data/v42.0/query?q=SELECT Id,FirstName,LastName FROM Contact
Same paging support need for all the modules: leads, accounts, notes, events and tasks etc.
Thanks,
Guna.
I'm using this api:
https://ap5.salesforce.com/services/data/v42.0/query?q=SELECT Id,FirstName,LastName FROM Contact
Same paging support need for all the modules: leads, accounts, notes, events and tasks etc.
Thanks,
Guna.
If the initial query returns only part of the results, the end of the response will contain a field called nextRecordsUrl
Please review this link - https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_query.htm
Select * from Contact gives a MALFORMAED Querry error.
PS: I want the data and not meta data.
Since we cannot use Select * in SOQL, I built something similar in my Apex class using the schema class for case object.
DescribeSObjectResult describeResult = Case.getSObjectType().getDescribe();
List<String> fieldNames = new List<String>( describeResult.fields.getMap().keySet() );
String query = ' SELECT ' + String.join( fieldNames, ',' ) + ' FROM ' + describeResult.getName() + ' Limit 5000' ;
// return generic list of sobjects or typecast to expected type
List<SObject> records = Database.query( query );
Hope this helps.