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

hubspot-crm-api

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hubspot-crm-api

```javascript const {HubspotObjects} = require("hubspot-crm-api") const dotEnv = require("dotenv").config()

  • 2.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31
increased by244.44%
Maintainers
1
Weekly downloads
 
Created
Source
const {HubspotObjects} = require("hubspot-crm-api")
const dotEnv = require("dotenv").config()

const creatContact = async ()=>{
    try {
        let response = await new HubspotObjects().create({
            "email": "umesh@gmail.com",
            "firstname": "Umesh",
            "lastname": "Patil",
            "phone": "9243603720",
            "jobtitle": "admin",
            "userid": "2",
            "lifecyclestage": "customer"
        }, "contacts")
        console.log(response)
        
    } catch (error) {
        console.log(error)
    }
}

creatContact()
const {HubspotObjects} = require("hubspot-crm-api")
const dotEnv = require("dotenv").config()

const getCompany = async ()=>{
    try {
        let response = await new HubspotObjects().getByPropertyName({
            "limit" : 1,
            "objects" : "companies",
            "operator" : "EQ",
            "propertyName" : "orgid",
            "value" : 1,
            "properties" : []
        })
        
        console.log (response)
        return response;
    } catch (error) {
        
    }
}
getCompany()
const {HubspotObjects} = require("hubspot-crm-api")
const dotEnv = require("dotenv").config()
const update = async ()=>{
    let companyId = await getCompany().then(res=>res[0].id)
    try {
        let response = await new HubspotObjects().update({
            "name" : "Jeevan Jyoti hospital and Reaserch Center"
        }, companyId, "companies")
        console.log(response)
    } catch (error) {
        console.log(error)
    }
}
update()


// 
/**
 * @hs_ticket_category PRODUCT_ISSUE | BILLING_ISSUE | FEATURE_REQUEST | GENERAL_INQUIRY
 * @hs_ticket_priority LOW | MEDIUM | HIGH
 */
const createTicket= async ()=>{
    try {
        let response = await new HubspotObjects().create({
            "hs_pipeline": 0,
            "hs_pipeline_stage": 1,
            "hs_ticket_category" : "PRODUCT_ISSUE", 
            "hs_ticket_priority": "HIGH",
            "closed_date" : "2021-09-30",
            "content" : "We want Strong password limition in your software",
            // "hubspot_owner_id": "910901",
            "subject": "1 Jeevanjyoti Hospital and research center"
        }, "tickets")

        console.log(response)
        
    } catch (error) {
        console.log(error)
    }

}

createTicket()

Associations

const createAssociation = async()=>{
    let companyId = "4797123787"
    let ticketid = "467217102"

    const response = await new Associations().create({
        "fromObjectId" : ticketid,
        "fromObjectType" : "tickets",

        "toObjectId" : companyId,
        "toObjectType" : "companies"
    })

    console.log(response)
}

createAssociation()

FAQs

Package last updated on 20 Nov 2022

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