pipedrive

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: MIT Imports: 12 Imported by: 0

README

pipedrive

Integration built for PipeDrive REST API

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnexpected  = errors.New("idk...")
	ErrAuthExpired = errors.New("Auth Expired")
)

Functions

This section is empty.

Types

type Activity

type Activity struct {
	Id, Company_id, User_id, Org_id, Deal_id                                          int
	Type, Due_date, Due_time, Duration, Subject, Location, Org_name, Lead_title, Note string
	Done                                                                              bool

	Start time.Time // these get filled in by us
	Dur   time.Duration
}

type Deal added in v0.2.0

type Deal struct {
	Id     int
	Org_id struct {
		Address string
	}
}

type Oauth

type Oauth struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	ApiDomain    string `json:"api_domain"`
	Expires      int    `json:"expires_in"`

	// used by us to know when to refresh to try to avoid failed calles
	ExpiresAt time.Time
}

type Org added in v0.2.0

type Org struct {
	Id, Company_id                           int
	Name, Address, Address_formatted_address string
}

type Pipedrive

type Pipedrive struct {
	OAuthClientId, OAuthClientSecret, RedirectURI string
}

func NewPipedrive

func NewPipedrive(clientId, clientSecret, redirectUri string) (*Pipedrive, bool)

inits our pipedrive api object with the required default info for everyone returns the object and a bool to indicate we're goods

func (*Pipedrive) GetDeal added in v0.2.0

func (this *Pipedrive) GetDeal(ctx context.Context, bearer, domain string, dealId int) (*Deal, error)

returns all jobs that match our conditions

func (*Pipedrive) GetOrg added in v0.2.0

func (this *Pipedrive) GetOrg(ctx context.Context, bearer, domain string, orgId int) (*Org, error)

returns all jobs that match our conditions

func (*Pipedrive) ListActivities

func (this *Pipedrive) ListActivities(ctx context.Context, bearer, domain string, start, finish time.Time) (ret []*Activity, err error)

returns all jobs that match our conditions

func (*Pipedrive) ListUsers

func (this *Pipedrive) ListUsers(ctx context.Context, bearer, domain string) ([]*User, error)

returns all jobs that match our conditions

func (*Pipedrive) OAuth

func (this *Pipedrive) OAuth(ctx context.Context, code string) (*Oauth, error)

inital oauth call using the short lived token from the callback

func (*Pipedrive) RefreshToken

func (this *Pipedrive) RefreshToken(ctx context.Context, oldRefresh string) (*Oauth, error)

refreshes our api token using our old refresh token

func (*Pipedrive) UpdateActivity

func (this *Pipedrive) UpdateActivity(ctx context.Context, bearer, domain string, id, userId int, start time.Time) error

updates what we need to about an activity

type User

type User struct {
	Id                         int
	Name, Email, Timezone_name string
	Active_flag                bool
}

Jump to

Keyboard shortcuts

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