API

Summary

  • APIs are datasets designed and shared from the DataChain platform

  • They contain a set of information (metadata) in addition to the dataset

  • All published APIs from DataChain that a user has access to are visible in the Marketplace

  • It is possible to build queries and test APIs from the Marketplace

  • An API key is required to consume APIs outside the Marketplace

Introduction

All APIs available in the DataChain Marketplace come directly from datasets created, managed and shared via the DataChain platform.
This mechanism not only guarantees complete traceability, but also secure and controlled access to data at every stage of its lifecycle, from creation to final consumption within applications.
DataChain thus acts as a centralised and reliable ecosystem, ensuring the integrity and compliance of the information made available, while facilitating the discovery and integration of these APIs by consumers outside DataChain. == Building queries and testing APIs

The Marketplace allows you to build queries and test APIs quickly and easily, then use them outside the DataChain ecosystem.

Within DataChain

You can view metadata and all information related to the API from its detail page.
You can build queries using the form to generate the URL and then preview the results in REST or OData formats.

Outside DataChain

APIs can be used outside DataChain.
To do this, you must enter a valid authentication token in a header of type Authorisation: Bearer {TOKEN}.

See user account management page for more information.

Query syntax and operators

You must follow DataChain syntax to build queries and query APIs.

Example of a query to the exposure API

https://monModule/dmarketplace-datachain-api/version/data/exposition?select=id,nom&filter=nom=beginsWith=A

Query syntax

Syntax

Description

Mandatory?

http://…​../service/data/

Base access URL

YES

exposure?

Name of the access point assigned when configuring the API at the DataBlock level

YES

select=

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

filter=

Filters based on defined filter parameters
Example: filter=name=beginsWith=A
Learn more about [filter syntax].

page=

Specifies the page returned. By default, this is page 1
Example: page=5

hitsPerPage=

Indicates the number of lines per page
Example: hitsPerPage=50

useCache=

Indicates whether the cache (persistence) is used or not
Example: useCache=true

sort=

Sorting according to defined parameters
Example: sort=name:desc

ctx:

Indicates the context of the instance used
Example: ctx:0

&

Character to be added between each filter
Example: sort=ipp:asc,name:desc&hitsPerPage=50