Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abhiyerra/hubspot

HubSpot API in Golang
https://github.com/abhiyerra/hubspot

Last synced: 13 days ago
JSON representation

HubSpot API in Golang

Awesome Lists containing this project

README

        

#+TITLE: HubSpot

HubSpot API in Go.

#+begin_src go
apiKey := os.Getenv("HUBSPOT_API_KEY")

a := NewContact(apiKey, "[email protected]")
a.Add("firstname", "Abhi")
a.Add("lastname", "Yerra")
a.Add("company", "Acksin")
a.Add("lifecyclestage", "opportunity")
a.Add("acksinsoftware", "opsZero")
resp := a.Publish()
if resp.Vid != 901 {
t.Errorf("Failed to update contact")
}

d := NewDeal(apiKey)
d.Associations.AssociatedVids = []int{resp.Vid}
d.Add("dealname", "Tim's Newer Deal")
d.Add("dealstage", "closedwon")
d.Add("closedate", Timestamp())
d.Add("amount", "60000")
d.Add("dealtype", "newbusiness")
d.Publish()
#+end_src