npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-calendly-sdk

v1.0.9

Published

A wrapper SDK in nodejs for the calendly API

Downloads

4,748

Readme

Intro

This library provides a thin wrapper SDK for the calend.ly API. For up-to-date information on the calend.ly API please visit their developer docs

Get your API Key

  1. Log into Calend.ly
  2. Navigate to the Integrations page
  3. Copy your API Key See Official Docs for more details.

Quickstart

Install package in your node project.

npm install --save node-calendly-sdk
var Calendly = require('node-calendly-sdk')

calendly_client = new Calendly("YOUR-API-TOKEN")

// Create a webhook
calendly_client.webhooks.create("https://mycallbackurl.com/handler")
	.then(function(result) {
		console.log(JSON.stringify(result, "\t", null))
		/**
			{
				"id": <hook_id>
			}
		*/
	});

Functions

Below is a description of the functions available for supported resources in the V1 API along with some basic usage examples.

Webhooks

Create A Webhook

Create a webhook that will receive notifications from Calendly when events are scheduled or cancelled.

Parameters:

  • URL: Callback URL for webhook
  • events: Array of events

Usage:

var Calendly = require('node-calendly-sdk')

calendly_client = new Calendly("YOUR-API-TOKEN")

// Create a webhook
calendly_client.webhooks.create("https://mycallbackurl.com/handler")
   .then(function(result) {
   	console.log(JSON.stringify(result, "\t", null))
   });

Console Output:

{
	"id": <hook_id>
}

Errors: If there are errors when submitting a request they will be returned in the JSON, result, you will need to check for and handle these manually.

  • Unauthorized
{
	"type": "authentication_error",
	"message": "Invalid token"
}
  • Forbidden
{
	"type": "authorization_error",
	"message": "Your current organization should be on premium tier"
}
  • Conflict
{
	"type": "conflict_error",
	"message": "Hook with this url already exists"
}
  • Unprocessable Entity
{
	"type": "validation_error",
	"message": "Validation failed",
	"errors": {
		"url": ["can't be empty"],
		"events": ["is not included in the list"],
		"base": ["some error"],
		<field_name>: <error_messages_array>
	}
}

Get Webhook by ID

Fetches a specific webhook by ID.

Parameters:

  • id: ID of webhook.

Usage:

var Calendly = require('node-calendly-sdk')

calendly_client = new Calendly("YOUR-API-TOKEN")

// Get the webhook that has the id of 1234
calendly_client.webhooks.get(1234)
   .then(function(result) {
   	console.log(JSON.stringify(result, "\t", null))
   });

Console Output:

{
  "data":[
    {
      "type":"hooks",
      "id": 1234,
      "attributes":{
        "url":"https://mycallbackurl.com/handler",
        "created_at":"2016-08-23T19:15:24Z",
        "state":"active",
        "events":[
          "invitee.created",
          "invitee.canceled"
        ]
      }
    }
  ]
}

Get list of all Webhooks

List all of the webhooks configured for this account.

Usage:

var Calendly = require('node-calendly-sdk')

calendly_client = new Calendly("YOUR-API-TOKEN")

// Create a webhook
calendly_client.webhooks.list()
   .then(function(result) {
   	console.log(JSON.stringify(result, "\t", null))

Remove a Webhook

Remove a webhook so that it is no longer active.

Parameters:

  • id: ID of your webhook.

Usage:

var Calendly = require('node-calendly-sdk')

calendly_client = new Calendly("YOUR-API-TOKEN")

// Create a webhook
calendly_client.webhooks.remove("your-webhook-id")
   .then(function(result) {
   	console.log(JSON.stringify(result, "\t", null))

Event Types

Get list of all event types for User.

List all of the configured event types for this account.

Usage:

var Calendly = require('node-calendly-sdk')

calendly_client = new Calendly("YOUR-API-TOKEN")

calendly_client.events.list()
   .then(function(result) {
   	console.log(JSON.stringify(result, "\t", null))

Users

Get Account information.

List information about this account.

Usage:

var Calendly = require('node-calendly-sdk')

calendly_client = new Calendly("YOUR-API-TOKEN")

calendly_client.users.about_me()
   .then(function(result) {
   	console.log(JSON.stringify(result, "\t", null))