Code Monkey home page Code Monkey logo

node-surveymonkey's Introduction

node-surveymonkey

A node.js library for the SurveyMonkey API

node-surveymonkey exposes the following features of the SurveyMonkey API to your node.js application:

  • SurveyMonkey API (Versions v2)

Further information on the SurveyMonkey API and its features is available at https://developer.surveymonkey.com

Installation

Installing using npm (node package manager):

npm install surveymonkey

If you don't have npm installed or don't want to use it:

cd ~/.node_libraries
git clone [email protected]:Datahero/node-surveymonkey.git

Please note that parts of node-surveymonkey depend on request by Mikeal Rogers. This library needs to be installed for the API to work. Additionally node-querystring is required. If you are using npm all dependencies should be automagically resolved for you.

Usage

Information on how to use the SurveyMonkey APIs can be found below. Further information on the API methods available can be found at https://developer.surveymonkey.com. You can also find further information on how to obtain an API key, and/or OAuth2 in your SurveyMonkey account and much more on the SurveyMonkey API pages.

SurveyMonkey API

SurveyMonkeyAPI takes three arguments. There are two ways to authenticate with the api. You can either use a SurveyMonkey API key, or you can use an oAuth token.

  1. The first argument is your API key, which you can find in your SurveyMonkey Account.
  2. The second argument is your oAuth token if you are using oAuth for a particular user. Leave null if you are just accessing with your API key.
  3. The third argument is an options object which can contain the following options:
  • version The API version to use. Defaults to v2.
  • secure Whether or not to use secure connections over HTTPS (true/false). Defaults to false.
  • userAgent Custom User-Agent description to use in the request header.

The callback function for each API method gets two arguments. The first one is an error object which is null when no error occured, the second one an object with all information retrieved as long as no error occured.

Example:

var SurveyMonkeyAPI = require('surveymonkey').SurveyMonkeyAPI;

var apiKey = 'Your SurveyMonkey API Key';
var accessToken = 'Your SurveyMonkey App Access Token';

try { 
    var api = new SurveyMonkeyAPI(apiKey, accessToken, { version : 'v2', secure : false });
} catch (error) {
    console.log(error.message);
}

api.getSurveyList({ title: 'some_title', page_size: 25 }, function (error, data) {
    if (error)
        console.log(error.message);
    else
        console.log(JSON.stringify(data)); // Do something with your data!
});

License

node-surveymonkey is licensed under the MIT License. (See LICENSE)

node-surveymonkey's People

Contributors

ibash avatar dkapell-delphix avatar mikeangstadt avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.