OData
API - Application Programming Interface
2 min read
This section is 2 min read, full guide is 16 min read
Published Sep 24 2025
8
Show sections list
0
Log in to enable the "Like" button
0
Guide comments
0
Log in to enable the "Save" button
Respond to this guide
Guide Sections
Guide Comments
API
OData (Open Data Protocol) is a REST-based protocol for querying and updating data. Developed by Microsoft, it provides a standardised way to expose and consume data over the web.
OData is designed to make data sources (databases, services) easily accessible via HTTP with a consistent query language and conventions.
Key Features
- RESTful → Uses standard HTTP verbs (GET, POST, PUT, DELETE).
- Queryable → Clients can filter, sort, paginate, and select specific fields using URL query options.
- Examples:
$filter
,$select
,$orderby
,$top
,$skip
.
- Examples:
- Metadata-driven → Exposes a machine-readable entity model describing the data structure.
- Supports JSON and Atom/XML formats.
- Standardised conventions → Makes APIs predictable and interoperable.
Advantages
- Standardised querying → Clients can retrieve only the data they need.
- Interoperable → Works across platforms and languages.
- Metadata-driven → Tools can auto-generate clients.
- Supports CRUD operations → Full RESTful operations with rich query options.
Disadvantages
- Slightly heavier than plain REST due to URL query conventions.
- Can be overkill for very simple APIs.
- Limited adoption compared to vanilla REST or GraphQL.
Use Cases
- Enterprise applications (Microsoft ecosystem: Dynamics, SharePoint, Power Platform).
- Data services exposing large datasets with rich query/filtering needs.
- Scenarios where clients need dynamic querying capabilities without server changes.
Security
- Authentication methods are dependent on the underlying HTTP service.
- Common options:
- Basic Auth / API keys
- OAuth 2.0 / JWT
- Enterprise OData services often integrate with Azure AD or other identity providers.
Example OData Request
Suppose you want to get the top 5 users whose age is over 30:
GET /Users?$filter=Age gt 30&$top=5&$orderby=Name
Accept: application/json
Explanation:
$filter=Age gt 30
→ filter users with age > 30.$top=5
→ return only the first 5 results.$orderby=Name
→ sort results by name.
Example OData Response
{
"value": [
{ "Id": 1, "Name": "Alice", "Age": 35 },
{ "Id": 2, "Name": "Bob", "Age": 40 }
]
}
value
contains the list of entities returned.- Only requested or filtered fields are included if
$select
is used.