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
Dev Upswot 7Dev Upswot 7 

How to get ALL objects from REST API sObject Resources

Hi ALL,
I need to get all items(records) of Products2.
According to the request, it returns an overview of Product2's metadata as well as a list of the most recently used Product2 records :  GET/services/data/v39.0/sobjects/Product2(https://developer.salesforce.com/docs/api-explorer/sobject/Product2/get-product2 ).
As I understand list of the most recently used Product2 records doesn't contain all records, so how can I get all records of Product2  or Account or any other object?
MagulanDuraipandianMagulanDuraipandian
I don't think it is possible.

You have to retrieve using Ids.

Check the below link for more information

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_sobjects_collections_retrieve.htm

You can run query to get. Check the below link for example

https://www.infallibletechie.com/2019/12/how-to-get-all-records-using-rest-api.html

--
Magulan Duraipandian
www.infallibletechie.com
Dev Upswot 7Dev Upswot 7

MagulanDuraipandian, thanks a lot.
But is there an option to get all information of the record without specified fields? Because I don't see such possibility in SOQL SELECT Syntax  (https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select.htm)  that is similar to  * (select all) in SQL.
Thank you.
MagulanDuraipandianMagulanDuraipandian
Yes. Select * is not possible with SOQL.
--
Magulan Duraipandian
www.infallibletechie.com