Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
printablefalse

Form Submission API

CommCare's Submission API implements the OpenRosa standard Form Submission API for submitting XForms over HTTP/S. You can find details of the Form Submission API standard here.

...

Code Block
<OpenRosaResponse xmlns="http://openrosa.org/http/response">
    <message nature="{{nature}}">{{message}}</message>
</OpenRosaResponse>

 


It has two pieces of data. The response 'nature' and the response 'message'. The message is a human readable message while the 'nature' is intended to classify the response.

...

Response codeNatureMeaning
201
submit_success
Form was received and successfully processed
201
submit_error
Form was received but could not be processed due to some error. See 'message' for more details.
401 
Authentication failed. User not allowed to submit forms or authentication credentials incorrect.
500
submit_error

Unable to process form XML. Usually due to malformed XML

500 
Unexpected server error


Example Success Response

...

Response codeNatureMeaning
201
submit_success
Form was received and successfully processed
422
 
processing_failure

Form received but an error occurred during processing. Re-submission likely to result in the same error e.g. InvalidCaseId

Mobile device will 'quarantine' the form and set the quarantine message to the message from the response.

500
submit_error
Unable to process form XML. Usually due to malformed XML
500 
Unexpected server error

Code Example

...