Skip to content

Latest commit

 

History

History
79 lines (53 loc) · 1.86 KB

README.md

File metadata and controls

79 lines (53 loc) · 1.86 KB

HubSpot-nodejs custom object sample app

Requirements

  1. Node v10+
  2. Configured .env file

Running

  1. Install dependencies
npm install
  1. Initialize

If .env config file was not configured manually there is a way to initialize the CLI and create .env file via:

./bin/cli.js init

It will ask for your Hubspot Api Key and will save it to the new .env config file.

  1. Commands

Show all commands

./bin/cli.js --help

Get list of available schemas or object instances of the schema

./bin/cli.js get <schema|object> [schemaId] -a --query='test'

Create a new schema or object instance

./bin/cli.js create <schema|object> [schemaId]

Note

Please notice when you create object instance, some of them require mandatory properties, that you can provide in the following way:

./bin/cli.js create object [schemaId] --email='Brian.Halligan@test.com' --firstname='Brian' --lastname='Halligan'

Update existing schema or object instance

./bin/cli.js update <schema|object> [schemaId] [objectId] --property1='New property value'
./bin/cli.js update schema 23164357 --requiredProperties='name,age'
./bin/cli.js update object 23164357 11980985487 --age=41

Note

Please note that it’s possible to update only requiredProperties, searchableProperties and secondaryDisplayProperties via update schema.

Delete existing schema or object instance

./bin/cli.js delete <schema|object> [schemaId] [objectId]
./bin/cli.js get object 23164357 11980985487
./bin/cli.js delete schema 7895273

Note

Please note that object shema cannot be deleted until all object records are deleted.

Get list of available properties for a schema

./bin/cli.js properties [schemaId]