Central API docs - example submission XML issue

1. What is the issue? Please be detailed.

Let me start by saying it's possible I'm doing it all wrong. However:

The example request XML body for creating/updating submissions (docs link, source link) seems to be invalid for creating new submissions:

<data id="simple">
  <orx:meta>
    <orx:deprecatedID>uuid:315c2f74-c8fc-4606-ae3f-22f8983e441e</orx:deprecatedID>
    <orx:instanceID>uuid:85cb9aff-005e-4edd-9739-dc9c1a829c44</orx:instanceID>
  </orx:meta>
  <name>Alice</name>
  <age>36</age>
</data>

2. What steps can we take to reproduce this issue?

  1. Use the above as a template, changing the id attribute to a real xmlFormId, and removing the deprecatedID line.
  2. Try to POST the above to projects/:projectId/forms/:xmlFormId/submissions
  3. Receive a HTTP 404 error, "Could not find the resource you were looking for."

3. What have you tried to fix the issue?

Use something more like the below, where the form version attribute is specified, and the orx namespace prefixes are removed. It don't think it helped to define the orx namespace in the data element.

<data id="simple" version="2021042001">
  <meta>
    <instanceID>uuid:85cb9aff-005e-4edd-9739-dc9c1a829c44</instanceID>
  </meta>
  <name>Alice</name>
  <age>36</age>
</data>
1 Like

Hi @Lindsay_Stevens_Au! I think you're right about the version attribute. That attribute isn't required, but if it isn't specified, it defaults to a blank string. That means that Central will look for a version of the form whose version string is blank — and if it doesn't find one, it will return the error message you saw.

I wonder if Central could provide a more informative error message in that case: something that makes it clear that the URL is fine, but the combination of project ID + xmlFormId + form version string doesn't exist. Do you think that that'd be helpful?

Also, at least right now, Central doesn't require submission XML to use the orx namespace. But using the namespace also shouldn't cause any issues.

1 Like

Hi Matthew! Thanks for your reply. Yep it seems to work with or without the orx namespace on the meta element names. I meant that one of the things I tried was to define it. But the version issue makes sense.

I think the error message could be more specific, I thought for a while there that I had the URL wrong or the endpoint had been recently deprecated. Something like "Could not find a form and version for the submission". And/or put the version as a query parameter as a default for all submissions in the provided XML, and to make it clearer that it's an key part of a valid request.

1 Like

Thanks for bringing this up. I just ran into it trying to troubleshoot a user-reported problem and probably would have wasted a bunch of time figuring out the 404 if your post hadn't been on my mind.

In my case I put the latest version of the user's form on my test server and tried to send in a submission they'd given me. The submission was made from a different version of the form so I got a 404. Looking forward to this improvement!

1 Like