Error when running evalMetrics API on OutbreakLocation

Viewed 251

I’m trying to hit the https://api.c3.ai/covid/api/1/outbreaklocation/evalmetrics API endpoint with a request body that looks like the following.

{
  "ids": ["Hubei_China"],
  "expressions":[
   "ConfirmedDeathsJHU"
  ],
  "interval":"DAY",
  "start":"2020-03-01",
  "end":"2020-03-30"
}

However, I get the error: Invalid argument name "ids" for function OutbreakLocation.evalMetrics at JSON document at 2:11

Any idea what could be wrong?

1 Answers

The request body of your API call looks correct, but you need to wrap it around a spec key like this:

{
  "spec": {
      "ids": ["Hubei_China"],
      "expressions":[
       "JHU_ConfirmedDeaths"
      ],
      "interval":"DAY",
      "start":"2020-03-01",
      "end":"2020-03-30"
    }
}
Related