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.

API - 1. Information
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/

Example of a request to the OData Exposure API
https://VOTRE_URL_MARKETPLACE/dmp-api/odata/<racine>/<exposition>

OData query syntaxes and operators

API - 2. Query syntaxes
Syntax Description Required?

http://VOTRE_URL_MARKETPLACE/dmp-api/odata/

Base access URL

check

<racine>/<exposition>

Name of the endpoint assigned when configuring the API

check

$select=

Selects the columns to return in the response.
If this section is not specified, all exposed columns are returned.

$filter=

Filters according to the defined filter parameters
Example: filter=nom=beginsWith=A
The filter syntax is shown in the following table.

$skip=

Indicates the number of results to skip
Example: $skip=250

$top=

Indicates the number of rows per page
Example: $top=50

$orderby=

Sorts according to the defined parameters
Example: $orderby=nom desc

API - 3. Convention / Operators
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.

API - 4. Type mapping
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)