How to query mriqc ratings for a given md5sum

I’ve run mriqc and manually rated an epi on the html output. I want to read that rating back without the report id. I’m trying to use the md5sum like
report?where='{ "provedance.md5sum": 60a7cc96bc7d16048b827888bf762b54 }' (with url encoding)

  1. run mriqc (docker, version 22.0.1)
  2. open html report in browser
  3. rate and submit while monitoring network
  4. capture response from API
_updated	"Wed, 18 Jan 2023 17:45:21 GMT"
_created	"Wed, 18 Jan 2023 17:45:21 GMT"
_etag	"843b6a4b420a46dd4b3ceb7daf10f567bf785717"
_id	"63c83031799c95b5713f5d09"

Now I’d like to get back the rating. It’s easy if I know the report _id:

 curl -sG https://mriqc.nimh.nih.gov/api/v1/rating/63c83031799c95b5713f5d09 | jq

{
  "_id": "63c83031799c95b5713f5d09",
  "rating": "2",
  "md5sum": "60a7cc96bc7d16048b827888bf762b54",
  "name": "",
  "comment": "[\"head-motion\",\"ghost-aliasing\",\"inu\"]",
  "_updated": "Wed, 18 Jan 2023 17:45:21 GMT",
  "_created": "Wed, 18 Jan 2023 17:45:21 GMT",
  "_etag": "843b6a4b420a46dd4b3ceb7daf10f567bf785717",
  "_links": {
    "self": {
      "title": "Rating",
      "href": "rating/63c83031799c95b5713f5d09"
    },
    "parent": {
      "title": "home",
      "href": "/"
    },
    "collection": {
      "title": "rating",
      "href": "rating"
    }
  }
}

But I want to grab ratings without recording the report id for each submission. I can get the md5sum from the html output (and it matches the report id). But I dont’ know the syntax for using it to query the api

perl -nE 'print "$1" if m/md5sum.*"(.*)"/' sub-xxxx_ses-yyy_task-rest_run-01_bold.html
# 60a7cc96bc7d16048b827888bf762b54

jq -SRr @uri <<< "{ provedance.md5sum: 60a7cc96bc7d16048b827888bf762b54 }"
# %7B%20provedance.md5sum%3A%2060a7cc96bc7d16048b827888bf762b54%20%7D



curl -sG "https://mriqc.nimh.nih.gov/api/v1/rating?where=%7B%20provedance.md5sum%3A%2060a7cc96bc7d16048b827888bf762b54%20%7D"
{
  "_status": "ERR",
  "_error": {
    "code": 400,
    "message": "The browser (or proxy) sent a request that this server could not understand."
  }
}

# using double quotes does a little better!
# but no results
curl -Gs https://mriqc.nimh.nih.gov/api/v1/rating --data-urlencode 'where={ "provedance.md5sum": "60a7cc96bc7d16048b827888bf762b54" }' |jq

{
  "_items": [],
  "_links": {
    "parent": {
      "title": "home",
      "href": "/"
    },
    "self": {
      "title": "rating",
      "href": "rating"
    }
  },
  "_meta": {
    "page": 1,
    "max_results": 25,
    "total": 0
  }
}

needed double quotes and md5sum not provedance.md5sum:

html_out=sub-xxx_ses-yyy_task-rest_run-01_bold.html
perl -nE 'print "$1" if m/md5sum.*"(.*)"/' $html_out | 
  xargs -I{} curl -Gs https://mriqc.nimh.nih.gov/api/v1/rating --data-urlencode 'where={ "md5sum": "{}" }'| 
  jq -r '._items[]|[._updated, .rating, .comment]|@tsv'

Wed, 18 Jan 2023 17:35:44 GMT   2       ["head-motion","ghost-aliasing","inu"]
Wed, 18 Jan 2023 17:37:13 GMT   2       ["head-motion","ghost-aliasing","inu"]