All Projects → jusx → node-wufoo

jusx / node-wufoo

Licence: MIT License
A Node.JS library for the Wufoo API.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to node-wufoo

ember-do-forms
ember-do-forms handles the icky parts of forms that you don't want to, and leaves the rest to you.
Stars: ✭ 18 (+38.46%)
Mutual labels:  forms
bootstrap-add-clear
bootstrap plugin to add a (x) clear button to your input fields
Stars: ✭ 36 (+176.92%)
Mutual labels:  forms
docker-formio-api
Docker Form.io Server based on Debian w/s6 init, Zabbix Monitoring
Stars: ✭ 14 (+7.69%)
Mutual labels:  forms
django-semanticui-forms
Effortlessly style all of your Django forms and form fields with Semantic UI wrappers.
Stars: ✭ 59 (+353.85%)
Mutual labels:  forms
form-js
View and visually edit JSON-based forms.
Stars: ✭ 125 (+861.54%)
Mutual labels:  forms
django-formidable
On the way to glory! again!
Stars: ✭ 19 (+46.15%)
Mutual labels:  forms
forms-frontend
Frontend for Python Discord forms.
Stars: ✭ 18 (+38.46%)
Mutual labels:  forms
tubular-dotnet
Tubular .NET Library
Stars: ✭ 16 (+23.08%)
Mutual labels:  forms
CustomFormViews
A clean collection of views used for forms.
Stars: ✭ 12 (-7.69%)
Mutual labels:  forms
jquery-ajaxSubmit
Effortlessly submit forms using AJAX and JSON.
Stars: ✭ 39 (+200%)
Mutual labels:  forms
Toast
To use it in PCL or .NetStandard projects write this line of code : CrossToastPopUp.Current.ShowToastMessage("Message");
Stars: ✭ 51 (+292.31%)
Mutual labels:  forms
formio
Formio, form definition and binding library for Java platform
Stars: ✭ 24 (+84.62%)
Mutual labels:  forms
valid8
Valid8 - Super Simple Bootstrap Form Valiation
Stars: ✭ 17 (+30.77%)
Mutual labels:  forms
cl-forms
Web forms handling library for Common lisp
Stars: ✭ 29 (+123.08%)
Mutual labels:  forms
mobx-form
Declarative, complex forms with Mobx/React with lots of dynamic/imperative hooks
Stars: ✭ 29 (+123.08%)
Mutual labels:  forms
Maily-Form
Forms on any website
Stars: ✭ 29 (+123.08%)
Mutual labels:  forms
react-form-validation-demo
React Form Validation Demo
Stars: ✭ 88 (+576.92%)
Mutual labels:  forms
Table-Detection-Extraction
Detect the tables in a form and extract the tables as well as the cells of the tables.
Stars: ✭ 35 (+169.23%)
Mutual labels:  forms
ContactEtc
Laraval package to instantly add a customisable contact form to your site.
Stars: ✭ 21 (+61.54%)
Mutual labels:  forms
react-emotion-multi-step-form
React multi-step form library with Emotion styling
Stars: ✭ 25 (+92.31%)
Mutual labels:  forms

Build npm version

Node-Wufoo

Node-Wufoo is a Wufoo API wrapper for node.js. It simplifies working with the Wufoo API and provides an abstraction layer.

Installation

$ npm install wufoo

Usage

Each API returns it's own set of objects which is all documented on Wufoo.com for reference.

The required node version is 8.0.0 and above for all releases above v1.2.x.

Example

   var Wufoo = require("wufoo");
   var wufoo = new Wufoo("fishbowl", "AOI6-LFKL-VM1Q-IEX9");

   wufoo.getForms(function(err, forms) {
      // do something with your forms here.
   });

   // get a specific form given the id.
   wufoo.getForm("idofForm", function(err, form){
      // do something with your form here.
   });

   wufoo.getFormEntries("idofForm", function(err, entries) {
      // do something with your entries here.
   });

   // pass in optional query parameters
   var optionalQuery = {pretty: true}

   wufoo.getForms(optionalQuery, function(err, forms) {
      // do something with your forms here.
   });

   // get a specific form given the id and pass in optional query parameters
   wufoo.getForm("idofForm", optionalQuery, function(err, forms) {
      // do something with your forms here.
   });

   wufoo.getFormEntries("idofForm", optionalQuery, function(err, entries) {
      // do something with your entries here.
   });

Forms

Get all the forms for an account. getForms returns an array of Form objects. You can also call getForm to get a specific Form.

   wufoo.getForms(function(err, forms) {
      console.log(forms[0].hash);
      console.log(forms[0].name);
      console.log(forms[0].description);
      // do something here.
   });

   // get a specific form given the id.
   wufoo.getForm("idofForm", function(err, form){
      // do something here.
   });

   // pass in optional query parameters
   var optionalQuery = {pretty: true}

   wufoo.getForms(optionalQuery, function(err, forms) {
      console.log(forms[0].hash);
      console.log(forms[0].name);
      console.log(forms[0].description);
      // do something here.
   });

   // get a specific form given the id and pass in optional query parameters
   wufoo.getForm("idofForm", optionalQuery, function(err, forms) {
      // do something here.
   });

Convenience methods are provided to get entries, fields and entry count for a Form:

   form.getEntries(function(err, entries) {
     // do something here.
   });

   form.getEntriesCount(function(err, count) {
      // do something here.
      console.log("There are " + count + " number of entries");
    });

    form.getFields(function(err, fields) {
        // do something here.
    });

    // pass in optional query parameters
    var optionalQuery = {pretty: true}

    form.getEntries(optionalQuery, function(err, entries) {
      // do something here.
    });

    form.getEntriesCount(optionalQuery, function(err, count) {
       // do something here.
       console.log("There are " + count + " number of entries");
     });

     form.getFields(optionalQuery, function(err, fields) {
         // do something here.
     });

Entries

Get all the entries for a form or report. getFormEntries and getReportEntries returns an array of Entry objects.

   wufoo.getFormEntries("formid", function(err, entries) {
      // do something here.
   });

   wufoo.getReportEntries("reportid", function(err, entries) {
      // do something here.
   });

   // pass in optional query parameters
   var optionalQuery = {pretty: true}

   wufoo.getFormEntries("formid", optionalQuery, function(err, entries) {
      // do something here.
   });

   wufoo.getReportEntries("reportid", optionalQuery, function(err, entries) {
      // do something here.
   });

Reports

Get all the reports for an account. getReports returns an array of Report objects.

   wufoo.getReports(function(err, reports) {
      // do something here
   });

   // get a specific form given the id.
   wufoo.getReport("idofReport", function(err, report){
      // do something here.
   });

   // pass in optional query parameters
   var optionalQuery = {pretty: true}

   wufoo.getReports(optionalQuery, function(err, reports) {
      // do something here
   });

   // get a specific form given the id.
   wufoo.getReport("idofReport", optionalQuery, function(err, report){
      // do something here.
   });

Convenience methods are provided to get entries, fields and entry count for a Report:

   report.getEntries(function(err, entries) {
     // do something here.
   });

   report.getEntriesCount(function(err, count) {
      // do something here.
      console.log("There are " + count + " number of entries");
    });

    report.getFields(function(err, fields) {
      // do something here.
    });

    // pass in optional query parameters
    var optionalQuery = {pretty: true}

   report.getEntries(optionalQuery, function(err, entries) {
     // do something here.
   });

   report.getEntriesCount(optionalQuery, function(err, count) {
     // do something here.
     console.log("There are " + count + " number of entries");
    });

    report.getFields(optionalQuery, function(err, fields) {
      // do something here.
    });   

Fields

Get all the reports for a form. getFields returns an array of Field objects.

   wufoo.getFields("formid", function(err, fields) {
      // do something here.
   });

   // pass in optional query parameters
   var optionalQuery = {pretty: true}

   wufoo.getFields("formid", optionalQuery, function(err, fields) {
      // do something here.
   });

Widgets

Get all the widgets for a report. getWidgets returns an array of Widget objects.

   wufoo.getWidgets("reportid", function(err, widgets) {
      // do something here.
   });

   // pass in optional query parameters
   var optionalQuery = {pretty: true}

   wufoo.getWidgets("reportid", optionalQuery, function(err, widgets) {
      // do something here.
   });

Comments

Get all the comments for a form. getComments returns an array of Comment objects.

   wufoo.getComments("formid", function(err, comments) {
      // do something here.
   });

   // pass in optional query parameters
   var optionalQuery = {pretty: true}

   wufoo.getComments("formid", optionalQuery, function(err, comments) {
      // do something here.
   });

Alternatively if all you need is the amount of comments for a form you can call getCommentCount:

   wufoo.getCommentCount("formid", function(err, count) {
      // do something here.
   });

   // pass in optional query parameters
   var optionalQuery = {pretty: true}

   wufoo.getCommentCount("formid", optionalQuery, function(err, count) {
      // do something here.
   });

WebHooks

Add a WebHook for a form:

   wufoo.webhook().add("formid", "http://localhost:3000", function(err, hashid) {
     // store the webhook hashid somewhere in case we want to delete them later.
   })

   // pass in optional options
   var options = {url: "http://abc.com/webhook", handshakeKey: "hand-shaking", metadata: true}
   wufoo.webhook().add("formid", options, function(err, hashid) {
     // store the webhook hashid somewhere in case we want to delete them later.
     db.put("WebHooks", {formid:form.hash, key:hashid});
   })

Delete the WebHook. More info:

   wufoo.webhook().delete("formid", "webhookHashId", function(err, success) {
     if (!success) {
       // do something.
     }

   })

Helper methods are also provided on the Form object:

   form.addWebhook("http://localhost:3000", function(err, hashid) {
      // store the webhook hashid somewhere in case we want to delete them later.
    })


   form.deleteWebhook("webhookHashId", function(err, success) {
     if (!success) {
       // do something.
     }

   })

Promises

Every single API documented above have an alternate version that supports promises. For the preferred method of using promises or await/async instead of callbacks append Async to the end of the function name. For example, the following are all valid:

  • from.addWebhookAsync
  • wufoo.getCommentCountAsync
  • wufoo.getWidgetsAsync

And so on. Calling wufoo.getCommentCountAsync will be as follows:

   wufoo.getCommentCount("formid")
      .then ((count) => {
         console.log(count);
      })
      .catch((err) => {
         console.log(err);
      });

Contributions

Please fork it. Add new features or fix bugs and do a pull request. Tests should be included:

  • Fork it
  • Create your feature branch (git checkout -b feature-new-stuff).
  • Commit your changes (git commit -am 'Added some feature').
  • Push to the branch (git push origin feature-new-stuff).
  • Create new Pull Request.

Testing

Be sure to have mocha installed. Run the entire test suite from the root directory of the project by running the command:

   $ mocha

or

   $ npm test

Future Versions

Node-Wufoo implements all of the Wufoo RESTful API except the following:

Implementation and support of the above will be included in future versions. Contributions welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].