Consuming Datachain OData API
Get the list of Exposures available to the signed-in user
Datachain Marketplace provides an OData API that allows you to obtain Exposure metadata (information identical to what is displayed in the MarketPlace interface).
This API is available at the URL:
https://VOTRE_URL_MARKETPLACE/dmp-api/odata/Datachain/Expositions
and returns the following information about the Exposures.
| Key | Description |
|---|---|
Title |
Exposure name |
ODataUrl |
OData URL |
Details |
Exposure description |
Keywords |
Associated keywords |
UpdateDate |
Last update date |
Columns |
Table describing the columns |
Columns[].alias |
Column alias |
Columns[].description |
Description |
Columns[].Type |
Column OData type |
Columns[].filter |
Indicates whether a filter can be applied to this column |
Columns[].islist |
Indicates whether this is a list-type column |
Note: The same information can also be found in the annotations of the metadata URL for Exposures linked to the same root:
https://VOTRE_URL_MARKETPLACE/dmp-api/odata/<racine>/?metadata
Get data from an Exposure
The OData API complies with the OData V4 protocol, implementing a subset of the available operators. More information on OData V4: https://www.odata.org/documentation/
https://VOTRE_URL_MARKETPLACE/dmp-api/odata/<racine>/<exposition>
OData query syntaxes and operators
| Syntax | Description | Required? |
|---|---|---|
Base access URL |
||
<racine>/<exposition> |
Name of the endpoint assigned when configuring the API |
|
$select= |
Selects the columns to return in the response. |
|
$filter= |
Filters according to the defined filter parameters |
|
$skip= |
Indicates the number of results to skip |
|
$top= |
Indicates the number of rows per page |
|
$orderby= |
Sorts according to the defined parameters |
| Operator | Syntax | Accepted types | Example |
|---|---|---|---|
And |
and |
Other operators |
(nom eq 'DURAND' or prenom eq 'Pierre' ) |
Or |
or |
Other operators |
(nom eq 'DURAND' or nom eq 'DUPONT' ) |
Negation |
not |
String, Numeric, Boolean, Date |
not (nom in ('DURAND','DUPONT')) |
Equal |
eq |
String, Numeric, Boolean, Date |
nom eq 'DURAND' |
Not equal |
ne |
String, Numeric, Boolean, Date |
nom ne 'DURAND' |
Greater than |
gt |
Numeric, Date |
number gt 10 |
Greater than or equal |
ge |
Numeric, Date |
number ge 10 |
Less than |
lt |
Numeric, Date |
number lt 10 |
Less than or equal |
le |
Numeric, Date |
number le 10 |
In list |
in |
String, Numeric, Boolean, Date |
nom in ('DURAND','DUPONT') |
Contains |
contains() |
String |
contains (nom,'DU') |
Starts with |
startswith() |
String |
startswith (nom,'DU') |
Ends with |
endsWith() |
String |
endsWith (nom,'DU') |
Is null |
eq null |
All |
nom eq null |
Mapping of Datachain types to OData types.
| Datachain type | OData type |
|---|---|
Boolean / Boolean |
Boolean |
Decimal / Decimal |
Boolean |
Integer / Integer |
Int32 |
Big integer / Big Integer |
Int64 |
String / String |
String |
Date / Date |
DateTimeOffset |
Date / Date |
DateTimeOffset |
List(Type) / List(Type) |
Collection(Type) |