Code Monkey home page Code Monkey logo

dapulse's Introduction

Monday.com

Build Status

Wrapper for Monday.com API (previously known as Dapulse) v1 with ES6 style classes and promises.

This fork replaces references to dapulse.com with monday.com in comments and changes the hardcoded API URL to avoid the disabling of the old API URL on June 1st 2019.

Prerequisites

You need your API key:

Install

npm install dapulse --save

Usage

All API URL paths listed in the developer documentation https://developers.monday.com/ are mapped to the API class. e.g. api.users() for the API path /users. If the URL path contains a parameter e.g. {pulse_id} this is mapped to the word without the brackets. For example, /v1/pulses/{id}.json becomes api.pulses.id();

See the developer documentation for all usable parameters for each method

If the URL has the ability to take multiple HTTP Verbs .e.g get, post, then the request config must also include an action property containing the name of the verb (see examples below).

'use strict';

const API = require('dapulse'),
    api = new API({ 
        apiKey: '<YOUR API KEY>'
    });

API

new API(options);

  • apiKey String - Your API key
  • debug Boolean - If true the URL, Verb and Querystring/Form Body are written to the console. (default false)

Examples

There are a lot of examples in the /examples folder which I've tried to comment thoroughly. But here's a few basic examples.

'use strict';

const API = require('dapulse'),
    api = new API({ 
        apiKey: '<YOUR API KEY>', 
    });


// Get 4 users from the first page
// https://developers.monday.com/#!/users/GET_version_users_format
api.users({
	page: 1,
	per_page: 4,
	order_by_latest: true
})
	.then(json => { console.log(json); })
	.catch(err => { console.error(err); });
'use strict';

const API = require('dapulse'),
    api = new API({ 
        apiKey: '<YOUR API KEY>', 
    });


// Create new board called 'Test API Board'
// https://developers.monday.com/#!/boards/POST_version_boards_format
api.boards({
	action: 'post',
	user_id: 152586,
	name: 'Test API Board',
	description: 'Test API description...'
})
	.then(json => { console.log(json); })
	.catch(err => { console.error(err); });
'use strict';

const API = require('dapulse'),
    api = new API({ 
        apiKey: '<YOUR API KEY>', 
    });


// Delete a note from the pulse 158556
// https://developers.monday.com/#!/pulses/DELETE_version_pulses_id_notes_note_id_format
api.pulses.id.notes.note_id({
	action: 'delete',
	id: 158556,
	note_id: 123589
})
	.then(json => { console.log(json); })
	.catch(err => { console.error(err); });

dapulse's People

Contributors

leemm avatar wismgari 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.