ODK Api download submission return 400

I try to get and api from odk aggregate using this :
GET /view/downloadSubmission?formId=my_odk_form[@version=null and @uiVersion=null]/data[@key=uuid:38fd4ef4-28b9-441e-a818-dd8cbe514b2c]

but it always return 400

is there any idea why it always return 400?

there is no error log , in tomcat log.

I delpoyed odk 1.7.1, in aws , under centos 7/

I tried to check version of from , in its null.

Hi, @Dimas_Djs.

An HTTP 400 means that the data you're sending is somehow wrong.

I've checked the requests Briefcase sends:

I think you need to url-encode the value of the formId query string param's value.

From my example:

  • url-encoded value choice-lists%5B%40version%3Dnull+and+%40uiVersion%3Dnull%5D%2Fdata%5B%40key%3Duuid%3A4099b62e-a405-47e5-bd57-8f31e9ae80ad%5D
  • decoded value choice-lists[@version=null and @uiVersion=null]/data[@key=uuid:4099b62e-a405-47e5-bd57-8f31e9ae80ad]
1 Like

Hi mr.ggalmazor

Thank you for your explanation sir.

So did i get a wrong url , so the ODK return 400?

do i have to execute the url encoded in browser, or di decode ?

Thanks before sir.


@Dimas_Djs You are correct that you've probably got the wrong (or rather improperly encoded) URL. Whatever programming language you are using to send that request to Aggregate has a way to url encode the URL before you send it.

1 Like