hmpf / easydmp

MIT License
7 stars 2 forks source link

Is it possible to query the questions belonging to a template? #154

Closed adilhasan closed 3 years ago

adilhasan commented 3 years ago

Hello, I would like to get the list of questions belonging to a given template. I thought that I could do:

curl "https://easydmp.sigma2.no/api/v1/questions/?template=63"

but, it seems to silently ignore the arguments. Is it possible to get the list of questions for a given template, or it's not something that's not supported. Many thanks, adil

vbhavdal commented 3 years ago

@adilhasan Looks like it needs to be ?section__template=63, does that work? Using the Filters menu in the web UI yields that.

adilhasan commented 3 years ago

Sorry for getting back to you so late on this. No, it gives me the same results as 'template'.

vbhavdal commented 3 years ago

Maybe you missed the double underscores? This URL filters on template:

https://easydmp.sigma2.no/api/v1/questions/?section__template=63

adilhasan commented 3 years ago

Ah ha! Yes, you are right. It's double underscore and not single one. Thanks! We can close this issue then