skip to main content
Querying with OData Version 2 : Formulating queries with OData Version 2 : Fetching records and collections with OData version 2

Try Now

Fetching records and collections with OData version 2

As shown in the following table, use the plural entity name with the GET method to fetch metadata, a single entity, an entity's property, or a collection of entities. When using a data source group, prepend the entity name with the appropriate data source prefix. See URI conventions for addressing resources, entities, and related entities in Section 3 of the OData specification.
To fetch:
A single record
Example: https://myserver:8080/api/odata/MySFDataSource/ACCOUNTS('1')
The value of a single field from a single record
Example: https://myserver:8080/api/odata/MySFDataSource/ACCOUNTS('1')/NAME/$value
A collection of records*
Example: https://myserver:8080/api/odata/MySFDataSource/ACCOUNTS
A count of the records in a collection
Example: https://myserver:8080/api/odata/MySFDataSource/ACCOUNTS/$count
*A single request can only fetch one collection.