About OData

OData is a protocol for the creation and consumption of RESTful APIs and can efficiently retrieve data from any data system that supports the OData protocol. In WorkZone, OData is a data service layer that represents the data model and is used to communicate with the WorkZone database. The WorkZone OData services is built on Microsoft’s WCF data services framework and is used for Create-Read-Update-Delete operations on the entity which is exposed with the data model.

Tip: You can use Telerik Fiddler (a 3rd party product) to troubleshoot OData errors and behavior.

OData contains a standard API which permits interaction with the database from:

  • Server-side code (with an OData service reference)
  • Client-side code (with a URL to an OData endpoint + register)
  • Directly in the web-browser (with a URL to an OData endpoint + register)

The OData API can be used to build queries with the following query parameters:

  • $filter
  • $expand
  • $select

For example:

  • Query the general entity set : http://<WorkZone URL>/odata/Contacts
  • Query a specific entity instance: http:// <WorkZone URL>/odata/Contacts?$filter=ID eq '1'&$select=*

The OData provider

The WorkZone Services OData API enables you to search for, update and create any item that you have permission to access using the query syntax and formats in the Open Data Protocol.

OData is the protocol used by our OData provider, which is built on top of the Microsoft WCF Data Services framework. The Microsoft WCF Data Services framework also contains a client side framework that enables you to write .net code against any OData provider. The protocol and framework itself are documented on odata.org and MSDN.

The following is specific to our WorkZone Service OData provider.

Top level collections

All entities defined in WorkZone’s data dictionary are exposed through the OData API.

The main resources are Files (Cases), Records, Documents and Contacts.

Resource type Path Expands Common Fields

Contact

/Contacts

 

 

File

/Files

 

 

Record

/Records

 

 

Complex Types

  • Permission.Permission
  • Permission.Read
  • Permission.Write
  • Permission.ChangePermissions.

See Also

The OData protocol

MSDN WCF Data Services 5.6 documentation

WCF Data Services/OData Team Blog

WCF Data Services Forum