Using and managing OData feeds
Overview
API versions
Please note that newer versions of this API may include pure additions to it (such as new properties on resources returned from an action, accepting these resources with or without the property inbound to the server, or adding new resources or actions), or new appearance of properties within JSON structures, because we assume that clients use forgiving, non-strict parsing on the JSON they receive from Devo.
New versions of the API will always be backward compatible, using a never remove, only add strategy. Contact us in case you have any question.
This article explains how to set up a Devo data query as an OData feed. This will allow you to stream the data to external tools like, for example, Microsoft Excel, Tableau or Power BI. Currently, Devo feeds implement OData version 2.0.
The service root URL for OData feeds depends on your Devo domain region:
EU |
|
---|---|
US |
|
CA |
|
APAC |
|
What permissions do I need?
To be able to create OData feeds in the Data Search area and mange them in the Authentication tokens tab of the Administration → Credentials area, you need to have the Manage version of the OData permission (know more about permissions here).
Having the View version will only let you see the list of existing ones in the Authentication tokens tab of the Administration → Credentials area.
Set up an OData feed
Manage feeds
All the feeds that have been created in your domain are listed in the Authentication tokens tab of the Administration → Credentials area. Check the Authentication tokens article for more information.
OData feed parameters
You can add query string parameters to the OData feed URI to specify the data you want to retrieve. These parameters can be used to, for example, control the amount and order of the data that an OData service returns for the query identified by the URI.
OData feed URIs may include as many parameters as required, which are always prefixed with a "&" character (except the $metadata
parameter).
The following table lists the supported parameters using a feed URL for a Devo domain in the USA cloud region:
| Add the Example
|
---|---|
| Add the Example
|
| Add the Example
|
| Add the
Add Example
|
| Add the Example
Note that if no timezone is specified then UTC is always used by default. In the example provided, Madrid is UTC+2 during summertime and UTC+1 during daylight savings time. |
| Add the To add this parameter to the OData feed URI, first remove the query time information at the end of the URL, then add the parameter without including the '&' character. Example
|
The following is an example of an OData feed with four different parameters:
https://api-us.devo/odatav2/Query.svc/0c6f1165-4ac8-4ca4-87df-06bede2d1f53/e59f069b5bf113da8101372f50d90b8b/query?from=2018-10-02T09:40:18.224&to=2018-10-03T09:40:00&$select=eventdate,cid&$top=10&$skip=9&$format=json
In this case, you will only receive the data in the eventdate and cid columns, as specified in the select
parameter. The top
parameter indicates that only the first 10 events will be shown and the skip
parameter will make the counting start after the first nine events. As a result, only 10 events from the event number 10 will be shown. Data will be retrieved in JSON format as indicated in the format
parameter.
See the OData documentation for further details.
Working with relative time ranges
A relative date range is a period of time that is relative to the current date (last week, last month, etc). There are some rules to consider when using the relative date ranges in OData URI:
If you run a query without
from
, the request will use [dateTo - 1h, dateTo] as time range.If you run a query without
to
, the request will use [dateFrom, now] as time range.If you run a query without
from
andto
, the request will use [now - 1h, now] as time range.If you run a query using
to
→from
, the request will use [from, now] as time range.If you run a query using
now
→from
, the request will use [now - 1h, now] as time range
See below the parameters you can add to your OData URI to apply relative date ranges.
From (defines the start date)
| Description | Examples |
---|---|---|
Relative | It retrieves the current time (day, month, hour, minutes and seconds) excluding a specified range of days/hours. The valid range dates you can use are days(d) and hours(h). | Suppose the current date is 22/08/2016 15:20:00.
|
Absolute | The only valid range date you can use is days(d). | Suppose the current date is 22/08/2016 15:20:00.
|
Specific | They are specific filters using the current date and hour, but the minutes and seconds are setup as 0. | Suppose the current date is 22/08/2016 15:20:00.
|
To (defines the end date)
| Description | Examples |
---|---|---|
Relative | The valid range dates you can use are days(d) and hours. |
|
Absolute | The only valid range dates you can use are days(d). |
|
Specific |
| Suppose the current date is 22/08/2016 15:20:00.
|
|
| |
|
|
Related articles