go-hubspot

module
v0.0.0-...-39606a9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2022 License: Apache-2.0

README

go-hubspot

Devtool version Maintainer Go Report Card GoDoc Reference

Example Usage

package main

import (
	"context"
	"fmt"
	"net/http"
	"os"

	"github.com/faetools/go-hubspot/options"
	"github.com/faetools/go-hubspot/pkg/crm/contacts"
)

func main() {
	ctx := context.Background()

	c, err := contacts.NewClient(options.WithAPIKey(os.Getenv("HUBSPOT_API_KEY")))
	checkErr(err)

	resp, err := c.ListContacts(ctx, &contacts.ListContactsParams{
		Properties: &contacts.PropertyKeys,
	})
	checkErr(err)

	if resp.StatusCode() != http.StatusOK {
		fmt.Printf("Got status %q with body: %s\n", resp.Status(), string(resp.Body))
		os.Exit(1)
	}

	for _, res := range resp.JSON200.Results {
		fmt.Printf("%s %s (%s)\n", res.FirstName(), res.LastName(), res.Emails())
	}
}

func checkErr(err error) {
	if err != nil {
		fmt.Println("Error:", err)
		os.Exit(1)
	}
}

API Key

You can get your API key at https://app.hubspot.com/api-key/12345/call-log, with 12345 being your account number.

Directories

Path Synopsis
Code generated by devtool; DO NOT EDIT.
Code generated by devtool; DO NOT EDIT.
pkg
auth/oauth
Package oauth provides primitives to interact with the openapi HTTP API.
Package oauth provides primitives to interact with the openapi HTTP API.
automation/actions
Package actions provides primitives to interact with the openapi HTTP API.
Package actions provides primitives to interact with the openapi HTTP API.
conversations/visitoridentification
Package visitoridentification provides primitives to interact with the openapi HTTP API.
Package visitoridentification provides primitives to interact with the openapi HTTP API.
crm/accounting
Package accounting provides primitives to interact with the openapi HTTP API.
Package accounting provides primitives to interact with the openapi HTTP API.
crm/associations
Package associations provides primitives to interact with the openapi HTTP API.
Package associations provides primitives to interact with the openapi HTTP API.
crm/calling
Package calling provides primitives to interact with the openapi HTTP API.
Package calling provides primitives to interact with the openapi HTTP API.
crm/companies
Package companies provides primitives to interact with the openapi HTTP API.
Package companies provides primitives to interact with the openapi HTTP API.
crm/contacts
Package contacts provides primitives to interact with the openapi HTTP API.
Package contacts provides primitives to interact with the openapi HTTP API.
crm/crmextensions
Package crmextensions provides primitives to interact with the openapi HTTP API.
Package crmextensions provides primitives to interact with the openapi HTTP API.
crm/deals
Package deals provides primitives to interact with the openapi HTTP API.
Package deals provides primitives to interact with the openapi HTTP API.
crm/imports
Package imports provides primitives to interact with the openapi HTTP API.
Package imports provides primitives to interact with the openapi HTTP API.
crm/lineitems
Package lineitems provides primitives to interact with the openapi HTTP API.
Package lineitems provides primitives to interact with the openapi HTTP API.
crm/objects
Package objects provides primitives to interact with the openapi HTTP API.
Package objects provides primitives to interact with the openapi HTTP API.
crm/owners
Package owners provides primitives to interact with the openapi HTTP API.
Package owners provides primitives to interact with the openapi HTTP API.
crm/pipelines
Package pipelines provides primitives to interact with the openapi HTTP API.
Package pipelines provides primitives to interact with the openapi HTTP API.
crm/products
Package products provides primitives to interact with the openapi HTTP API.
Package products provides primitives to interact with the openapi HTTP API.
crm/properties
Package properties provides primitives to interact with the openapi HTTP API.
Package properties provides primitives to interact with the openapi HTTP API.
crm/quotes
Package quotes provides primitives to interact with the openapi HTTP API.
Package quotes provides primitives to interact with the openapi HTTP API.
crm/schemas
Package schemas provides primitives to interact with the openapi HTTP API.
Package schemas provides primitives to interact with the openapi HTTP API.
crm/tickets
Package tickets provides primitives to interact with the openapi HTTP API.
Package tickets provides primitives to interact with the openapi HTTP API.
crm/timeline
Package timeline provides primitives to interact with the openapi HTTP API.
Package timeline provides primitives to interact with the openapi HTTP API.
crm/videoconferencing
Package videoconferencing provides primitives to interact with the openapi HTTP API.
Package videoconferencing provides primitives to interact with the openapi HTTP API.
marketing/marketingeventsbeta
Package marketingeventsbeta provides primitives to interact with the openapi HTTP API.
Package marketingeventsbeta provides primitives to interact with the openapi HTTP API.
marketing/transactional
Package transactional provides primitives to interact with the openapi HTTP API.
Package transactional provides primitives to interact with the openapi HTTP API.
webhooks
Package webhooks provides primitives to interact with the openapi HTTP API.
Package webhooks provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL