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/legacy/api-reference-qb.md.
  • πŸ‡¬πŸ‡§ English
  • API Reference: Query Builder / Analytics Manager

    Warning

    This page describes the ForePaaS Legacy Platform, which no longer accepts new signups. If you are using OVHcloud Data Platform, see the Analytics Manager.

    This page contains the API reference for the Query Builder, now replaced by the Analytics Manager.

    ?>Β Like all other ForePaaS endpoints, these endpoints requires you to have an authentication token from the IAM of the Project you are trying to access. To obtain an authentication token, please follow this subsection.
    Make sure you also have corresponding permissions in service Query Builder Legacy (in IAM).


    Query endpoint

    Description

    Endpoint

    • POST /qb/query

    Query Parameters

    Parameter namerequiredexampledescription
    data.fieldsyes{ "income":["sum"],"expense":["sum"]}Fields to return and their compute mode(s) (can be: select, select_distinct, sum, min, max, avg, count, count_distinct)
    data.skipno10Number of rows to skip
    data.limitno100Number of rows returned
    data.hintsnotrue/falseTotal number of lines corresponding to the query (omitting data.limit)
    filterno{ "date": { "between": ["1420066800", "1428962399"] }, "client_code": { "in": ["08KD", "09CC"] }, "creation_date": { "eq": ["2018-01-01"] }}Apply filter(s) on the data to query. Filters can be: in, not_in, between, not_between, eq, not_equal, like, not_like, is_null, is_not_null, gt (>), gte (>=), lt (<), lte (<=)
    scale.fieldsno["date",["client_code", "employee_id"]]Apply scale (group by) to the query. It can be a computed scale, or more than 1 scale.
    evol.scaleno"year"scale to apply for evolution (weekday;week; month; quarter; semester; year)
    evol.modeno"date""weekday"date : comparison with same dateweekday : comparison with respecting the same weekday.
    evol.depthno5How much evolutions you want to get back
    total.allno[]["client_code"]total queries per distinct scales (optional)
    total.xno["client_code"]Total queries for a specific attribute
    orderno{ "date":"asc"}order query output (asc or desc, asc by default)
    table_nameno"prim_vehicles"Force to query in a specific table
    database_nameno"data_prim""data_mart"Force to query in a specific layer

    Sample query, request body

    {
      "data": {
        "fields": {
          "a": ["sum"],
          "b": ["sum", "avg"]
        },
        "skip": 10,
        "limit": 10
      },
      "filter": {
        "h": {
          "between": ["1420066800,1428962399"]
        },
        "c": {
          "in": [1, 2, 3]
        },
        "g": {
          "eq": [1]
        },
        "x": {
          "is_null": []
        }
      },
      "scale": {
        "fields": ["d", ["e", "f"]]
      },
      "evol": {
        "scale": "year",
        "mode": "date",
        "depth": 5
      },
      "total": {
        "all": [],
        "x": ["d"]
      },
      "order": { //order module to order query output (asc or desc, asc by default)
        "c": "asc"
      },
      "table_name": "TABLE_NAME" //force table_name for the query
    }

    Sample query, response

    CodeDescription
    200JSON object
    {
        "success": true,
        "timestamp": 1435936140,
        "duration": 0.09,
        "error": null,
        "warning": null,
        "query_params": {…}, //recap of the executed query
        "results": [  //results of the query      
            {
                "data": {
                    "a": {
                        "sum": [
                            {
                                "month": 1,
                                "team": "Team Rocket",
                                "value": 10300
                            },
                            {
                                "month ": null,
                                "team": null,
                                "value": null
                            }
                        ]
                    }1
                },
                "scales": {
                    "month_date_fact": 1,
                    "team": "Team Rocket"
                }
            }
        ],
        "total": { //results for each total provided by the query
            "all": [{…}]        
        }
    }

    Dataset endpoint

    Warning

    This feature is from the legacy Query Builder and will soon be deprecated. Please check out the Analytics Manager and Lakehouse Manager instead.

    Description

    • Returns the dataset from the Query Builder.

    Endpoint

    • GET /qb/dataset

    Responses

    CodeDescription
    200JSON object
    
    {
        "success": true,
        "timestamp": 1435934914,
        "duration": 0.002,
        "data": { //list of available data and the compute mode
            "a": {
                "computes": ["sum"],
                "default": "sum"        
            }
        },
        "compute_mods": [ //list of available compute mode
            …
        ],
        "orders": [ //list of available fields for sorting queries
            …
        ],
        "filters": [ //list of available fields for filtering queries
            …
        ],
        "scales": [ //list of available fields for grouping queries
            …
        ],
        "evol": [ //list of available evolution mode
            …
        ],
        "dictionnary": { //The data dictionary for reporting
            …
        }
    }