DataONEorg / metrics-service

An efficient database and REST API for delivering aggregated data set metrics to clients.
Apache License 2.0
2 stars 1 forks source link

Update Metrics Service request object to add support for Portals #59

Open rushirajnenuji opened 4 years ago

rushirajnenuji commented 4 years ago

Update MS request object to add support for Portals

rushirajnenuji commented 4 years ago

During the meeting Portals Infrastructure development meeting on Monday (09/30/2019) - it was decided that the filter object will have the attribute name portal and the value would be the label of that portal.

A sample request object with the portal filter would look like this:

{
    "metricsPage": {
      "total": 0,
      "start": 0,
      "count": 0
    },
    "metrics": [
      "citations",
      "downloads",
      "views"
    ],
    "filterBy": [
      {
        "filterType": "portal",
        "values": ["SASAP"],
        "interpretAs": "list"
      },
      {
            "filterType": "month",
            "values": [
                "07/01/2012",
                "10/03/2019"
            ],
            "interpretAs": "range"
        }
    ],
    "groupBy": [
      "month"
    ]
}