Submissions and Responses


In the Mobenzi console, when a form is uploaded, a Submission entity is created. Linked to the submission entity are the individual values corresponding to each field in the form (survey). Each value is stored in a Response entity.



Editing a Response


Using the Mobenzi API, you are able to update (modify) individual Responses (using their globally unique identifier or GUID). The user account being used to authenticate must have the "Modify Responses" permission in the relevant project.


To edit a Response, you would issue an HTTP POST request to the https://console.mobenzi.com/secure/api.svc/EditResponse endpoint. The following POST parameters are available:

  • responseId [Required] - Response's globally unique identifier or GUID (see how to retrieve data using the API)
  • data [Required] - The new value (this will overwrite the existing value)
  • comment [Optional] - A comment which will be saved along with the edit to the audit history

The following Node.js code sample demonstrates how you would update a Response with ID '<RESPONSE_ID>' to store the value '<RESPONSE_VALUE>' with the comment '<AUDIT_COMMENT>' using the axios package.


// Common node package includes
const axios = require("axios"); //axios is a common HTTP client for the browser and node.js
const FormData = require('form-data'); // formdata is available in the browser by default or from NPM at https://www.npmjs.com/package/formdata-node

// Specify the credentials of the user who will be making the API requests.
// Note: the user must have "Modify Responses" permission to the relevant project.
var config = {
    auth: {
        username: 'api@yourdomain.com',
        password: 'apiuserpassword'
    }
};

// Prepare your request data
var url = "https://console.mobenzi.com/secure/api.svc/EditResponse";  
let formData = new FormData();
formData.append("responseId", "<RESPONSE_ID>"); // The GUID for the Response you wish to update.
formData.append("data", "<RESPONSE_VALUE>"); // The value you wish to update the Response to
formData.append("comment", "<AUDIT_COMMENT>"); // A comment for the audit log
config.headers = formData.getHeaders();

// Use axios to issue the HTTP request (note: your code should add error checking on the response and handle appropriately.
axios.post(url, formData, config).then(result => {
    console.log(result.data);
}).catch(error => {
    console.log(error);
});  



Note: no validation of the modified value is performed. Updating a Response value with invalid data can lead to data integrity problems (e.g. response to a choice field that does not link to any of the available options). As with modifications made via the console however, any changes are logged.


Deleting a Submission

The user account being used to authenticate must have the "Delete Submissions" permission in the relevant project. 

Note: deleting a Submission is permanent and cannot be undone.

To delete a Submission, you would issue an HTTP POST request to the https://console.mobenzi.com/secure/api.svc/DeleteSubmission endpoint. The following POST parameters are available:


The following Node.js code sample demonstrates how you would delete a Submission with ID <SUBMISSION_ID>.

// Common node package includes
const axios = require("axios"); //axios is a common HTTP client for the browser and node.js
const FormData = require('form-data'); // formdata is available in the browser by default or from NPM at https://www.npmjs.com/package/formdata-node

// Specify the credentials of the user who will be making the API requests.
// Note: the user must have "Modify Responses" permission to the relevant project.
var config = {
    auth : {
        username: 'api@yourdomain.com',
        password: 'apiuserpassword'
    }
};

// Prepare your request data
var url = "https://console.mobenzi.com/secure/api.svc/DeleteSubmission";  
let formData = new FormData();
formData.append("submissionId", '<SUBMISSION_ID>'); // This is the GUID for the Submission you wish to delete.
config.headers = formData.getHeaders();

// Use axios to issue the HTTP request (note: your code should add error checking on the response and handle appropriately.
axios.post(url, formData, config).then(result => {
    console.log(result.data);
}).catch(error => {
    console.log(error);
});