Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@apideck/node

Package Overview
Dependencies
Maintainers
3
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apideck/node

Apideck API wrapper

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.1K
decreased by-31.5%
Maintainers
3
Weekly downloads
 
Created
Source

Apideck Node.js library

Table of Contents

  • Table of Contents
  • Installation
  • Getting started
  • Example
  • Support
  • License

Installation

Install the latest SDK using npm:

$ npm install apideck

or Yarn

$ yarn add apideck

Getting started

The module supports all Apideck API endpoints. For complete information about the API, head to the docs. All endpoints require a valid apiKey so that's the only required parameter to initialize a new Apideck client:

import Apideck from 'apideck';

const apideck = new Apideck({
  apiKey: <insert-api-key-here>,
  applicationId: <insert-application-id-here>,
  consumerId: <insert-consumer-id-here>,
  serviceId: <insert-service-id-here>
});

All top level parameters (except for apiKey) can be overriden in specific resource calls.

const response = await apideck.crm.contacts.list({
  limit: '10',
  serviceId: '<insert-service-id-here>',
  consumerId: <insert-consumer-id-here>
})

Methods

Once you created a new Apideck client you can use following methods:

import Apideck from 'apideck';

const apideck = new Apideck({
  apiKey: <insert-api-key-here>,
  applicationId: <insert-application-id-here>,
  consumerId: <insert-consumer-id-here>,
  serviceId: <insert-service-id-here>
});

CompaniesApi

  apideck.companies.list(parameters);
  apideck.companies.retrieve(parameters);
  apideck.companies.create(parameters);
  apideck.companies.update(parameters);
  apideck.companies.delete(parameters);

ContactsApi

  apideck.contacts.list(parameters);
  apideck.contacts.retrieve(parameters);
  apideck.contacts.create(parameters);
  apideck.contacts.update(parameters);
  apideck.contacts.delete(parameters);

LeadsApi

  apideck.leads.list(parameters);
  apideck.leads.retrieve(parameters);
  apideck.leads.create(parameters);
  apideck.leads.update(parameters);
  apideck.leads.delete(parameters);

OpportunitiesApi

  apideck.opportunities.list(parameters);
  apideck.opportunities.retrieve(parameters);
  apideck.opportunities.create(parameters);
  apideck.opportunities.update(parameters);
  apideck.opportunities.delete(parameters);

Example

Retrieving a list of all contacts and updating the first record with a new address.

import { Apideck, PhoneNumberType } from 'apideck'

const apideck = new Apideck({
  apiKey: <insert-api-key-here>,
  applicationId: <insert-application-id-here>,
  consumerId: <insert-consumer-id-here>,
  serviceId: <insert-service-id-here>
});

const { data } = await apideck.crm.contacts.list({
  limit: 10
})

const result = await apideck.crm.contacts.update({
  id: data[0].id!,
  contact: {
    name: "John Doe",
    firstName: "John",
    lastName: "Doe",
    addresses: [{
      city: "Hoboken",
      line1: "Streetname 19",
      state: "NY"
    }],
    phoneNumbers: [{
      number: '0486565656',
      phoneType: PhoneNumberType.Home
    }]
  }
})

console.info(result)

Support

Open an issue!

License

MIT

Keywords

FAQs

Package last updated on 26 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc