Skip to content

Exploring OData

Overview

OData RESTful APIs are easy to consume. The OData metadata, a machine readable description of the data model of the APIs, enables the creation of powerful generic client proxies and tools. Some of them can help you interact with OData even without knowing anything about the protocol.

If you want to have a quick look at the protocol, here are some examples of how to use the OData protocol using simple http requests.

The following tools are good to explore the OData protocol:

Note: The URLs below are not properly URL-encoded for readability purposes. This needs to be done manually or through a tool like Postman or similar.

Get all Branches

GET https://mydomain.com/odata/Branches HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0

Get two Branches

GET https://mydomain.com/odata/Branches?$top=2 HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0

Get a specific Branch

GET https://mydomain.com/odata/Branches?$filter=Branch eq 'Lone Tree' HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0

Get a Visit Transaction with waiting time over 10 minutes in a specific Branch

GET https://mydomain.com/odata/VisitTransactions?$filter=BranchKey eq 4 and WaitingTime gt 6000 HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0

Get Services ordered by name

GET https://mydomain.com/odata/Services?$orderby=Service asc HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0

Get the 10 last Visit Transactions

GET https://mydomain.com/odata/VisitTransactions?$orderby=EnteredQueueTimeKey asc&$top=10 HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0