Skip to content

Instantly share code, notes, and snippets.

@travist
Created September 7, 2016 04:17
Show Gist options
  • Save travist/838f5cf5255b74111cef6075188dedc9 to your computer and use it in GitHub Desktop.
Save travist/838f5cf5255b74111cef6075188dedc9 to your computer and use it in GitHub Desktop.
Form.io Submission Index Requests
/**
* This will request all submissions where they provided "Smith" in the Last Name field.
*
* GET - https://yourproject.form.io/yourform/submission?data.lastName=Smith
*/
var request = require("request");
var options = {
method: 'GET',
url: 'https://yourproject.form.io/yourform/submission',
qs: {'data.lastName': 'Smith'},
headers: {
'x-jwt-token': '--- ENTER JWT TOKEN HERE ---',
'content-type': 'application/json'
}
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
/**
* This will request all submissions.
*
* GET - https://yourproject.form.io/yourform/submission
*/
var request = require("request");
var options = {
method: 'GET',
url: 'https://yourproject.form.io/yourform/submission',
headers: {
'x-jwt-token': '--- ENTER JWT TOKEN HERE ---',
'content-type': 'application/json'
}
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment