For AI agents: the complete documentation index is available at https://docs.dataplatform.ovh.net/llms.txt, the full documentation bundle is available at https://docs.dataplatform.ovh.net/llms-full.txt, and this page is available as Markdown at https://docs.dataplatform.ovh.net/sdk/api-queries.md.
  • 🇬🇧 English
  • Handle queries

    Warning

    Rework pending, no delivery date. The Front App SDK (ReactJS) and the Front API SDK (NodeJS) are both being replaced. This page documents the current release, remains accurate, and is maintained until the replacement ships. Code written against it keeps working.

    One of the core function of the API is to handle queries to your Data Platform data system from the outside world, or from an application.

    You can add transformers to your queries to modify them on the fly, add new query endpoints, and manage the data ACL for the queries passed on to Data Platform.

    Pass on external queries Add query transformers in your API Add query endpoints in your API Add query data ACL in your API


    Pass on external queries

    Configure a web service for query execution

    Queries can be executed from an external appliance / service through configuring a Web Service. The return formats may be JSON, CSV or XLSX.

    Get credentials

    By default, in production, the API is self-authenticated to the other Project components. But when you are calling it from the outside world, you need to authenticate though the Identity Access Manager.

    The best way to do it is by getting an authentication token using API and secret key for a user (or a service account).

    Run queries via the web service

    JSON output

    curl -X POST \
      https://my-project.eu.dataplatform.ovh.net/myapi-api/qb/query?app_id=your_app_id \
      -H 'Content-Type: application/json' \
      -H 'authorization: Bearer your_token' \
      -d '{
        "data": {
          "fields": {
            "date": ["min", "max"]
          }
        }
    }'

    CSV output

    curl -X POST \
      https://my-project.eu.dataplatform.ovh.net/myapi-api/qb/query.csv?app_id=your_app_id \
      -H 'Content-Type: application/json' \
      -H 'authorization: Bearer your_token' \
      -d '{
        "data": {
          "fields": {
            "date": ["min", "max"]
          }
        }
    }'

    Note that CSV formatting may be controlled with options in the query, as for instance:

    "options":{
      "collapse": "false", 
      "scales": {
        "x": [
         {"field": "field_name_1", "type":"scale"},
         /*...*/
         {"field": "field_name_n", "type":"scale"}
        ],
        "y": [{"type": "data"}]
      }
    }

    XLSX output

    curl -X POST \
      https://my-project.eu.dataplatform.ovh.net/myapi-api/qb/query.xlsx?app_id=your_app_id \
      -H 'Content-Type: application/json' \
      -H 'authorization: Bearer your_token' \
      -d '{
        "data": {
          "fields": {
            "date": ["min", "max"]
          }
        }
    }'
    Info

    Note that using options it is possible to better control the output.

    Front API basic endpoints reference

    Here are the list of basic endpoints that comes with the default Front API.

    GET /refresh

    Flush the cache

    Responses

    CodeDescription
    200A simple success true message

    GET /qb/dataset

    Retrieves the dataset from the Analytics Manager

    Responses

    CodeDescription
    200The dataset from the Analytics Manager

    POST /qb/query

    Make a query from an Analytics Manager JSON request

    Responses

    CodeDescription
    200A result from the Analytics Manager

    GET /webstorage/{key}

    Retrieves a value for a key in the webstorage

    Parameters

    NameLocated inDescriptionRequiredSchema
    keypathYesstring

    Responses

    CodeDescription
    200The content
    404Key not found

    PUT /webstorage/{key}

    Puts a value from the body of the request to a key in the webstorage

    Parameters

    NameLocated inDescriptionRequiredSchema
    keypathYesstring

    Responses

    CodeDescription
    200The new content

    DELETE /webstorage/{key}

    Removes a value for a specific key in webstorage

    Parameters

    NameLocated inDescriptionRequiredSchema
    keypathYesstring

    Responses

    CodeDescription
    200The previous content
    404Key not found

    Go further

    If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for a custom analysis of your project.

    Ask questions, give your feedback and interact directly with the team building the Data Platform on the dedicated Discord channel.

    If you need support with your OVHcloud services, create a request in our Help Centre.

    Join our community of users.