Skip to content

Exemple pour DataSource LF (mb20)

Exemple de récupération des valeurs des variables mb20/d2000020, d'une variable calculé multipliant par 2 la variable mb20/d2000020, en utilisant un context filtrant les valeurs de mb20/d2000020 entre 889 et 890 et sur période allant de .

Parameters

  • URL : https://api.mybraincube.com/braincube/demo/braindata/mb20/LF
  • Method : POST
  • Accept : application/json
  • Content-Type : application/json
  • Body :
{
    "order":"mb20/d2000001",
    "definitions" : ["mb20/d2000001", 
                     "mb20/d2000020",
                     {
                        "id" : "d2000020 * 2",
                        "type" : "NUMERIC",
                        "context" : {
                            "dataSource" : "mb20"
                        },
                        "formula" : {
                            "MULT" : [ "mb20/d2000020", 2.0 ]
                        }
                     }
                    ],
    "context": {
        "dataSource" : "mb20",
        "filter" : { "AND" : [
            { "BETWEEN" : ["mb20/d2000020", 889.0, 890] },
            { "BETWEEN" : ["mb20/d2000001", "20160326_152000", "20160414_103000"] }
        ]}
    }
}

Result

{
  "datadefs": [
    {
      "id": "mb20/d2000001",
      "type": "DATETIME",
      "data": [
        "20160326_152000",
        "20160326_153000",
        "20160401_042000",
        "20160402_113000",
        "20160402_120000",
        "20160402_134000",
        "20160414_012000",
        "20160414_091000",
        "20160414_103000"
      ]
    },
    {
      "id": "mb20/d2000020",
      "type": "NUMERIC",
      "data": [
        "890.0",
        "890.0",
        "889.0",
        "889.0",
        "889.0",
        "889.0",
        "890.0",
        "889.0",
        "889.0"
      ]
    },
    {
      "id": "d2000020 * 2",
      "type": "NUMERIC",
      "data": [
        "1780.0",
        "1780.0",
        "1778.0",
        "1778.0",
        "1778.0",
        "1778.0",
        "1780.0",
        "1778.0",
        "1778.0"
      ]
    }
  ]
}

Live testing.

  • Url de test : Live testing.
  • datasource : mb20
  • frequency : LF
  • Accept : application/json
  • Content-Type : application/json
  • body :
{
    "order":"mb20/d2000001",
    "definitions" : ["mb20/d2000001", 
                     "mb20/d2000020",
                     {
                        "id" : "d2000020 * 2",
                        "type" : "NUMERIC",
                        "context" : {
                            "dataSource" : "mb20"
                        },
                        "formula" : {
                            "MULT" : [ "mb20/d2000020", 2.0 ]
                        }
                     }
                    ],
    "context": {
        "dataSource" : "mb20",
        "filter" : { "AND" : [
            { "BETWEEN" : ["mb20/d2000020", 889.0, 890] },
            { "BETWEEN" : ["mb20/d2000001", "20160326_152000", "20160414_103000"] }
        ]}
    }
}