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.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
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 apideckClient = 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 apideckClient.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 apideckClient = new Apideck({
  apiKey: <insert-api-key-here>,
  applicationId: <insert-application-id-here>,
  consumerId: <insert-consumer-id-here>,
  serviceId: <insert-service-id-here>
});

CompaniesApi

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

ContactsApi

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

LeadsApi

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

OpportunitiesApi

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

Example

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

import { Apideck, PhoneNumberTypeEnum } from 'apideck'

const apideckClient = 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 apideckClient.crm.contacts.list({
  limit: 10
})

const result = await apideckClient.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: PhoneNumberTypeEnum.Home
    }]
  }
})

console.info(result)

Support

Open an issue!

License

MIT

Keywords

FAQs

Package last updated on 25 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