skip to main content
Formulating queries : Fetching records and collections
 

Try DataDirect Cloud Now

Fetching records and collections

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:
Method:
URI:
A single record
GET
<service_root>/<data_source_name>/<entity_singlar_name>('<primary_key_value>
Example: https://service.datadirectcloud.com/api/odata/MySFDataSource/ACCOUNTS('1')
The value of a single field from a single record
GET
<service_root>/<data_source_name>/<entity_singlar_name>('<primary_key_value>/<column_name>/$value
Example: https://service.datadirectcloud.com/api/odata/MySFDataSource/ACCOUNTS('1')/NAME/$value
A collection of records*
GET
<service_root>/<data_source_name>/<entity_plural_name>
Example: https://service.datadirectcloud.com/api/odata/MySFDataSource/ACCOUNTS
A count of the records in a collection
GET
<service_root>/<data_source_name>/<entity_plural_name>/$count
Example: https://service.datadirectcloud.com/api/odata/MySFDataSource/ACCOUNTS/$count
*A single request can only fetch one collection.