# hubspot-crm-api

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

Latest version **2.0.9** (published 2022-11-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install hubspot-crm-api
pnpm add hubspot-crm-api
yarn add hubspot-crm-api
bun add hubspot-crm-api
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.9 |
| Published | 2022-11-20 |
| First published | 2021-08-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 40.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | umeshbilagi |

## Links

- npm: https://www.npmjs.com/package/hubspot-crm-api
- Repository: https://github.com/umeshramya/crm-api
- Homepage: https://github.com/umeshramya/crm-api#readme
- Issues: https://github.com/umeshramya/crm-api/issues
- npm.io page: https://npm.io/package/hubspot-crm-api

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^1.1.3
- [request](https://npm.io/package/request.md) ^2.88.2
- [@hubspot/api-client](https://npm.io/package/@hubspot/api-client.md) ^7.1.2

## Recent versions

- 2.0.9 (latest) — 2022-11-20
- 2.0.8 — 2022-11-20
- 2.0.7 — 2022-11-20
- 2.0.6 — 2022-11-20
- 2.0.5 — 2022-11-20
- 2.0.4 — 2022-11-20
- 2.0.3 — 2022-11-20
- 2.0.2 — 2022-11-19
- 2.0.1 — 2022-01-30
- 2.0.0 — 2022-01-30
- 1.1.1 — 2021-09-03
- 1.1.0 — 2021-09-02
- 1.0.3 — 2021-08-31
- 1.0.2 — 2021-08-30
- 1.0.1 — 2021-08-30
- … 1 more at https://npm.io/package/hubspot-crm-api/versions

## README

```javascript
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()
```

```javascript
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()
```


```javascript
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()

```


```javascript

// 
/**
 * @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
```javascript
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()
```

---
_Source: https://npm.io/package/hubspot-crm-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
