pipedrive

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VisibleToOwnersAndFollowers = 1
	VisibleToWholeCompany       = 3
)

Variables

This section is empty.

Functions

func Stringify

func Stringify(message interface{}) string

Types

type APIVersion added in v1.0.0

type APIVersion string

APIVersion selects the Pipedrive API generation.

const (
	// APIVersion1 targets the legacy https://api.pipedrive.com/v1 API.
	APIVersion1 APIVersion = "/v1"

	// APIVersion2 targets the https://api.pipedrive.com/api/v2 API.
	APIVersion2 APIVersion = "/api/v2"
)

type Access

type Access struct {
	App             string `json:"app"`
	Admin           bool   `json:"admin"`
	PermissionSetID string `json:"permission_set_id"`
}

type ActiveFlag

type ActiveFlag uint8

Active flags

const (
	ActiveFlagEnabled  ActiveFlag = 1
	ActiveFlagDisabled ActiveFlag = 0
)

type ActivitiesCreateOptions

type ActivitiesCreateOptions struct {
	Subject           string             `json:"subject,omitempty"`
	Type              string             `json:"type,omitempty"`
	OwnerID           int                `json:"owner_id,omitempty"`
	Done              *bool              `json:"done,omitempty"`
	DueDate           string             `json:"due_date,omitempty"`
	DueTime           string             `json:"due_time,omitempty"`
	Duration          string             `json:"duration,omitempty"`
	Busy              *bool              `json:"busy,omitempty"`
	Note              string             `json:"note,omitempty"`
	DealID            int                `json:"deal_id,omitempty"`
	LeadID            string             `json:"lead_id,omitempty"`
	ProjectID         int                `json:"project_id,omitempty"`
	OrgID             int                `json:"org_id,omitempty"`
	Location          *Address           `json:"location,omitempty"`
	PublicDescription string             `json:"public_description,omitempty"`
	Priority          int                `json:"priority,omitempty"`
	Participants      []Participant      `json:"participants,omitempty"`
	Attendees         []ActivityAttendee `json:"attendees,omitempty"`
}

ActivitiesCreateOptions specifies the parameters to the ActivitiesService.Create and ActivitiesService.Update methods.

type ActivitiesListOptions added in v1.0.0

type ActivitiesListOptions struct {
	FilterID      int    `url:"filter_id,omitempty"`
	OwnerID       int    `url:"owner_id,omitempty"`
	DealID        int    `url:"deal_id,omitempty"`
	LeadID        string `url:"lead_id,omitempty"`
	PersonID      int    `url:"person_id,omitempty"`
	OrgID         int    `url:"org_id,omitempty"`
	Done          bool   `url:"done,omitempty"`
	UpdatedSince  string `url:"updated_since,omitempty"`
	UpdatedUntil  string `url:"updated_until,omitempty"`
	SortBy        string `url:"sort_by,omitempty"`
	SortDirection string `url:"sort_direction,omitempty"`
	IncludeFields string `url:"include_fields,omitempty"`
	IDs           string `url:"ids,omitempty"`

	CursorListOptions
}

ActivitiesListOptions specifies the optional parameters to the ActivitiesService.List method.

type ActivitiesReponse

type ActivitiesReponse struct {
	Success        bool           `json:"success"`
	Data           []Activity     `json:"data"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

ActivitiesReponse represents multiple activities response.

type ActivitiesService

type ActivitiesService service

ActivitiesService handles activities related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Activities

func (*ActivitiesService) Create

Create an activity.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Activities#addActivity

func (*ActivitiesService) Delete

func (s *ActivitiesService) Delete(ctx context.Context, id int) (*Response, error)

Delete an activity.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Activities#deleteActivity

func (*ActivitiesService) DeleteMultiple

func (s *ActivitiesService) DeleteMultiple(ctx context.Context, ids []int) (*Response, error)

DeleteMultiple deletes activities one by one, since the v2 API does not expose a reliable bulk delete endpoint. The response of the last delete is returned; deletion stops at the first error.

func (*ActivitiesService) GetByID

GetByID returns details of a specific activity.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Activities#getActivity

func (*ActivitiesService) List

List returns activities.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Activities#getActivities

func (*ActivitiesService) Update

Update an activity.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Activities#updateActivity

type Activity

type Activity struct {
	ID                int                `json:"id,omitempty"`
	Subject           string             `json:"subject,omitempty"`
	Type              string             `json:"type,omitempty"`
	OwnerID           int                `json:"owner_id,omitempty"`
	CreatorUserID     int                `json:"creator_user_id,omitempty"`
	IsDeleted         bool               `json:"is_deleted,omitempty"`
	Done              bool               `json:"done,omitempty"`
	DueDate           string             `json:"due_date,omitempty"`
	DueTime           string             `json:"due_time,omitempty"`
	Duration          string             `json:"duration,omitempty"`
	Busy              bool               `json:"busy,omitempty"`
	AddTime           string             `json:"add_time,omitempty"`
	UpdateTime        string             `json:"update_time,omitempty"`
	MarkedAsDoneTime  string             `json:"marked_as_done_time,omitempty"`
	DealID            int                `json:"deal_id,omitempty"`
	LeadID            string             `json:"lead_id,omitempty"`
	PersonID          int                `json:"person_id,omitempty"`
	OrgID             int                `json:"org_id,omitempty"`
	ProjectID         int                `json:"project_id,omitempty"`
	Note              string             `json:"note,omitempty"`
	Location          *Address           `json:"location,omitempty"`
	PublicDescription string             `json:"public_description,omitempty"`
	Priority          int                `json:"priority,omitempty"`
	Participants      []Participant      `json:"participants,omitempty"`
	Attendees         []ActivityAttendee `json:"attendees,omitempty"`
}

Activity represents a Pipedrive activity in the v2 API shape.

func (Activity) String

func (a Activity) String() string

type ActivityAttendee added in v1.0.0

type ActivityAttendee struct {
	EmailAddress string `json:"email_address,omitempty"`
	Name         string `json:"name,omitempty"`
	Status       string `json:"status,omitempty"`
	IsOrganizer  bool   `json:"is_organizer,omitempty"`
	PersonID     int    `json:"person_id,omitempty"`
	UserID       int    `json:"user_id,omitempty"`
}

ActivityAttendee represents a v2 activity attendee.

type ActivityField

type ActivityField struct {
	ID                 int         `json:"id"`
	Key                string      `json:"key"`
	Name               string      `json:"name"`
	OrderNr            int         `json:"order_nr"`
	PicklistData       interface{} `json:"picklist_data,omitempty"`
	FieldType          string      `json:"field_type"`
	AddTime            string      `json:"add_time"`
	UpdateTime         string      `json:"update_time"`
	ActiveFlag         bool        `json:"active_flag"`
	EditFlag           bool        `json:"edit_flag"`
	IndexVisibleFlag   bool        `json:"index_visible_flag"`
	DetailsVisibleFlag bool        `json:"details_visible_flag"`
	AddVisibleFlag     bool        `json:"add_visible_flag"`
	ImportantFlag      bool        `json:"important_flag"`
	BulkEditAllowed    bool        `json:"bulk_edit_allowed"`
	MandatoryFlag      bool        `json:"mandatory_flag"`
	Options            []struct {
		ID    string `json:"id"`
		Label string `json:"label"`
	} `json:"options,omitempty"`
}

ActivityField represents a Pipedrive activity field.

type ActivityFieldsResponse

type ActivityFieldsResponse struct {
	Success        bool            `json:"success"`
	Data           []ActivityField `json:"data"`
	AdditionalData AdditionalData  `json:"additional_data"`
}

ActivityFieldsResponse represents multiple activity fields response.

type ActivityFieldsService

type ActivityFieldsService service

ActivityFieldsService handles activity fields related methods of the Pipedrive API.

Pipedrive API dcos: https://developers.pipedrive.com/docs/api/v1/#!/ActivityFields

func (*ActivityFieldsService) List

List returns all fields for activity.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/ActivityFields/get_activityFields

type ActivityResponse

type ActivityResponse struct {
	Success bool     `json:"success"`
	Data    Activity `json:"data"`
}

ActivityResponse represents single activity response.

type ActivityType

type ActivityType struct {
	ID           int         `json:"id"`
	OrderNr      int         `json:"order_nr"`
	Name         string      `json:"name"`
	KeyString    string      `json:"key_string"`
	IconKey      string      `json:"icon_key"`
	ActiveFlag   bool        `json:"active_flag"`
	Color        interface{} `json:"color"`
	IsCustomFlag bool        `json:"is_custom_flag"`
	AddTime      string      `json:"add_time"`
	UpdateTime   interface{} `json:"update_time"`
}

ActivityType represents a Pipedrive activity type.

func (ActivityType) String

func (at ActivityType) String() string

type ActivityTypeResponse

type ActivityTypeResponse struct {
	Success bool         `json:"success"`
	Data    ActivityType `json:"data"`
}

ActivityTypeResponse represents single activity type response.

type ActivityTypesAddOptions

type ActivityTypesAddOptions struct {
	Name    string `json:"name"`
	IconKey string `json:"icon_key"`
	Color   string `json:"color,omitempty"`
}

ActivityTypesAddOptions specifices the optional parameters to the ActivityTypesService.Create method.

type ActivityTypesEditOptions

type ActivityTypesEditOptions struct {
	Name    string `json:"name,omitempty"`
	IconKey string `json:"icon_key,omitempty"`
	Color   string `json:"color,omitempty"`
	OrderNr uint   `json:"order_nr"`
}

ActivityTypesEditOptions specifices the optional parameters to the ActivityTypesService.Update method.

type ActivityTypesResponse

type ActivityTypesResponse struct {
	Success        bool           `json:"success"`
	Data           []ActivityType `json:"data"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

ActivityTypesResponse represents multiple activity types response.

type ActivityTypesService

type ActivityTypesService service

ActivityTypesService handles activities related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/ActivityTypes

func (*ActivityTypesService) Create

Create a new activity type.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/ActivityTypes/post_activityTypes

func (*ActivityTypesService) Delete

func (s *ActivityTypesService) Delete(ctx context.Context, id int) (*Response, error)

Delete an activity type.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/ActivityTypes/delete_activityTypes_id

func (*ActivityTypesService) DeleteMultiple

func (s *ActivityTypesService) DeleteMultiple(ctx context.Context, ids []int) (*Response, error)

DeleteMultiple deletes activity types in bulk.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/ActivityTypes/delete_activityTypes

func (*ActivityTypesService) List

List all activity types.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/ActivityTypes/get_activityTypes

type AdditionalData

type AdditionalData struct {
	User struct {
		Profile struct {
			ID              int         `json:"id"`
			Email           string      `json:"email"`
			Name            string      `json:"name"`
			IsAdmin         bool        `json:"is_admin"`
			DefaultCurrency string      `json:"default_currency"`
			IconURL         interface{} `json:"icon_url"`
			Activated       bool        `json:"activated"`
		} `json:"profile"`
		Locale struct {
			Language        string `json:"language"`
			Country         string `json:"country"`
			Uses12HourClock bool   `json:"uses_12_hour_clock"`
		} `json:"locale"`
		Timezone struct {
			Name   string `json:"name"`
			Offset int    `json:"offset"`
		} `json:"timezone"`
	} `json:"user"`
	MultipleCompanies   bool       `json:"multiple_companies"`
	DefaultCompanyID    int        `json:"default_company_id"`
	CompanyID           int        `json:"company_id"`
	SinceTimestamp      string     `json:"since_timestamp"`
	LastTimestampOnPage string     `json:"last_timestamp_on_page"`
	Pagination          Pagination `json:"pagination"`

	// NextCursor is returned by v2 endpoints. An empty value means the last
	// page has been reached.
	NextCursor string `json:"next_cursor,omitempty"`
}

type Address added in v1.0.0

type Address struct {
	Value           string `json:"value,omitempty"`
	StreetNumber    string `json:"street_number,omitempty"`
	Route           string `json:"route,omitempty"`
	Sublocality     string `json:"sublocality,omitempty"`
	Locality        string `json:"locality,omitempty"`
	AdminAreaLevel1 string `json:"admin_area_level_1,omitempty"`
	AdminAreaLevel2 string `json:"admin_area_level_2,omitempty"`
	Country         string `json:"country,omitempty"`
	PostalCode      string `json:"postal_code,omitempty"`
	Subpremise      string `json:"subpremise,omitempty"`
}

Address represents a v2 address object, used for organization addresses and activity locations.

type Authorization

type Authorization struct {
	UserID    int    `json:"user_id"`
	CompanyID int    `json:"company_id"`
	APIToken  string `json:"api_token"`
	AddTime   string `json:"add_time"`
	Company   struct {
		Info struct {
			ID                 int         `json:"id"`
			Name               string      `json:"name"`
			CreatorCompanyID   interface{} `json:"creator_company_id"`
			PlanID             int         `json:"plan_id"`
			Identifier         string      `json:"identifier"`
			Domain             string      `json:"domain"`
			BillingCurrency    string      `json:"billing_currency"`
			AddTime            string      `json:"add_time"`
			Status             string      `json:"status"`
			TrialEnds          string      `json:"trial_ends"`
			CancelledFlag      bool        `json:"cancelled_flag"`
			CancelTime         interface{} `json:"cancel_time"`
			Country            string      `json:"country"`
			PromoCode          string      `json:"promo_code"`
			UsedPromoCodeKey   string      `json:"used_promo_code_key"`
			AccountIsOpen      bool        `json:"account_is_open"`
			AccountIsNotPaying bool        `json:"account_is_not_paying"`
		} `json:"info"`
		Features []string `json:"features"`
		Settings struct {
			ShowGettingStartedVideo                 bool          `json:"show_getting_started_video"`
			ListLimit                               int           `json:"list_limit"`
			BetaApp                                 bool          `json:"beta_app"`
			FileUploadDestination                   string        `json:"file_upload_destination"`
			CalltoLinkSyntax                        string        `json:"callto_link_syntax"`
			AutofillDealExpectedCloseDate           bool          `json:"autofill_deal_expected_close_date"`
			PersonDuplicateCondition                string        `json:"person_duplicate_condition"`
			OrganizationDuplicateCondition          string        `json:"organization_duplicate_condition"`
			AddFollowersWhenImporting               bool          `json:"add_followers_when_importing"`
			SearchBackend                           string        `json:"search_backend"`
			BillingManagedBySales                   bool          `json:"billing_managed_by_sales"`
			MaxDealAgeInAverageProgressCalculation  int           `json:"max_deal_age_in_average_progress_calculation"`
			ThirdPartyLinks                         []interface{} `json:"third_party_links"`
			ElasticWriteTargetDuringMigration       string        `json:"elastic_write_target_during_migration"`
			AutoCreateNewPersonsFromForwarderEmails bool          `json:"auto_create_new_persons_from_forwarder_emails"`
			CompanyAdvancedDebugLogs                bool          `json:"company_advanced_debug_logs"`
			DealBlockOrder                          []struct {
				Type    string `json:"type"`
				Visible bool   `json:"visible"`
			} `json:"deal_block_order"`
			PersonBlockOrder []struct {
				Type    string `json:"type"`
				Visible bool   `json:"visible"`
			} `json:"person_block_order"`
			OrganizationBlockOrder []struct {
				Type    string `json:"type"`
				Visible bool   `json:"visible"`
			} `json:"organization_block_order"`
			NylasSync          bool `json:"nylas_sync"`
			OnboardingComplete bool `json:"onboarding_complete"`
		} `json:"settings"`
	} `json:"company"`
}

Authorization represents a Pipedrive authorization.

func (Authorization) String

func (a Authorization) String() string

type AuthorizationsListOptions

type AuthorizationsListOptions struct {
	Email    string `url:"email,omitempty"`
	Password string `url:"password,omitempty"`
}

AuthorizationsListOptions specifices the optional parameters to the AuthorizationsService.List method.

type AuthorizationsResponse

type AuthorizationsResponse struct {
	Success        bool            `json:"success"`
	Data           []Authorization `json:"data"`
	AdditionalData AdditionalData  `json:"additional_data"`
}

AuthorizationsResponse represents multiple authorizations response.

type AuthorizationsService

type AuthorizationsService service

AuthorizationsService handles authorization related methods of the Pipedrive API.

Pipedrive API dcos: https://developers.pipedrive.com/docs/api/v1/#!/Authorizations

func (*AuthorizationsService) List

List returns all authorizations for a particular user.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Authorizations/post_authorizations

type Client

type Client struct {

	// BaseURL contains the API scheme and host without a version path.
	BaseURL *url.URL

	Deals             *DealService
	Currencies        *CurrenciesService
	NoteFields        *NoteFieldsService
	Notes             *NotesService
	Recents           *RecentsService
	SearchResults     *SearchResultsService
	Users             *UsersService
	Filters           *FiltersService
	Activities        *ActivitiesService
	ActivityFields    *ActivityFieldsService
	ActivityTypes     *ActivityTypesService
	Authorizations    *AuthorizationsService
	Stages            *StagesService
	Webhooks          *WebhooksService
	UserConnections   *UserConnectionsService
	GoalsService      *GoalsService
	PipelinesService  *PipelinesService
	UserSettings      *UserSettingsService
	Files             *FilesService
	ProductFields     *ProductFieldsService
	Products          *ProductsService
	PersonFields      *PersonFieldsService
	OrganizationField *OrganizationFieldsService
	DealFields        *DealFieldsService
	Persons           *PersonsService
	Organizations     *OrganizationsService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(options *Config) *Client

func (*Client) Do

func (c *Client) Do(ctx context.Context, request *http.Request, v interface{}) (*Response, error)

Do sends an API request and returns the API response. T

The provided ctx must be non-nil. If it is canceled or times out, ctx.Err() will be returned.

func (*Client) NewRequest

func (c *Client) NewRequest(method, url string, opt interface{}, body interface{}) (*http.Request, error)

NewRequest builds a legacy v1 request. Deprecated: use NewRequestV1 or NewRequestV2.

func (*Client) NewRequestV1 added in v1.0.0

func (c *Client) NewRequestV1(method, url string, opt interface{}, body interface{}) (*http.Request, error)

NewRequestV1 builds a v1 request.

func (*Client) NewRequestV2 added in v1.0.0

func (c *Client) NewRequestV2(method, url string, opt interface{}, body interface{}) (*http.Request, error)

NewRequestV2 builds a v2 request.

func (*Client) SetOptions

func (c *Client) SetOptions(options ...func(*Client) error) error

type Config

type Config struct {
	APIKey        string
	AccessToken   string
	CompanyDomain string
	// UseProxy is retained for compatibility but no longer changes routing.
	UseProxy bool
}

type ContactValue added in v1.0.0

type ContactValue struct {
	Value   string `json:"value,omitempty"`
	Primary bool   `json:"primary,omitempty"`
	Label   string `json:"label,omitempty"`
}

ContactValue represents a single entry of a v2 contact collection (person emails, phones and instant messengers).

type CreateRemoteLinkedFileOptions

type CreateRemoteLinkedFileOptions struct {
	FileType       string `url:"file_type,omitempty"`
	Title          string `url:"title,omitempty"`
	ItemType       string `url:"item_type,omitempty"`
	ItemID         uint   `url:"item_id,omitempty"`
	RemoteLocation string `url:"remote_location,omitempty"`
}

CreateRemoteLinkedFileOptions specifices the optional parameters to the FilesService.CreateRemoteLinkedFile method.

type CurrenciesListOptions

type CurrenciesListOptions struct {
	Term string `url:"term,omitempty"`
}

CurrenciesListOptions specifices the optional parameters to the CurrenciesService.List method.

type CurrenciesResponse

type CurrenciesResponse struct {
	Success   bool       `json:"success,omitempty"`
	Data      []Currency `json:"data,omitempty"`
	Error     string     `json:"error"`
	ErrorInfo string     `json:"error_info"`
}

CurrenciesResponse represents multiple currencies response.

type CurrenciesService

type CurrenciesService service

CurrenciesService handles currencies related methods of the Pipedrive API.

Pipedrive API dcos: https://developers.pipedrive.com/docs/api/v1/#!/Currencies

func (*CurrenciesService) List

List returns all supported currencies in given account which should be used when saving monetary values with other objects.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Currencies/get_currencies

type Currency

type Currency struct {
	ID            int    `json:"id,omitempty"`
	Code          string `json:"code,omitempty"`
	Name          string `json:"name,omitempty"`
	DecimalPoints int    `json:"decimal_points,omitempty"`
	Symbol        string `json:"symbol"`
	ActiveFlag    bool   `json:"active_flag,omitempty"`
	IsCustomFlag  bool   `json:"is_custom_flag,omitempty"`
}

Currency represents a Pipedrive currency.

func (Currency) String

func (c Currency) String() string

type CursorListOptions added in v1.0.0

type CursorListOptions struct {
	Cursor string `url:"cursor,omitempty"`
	Limit  int    `url:"limit,omitempty"`
}

CursorListOptions holds the cursor-based pagination parameters shared by all v2 list endpoints. An empty NextCursor in the response additional data means there are no more pages.

type Deal

type Deal struct {
	ID                int                    `json:"id,omitempty"`
	Title             string                 `json:"title,omitempty"`
	CreatorUserID     int                    `json:"creator_user_id,omitempty"`
	OwnerID           int                    `json:"owner_id,omitempty"`
	PersonID          int                    `json:"person_id,omitempty"`
	OrgID             int                    `json:"org_id,omitempty"`
	StageID           int                    `json:"stage_id,omitempty"`
	PipelineID        int                    `json:"pipeline_id,omitempty"`
	Value             float64                `json:"value,omitempty"`
	Currency          string                 `json:"currency,omitempty"`
	AddTime           string                 `json:"add_time,omitempty"`
	UpdateTime        string                 `json:"update_time,omitempty"`
	StageChangeTime   string                 `json:"stage_change_time,omitempty"`
	Status            string                 `json:"status,omitempty"`
	IsDeleted         bool                   `json:"is_deleted,omitempty"`
	IsArchived        bool                   `json:"is_archived,omitempty"`
	ArchiveTime       string                 `json:"archive_time,omitempty"`
	Probability       float64                `json:"probability,omitempty"`
	LostReason        string                 `json:"lost_reason,omitempty"`
	VisibleTo         int                    `json:"visible_to,omitempty"`
	CloseTime         string                 `json:"close_time,omitempty"`
	WonTime           string                 `json:"won_time,omitempty"`
	LostTime          string                 `json:"lost_time,omitempty"`
	LocalWonDate      string                 `json:"local_won_date,omitempty"`
	LocalLostDate     string                 `json:"local_lost_date,omitempty"`
	LocalCloseDate    string                 `json:"local_close_date,omitempty"`
	ExpectedCloseDate string                 `json:"expected_close_date,omitempty"`
	LabelIDs          []int                  `json:"label_ids,omitempty"`
	Origin            string                 `json:"origin,omitempty"`
	OriginID          string                 `json:"origin_id,omitempty"`
	Channel           int                    `json:"channel,omitempty"`
	ChannelID         string                 `json:"channel_id,omitempty"`
	ACV               float64                `json:"acv,omitempty"`
	ARR               float64                `json:"arr,omitempty"`
	MRR               float64                `json:"mrr,omitempty"`
	CustomFields      map[string]interface{} `json:"custom_fields,omitempty"`
}

Deal represents a Pipedrive deal in the v2 API shape. Related entities are plain identifiers and custom fields live in the CustomFields map.

func (Deal) String

func (d Deal) String() string

type DealCreateOptions

type DealCreateOptions struct {
	Title             string                 `json:"title,omitempty"`
	OwnerID           int                    `json:"owner_id,omitempty"`
	PersonID          int                    `json:"person_id,omitempty"`
	OrgID             int                    `json:"org_id,omitempty"`
	PipelineID        int                    `json:"pipeline_id,omitempty"`
	StageID           int                    `json:"stage_id,omitempty"`
	Value             float64                `json:"value,omitempty"`
	Currency          string                 `json:"currency,omitempty"`
	AddTime           string                 `json:"add_time,omitempty"`
	Status            string                 `json:"status,omitempty"`
	Probability       float64                `json:"probability,omitempty"`
	LostReason        string                 `json:"lost_reason,omitempty"`
	VisibleTo         int                    `json:"visible_to,omitempty"`
	ExpectedCloseDate string                 `json:"expected_close_date,omitempty"`
	LabelIDs          []int                  `json:"label_ids,omitempty"`
	CustomFields      map[string]interface{} `json:"custom_fields,omitempty"`
}

DealCreateOptions specifies the parameters to the DealService.Add method.

type DealField

type DealField struct {
	ID                 int         `json:"id"`
	Key                string      `json:"key"`
	Name               string      `json:"name"`
	FieldCode          string      `json:"field_code"`
	FieldName          string      `json:"field_name"`
	Description        string      `json:"description,omitempty"`
	IsCustomField      bool        `json:"is_custom_field,omitempty"`
	IsOptionalResponse bool        `json:"is_optional_response_field,omitempty"`
	OrderNr            int         `json:"order_nr"`
	PicklistData       interface{} `json:"picklist_data,omitempty"`
	FieldType          string      `json:"field_type"`
	AddTime            string      `json:"add_time,omitempty"`
	UpdateTime         string      `json:"update_time,omitempty"`
	ActiveFlag         bool        `json:"active_flag"`
	EditFlag           bool        `json:"edit_flag"`
	IndexVisibleFlag   bool        `json:"index_visible_flag,omitempty"`
	DetailsVisibleFlag bool        `json:"details_visible_flag,omitempty"`
	AddVisibleFlag     bool        `json:"add_visible_flag,omitempty"`
	ImportantFlag      bool        `json:"important_flag,omitempty"`
	BulkEditAllowed    bool        `json:"bulk_edit_allowed,omitempty"`
	SearchableFlag     bool        `json:"searchable_flag,omitempty"`
	FilteringAllowed   bool        `json:"filtering_allowed,omitempty"`
	SortableFlag       bool        `json:"sortable_flag,omitempty"`
	UseField           string      `json:"use_field,omitempty"`
	Link               string      `json:"link,omitempty"`
	// MandatoryFlag can be a boolean or condition object.
	MandatoryFlag interface{} `json:"mandatory_flag"`
	IsSubfield    bool        `json:"is_subfield,omitempty"`
	Options       []struct {
		// ID is numeric for custom options and string-valued for built-ins.
		ID         interface{} `json:"id"`
		Label      string      `json:"label"`
		Color      interface{} `json:"color,omitempty"`
		UpdateTime interface{} `json:"update_time,omitempty"`
		AddTime    interface{} `json:"add_time,omitempty"`
	} `json:"options,omitempty"`
	BulkEditAllowedConditions struct {
		Status string `json:"status"`
	} `json:"bulk_edit_allowed_conditions,omitempty"`
}

DealField represents a Pipedrive deal.

func (DealField) String

func (d DealField) String() string

type DealFieldCreateOptions

type DealFieldCreateOptions struct {
	Name      string    `url:"name,omitempty"`
	FieldType FieldType `url:"field_type,omitempty"`
	Options   string    `url:"options,omitempty"`
}

DealFieldCreateOptions specifices the optional parameters to the DealFieldsService.Create method.

type DealFieldResponse

type DealFieldResponse struct {
	Success        bool           `json:"success"`
	Data           DealField      `json:"data"`
	AdditionalData AdditionalData `json:"additional_data"`
}

DealFieldResponse represents single deal field response.

type DealFieldUpdateOptions

type DealFieldUpdateOptions struct {
	Name    string `url:"name,omitempty"`
	Options string `url:"options,omitempty"`
}

DealFieldUpdateOptions specifices the optional parameters to the DealFieldsService.Update method.

type DealFieldsResponse

type DealFieldsResponse struct {
	Success        bool           `json:"success"`
	Data           []DealField    `json:"data"`
	AdditionalData AdditionalData `json:"additional_data"`
}

DealFieldsResponse represents multiple deal fields response.

type DealFieldsService

type DealFieldsService service

DealFieldsService handles deal fields related methods of the Pipedrive API.

Pipedrive API dcos: https://developers.pipedrive.com/docs/api/v1/#!/DealFields

func (*DealFieldsService) Create

Create a new deal field.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/DealFields/post_dealFields

func (*DealFieldsService) Delete

func (s *DealFieldsService) Delete(ctx context.Context, id uint) (*Response, error)

Delete a deal field.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/DealFields/delete_dealFields_id

func (*DealFieldsService) DeleteMultiple

func (s *DealFieldsService) DeleteMultiple(ctx context.Context, ids []int) (*Response, error)

DeleteMultiple deletes deal fields in bulk.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/DealFields/delete_dealFields

func (*DealFieldsService) GetByID

GetByID returns specific deal field.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/DealFields/get_dealFields_id

func (*DealFieldsService) List

List all deal fields.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/DealFields/get_dealFields

func (*DealFieldsService) Update

Update a deal field.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/DealFields/put_dealFields_id

type DealProbability

type DealProbability uint8

Deal probability

const (
	DealProbabilityEnabled  DealProbability = 1
	DealProbabilityDisabled DealProbability = 0
)

type DealResponse

type DealResponse struct {
	Success        bool           `json:"success,omitempty"`
	Data           Deal           `json:"data,omitempty"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

DealResponse represents single deal response.

type DealSearchItem added in v1.0.0

type DealSearchItem struct {
	ResultScore float64 `json:"result_score,omitempty"`
	Item        Deal    `json:"item,omitempty"`
}

DealSearchItem represents one deals search result.

type DealService

type DealService service

DealService handles deals related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Deals

func (*DealService) Add

Add a deal.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Deals#addDeal

func (*DealService) Delete

func (s *DealService) Delete(ctx context.Context, id int) (*Response, error)

Delete a deal.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Deals#deleteDeal

func (*DealService) DeleteAttachedProduct

func (s *DealService) DeleteAttachedProduct(ctx context.Context, dealID int, productAttachmentID int) (*Response, error)

DeleteAttachedProduct deletes attached product.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Deals#deleteDealProduct

func (*DealService) DeleteFollower

func (s *DealService) DeleteFollower(ctx context.Context, id int, followerID int) (*Response, error)

DeleteFollower of a deal.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Deals#deleteDealFollower

func (*DealService) DeleteMultiple

func (s *DealService) DeleteMultiple(ctx context.Context, ids []int) (*Response, error)

DeleteMultiple deletes deals one by one, since the v2 API does not expose a reliable bulk delete endpoint. The response of the last delete is returned; deletion stops at the first error.

func (*DealService) DeleteParticipant

func (s *DealService) DeleteParticipant(ctx context.Context, dealID int, participantID int) (*Response, error)

DeleteParticipant deletes participant in a deal.

This endpoint has no v2 equivalent and remains on the v1 API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Deals#deleteDealParticipant

func (*DealService) Duplicate

func (s *DealService) Duplicate(ctx context.Context, id int) (*DealResponse, *Response, error)

Duplicate a deal.

This endpoint has no v2 equivalent and remains on the v1 API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Deals#duplicateDeal

func (*DealService) GetByID added in v1.0.0

func (s *DealService) GetByID(ctx context.Context, id int) (*DealResponse, *Response, error)

GetByID returns details of a specific deal.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Deals#getDeal

func (*DealService) List

List all deals.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Deals#getDeals

func (*DealService) ListUpdates

func (s *DealService) ListUpdates(ctx context.Context, id int) (*DealsResponse, *Response, error)

ListUpdates about a deal.

This endpoint has no v2 equivalent and remains on the v1 API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Deals#getDealUpdates

func (*DealService) Merge

func (s *DealService) Merge(ctx context.Context, id int, opt *DealsMergeOptions) (*Response, error)

Merge two deals.

This endpoint has no v2 equivalent and remains on the v1 API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Deals#mergeDeals

func (*DealService) Search added in v1.0.0

Search deals.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Deals#searchDeals

func (*DealService) Update

Update a deal.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Deals#updateDeal

type DealsListOptions added in v1.0.0

type DealsListOptions struct {
	FilterID      int    `url:"filter_id,omitempty"`
	OwnerID       int    `url:"owner_id,omitempty"`
	PersonID      int    `url:"person_id,omitempty"`
	OrgID         int    `url:"org_id,omitempty"`
	PipelineID    int    `url:"pipeline_id,omitempty"`
	StageID       int    `url:"stage_id,omitempty"`
	Status        string `url:"status,omitempty"`
	UpdatedSince  string `url:"updated_since,omitempty"`
	UpdatedUntil  string `url:"updated_until,omitempty"`
	SortBy        string `url:"sort_by,omitempty"`
	SortDirection string `url:"sort_direction,omitempty"`
	IncludeFields string `url:"include_fields,omitempty"`
	CustomFields  string `url:"custom_fields,omitempty"`
	IDs           string `url:"ids,omitempty"`

	CursorListOptions
}

DealsListOptions specifies the optional parameters to the DealService.List method.

type DealsMergeOptions

type DealsMergeOptions struct {
	MergeWithID uint `json:"merge_with_id,omitempty"`
}

DealsMergeOptions specifies the parameters to the DealService.Merge method.

type DealsResponse

type DealsResponse struct {
	Success        bool           `json:"success,omitempty"`
	Data           []Deal         `json:"data,omitempty"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

DealsResponse represents multiple deals response.

type DealsSearchResponse added in v1.0.0

type DealsSearchResponse struct {
	Success bool `json:"success,omitempty"`
	Data    struct {
		Items []DealSearchItem `json:"items,omitempty"`
	} `json:"data,omitempty"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

DealsSearchResponse represents the deals search response.

type DealsUpdateOptions

type DealsUpdateOptions struct {
	Title             string                 `json:"title,omitempty"`
	OwnerID           int                    `json:"owner_id,omitempty"`
	PersonID          int                    `json:"person_id,omitempty"`
	OrgID             int                    `json:"org_id,omitempty"`
	PipelineID        int                    `json:"pipeline_id,omitempty"`
	StageID           int                    `json:"stage_id,omitempty"`
	Value             float64                `json:"value,omitempty"`
	Currency          string                 `json:"currency,omitempty"`
	Status            string                 `json:"status,omitempty"`
	Probability       float64                `json:"probability,omitempty"`
	LostReason        string                 `json:"lost_reason,omitempty"`
	VisibleTo         int                    `json:"visible_to,omitempty"`
	ExpectedCloseDate string                 `json:"expected_close_date,omitempty"`
	LabelIDs          []int                  `json:"label_ids,omitempty"`
	CustomFields      map[string]interface{} `json:"custom_fields,omitempty"`
}

DealsUpdateOptions specifies the parameters to the DealService.Update method.

type DeleteMultipleOptions

type DeleteMultipleOptions struct {
	Ids string `url:"ids,omitempty"`
}

type DeletePermissionSetAssignmentOptions

type DeletePermissionSetAssignmentOptions struct {
	PermissionSetID uint `url:"permission_set_id,omitempty"`
}

DeletePermissionSetAssignmentOptions specifices the optional parameters to the UsersService.DeletePermissionSetAssignment method.

type DeleteRoleAssignmentOptions

type DeleteRoleAssignmentOptions struct {
	RoleID uint `url:"role_id,omitempty"`
}

DeleteRoleAssignmentOptions specifices the optional parameters to the UsersService.DeleteRoleAssignment method.

type ErrorFields

type ErrorFields struct {
	Error     string `json:"error"`
	ErrorInfo string `json:"error_info"`
}

type ErrorResponse

type ErrorResponse struct {
	Response *http.Response `json:"-"`
	Message  string         `json:"message,omitempty"`
	APIError string         `json:"error,omitempty"`
	Code     string         `json:"code,omitempty"`
}

ErrorResponse reports one or more errors caused by an API request.

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type EventAction

type EventAction string

Type of actions.

const (
	ACTION_CREATE EventAction = "create"
	ACTION_CHANGE EventAction = "change"
	ACTION_DELETE EventAction = "delete"
	ACTION_ALL    EventAction = "*"

	// Deprecated webhook action aliases.
	ACTION_ADDED   EventAction = ACTION_CREATE
	ACTION_UPDATED EventAction = ACTION_CHANGE
	ACTION_MERGED  EventAction = ACTION_CHANGE
	ACTION_DELETED EventAction = ACTION_DELETE
)

type EventObject

type EventObject string

Type of objects.

const (
	OBJECT_ACTIVITY      EventObject = "activity"
	OBJECT_ACTIVTIY_TYPE EventObject = "activity_type"
	OBJECT_DEAL          EventObject = "deal"
	OBJECT_LEAD          EventObject = "lead"
	OBJECT_NOTE          EventObject = "note"
	OBJECT_ORGANIZATION  EventObject = "organization"
	OBJECT_PERSON        EventObject = "person"
	OBJECT_PIPELINE      EventObject = "pipeline"
	OBJECT_PRODUCT       EventObject = "product"
	OBJECT_STAGE         EventObject = "stage"
	OBJECT_USER          EventObject = "user"
	OBJECT_ALL_          EventObject = "*"
)

type FieldSearchOptions added in v1.0.0

type FieldSearchOptions struct {
	Term       string `url:"term"`
	EntityType string `url:"entity_type"`
	Field      string `url:"field"`
	Match      string `url:"match,omitempty"`

	CursorListOptions
}

FieldSearchOptions specifies the parameters to the SearchResultsService.SearchField method.

type FieldSearchResults added in v1.0.0

type FieldSearchResults struct {
	Success        bool              `json:"success"`
	Data           []json.RawMessage `json:"data,omitempty"`
	AdditionalData AdditionalData    `json:"additional_data,omitempty"`
}

FieldSearchResults represents the field search response.

type FieldType

type FieldType string

Field types

const (
	FieldTypeVarchar     FieldType = "varchar"
	FieldTypeVarcharAuto FieldType = "varchar_auto"
	FieldTypeText        FieldType = "text"
	FieldTypeDouble      FieldType = "double"
	FieldTypeMonetary    FieldType = "monetary"
	FieldTypeDate        FieldType = "date"
	FieldTypeSet         FieldType = "set"
	FieldTypeEnum        FieldType = "enum"
	FieldTypeUser        FieldType = "user"
	FieldTypeOrg         FieldType = "org"
	FieldTypePeople      FieldType = "people"
	FieldTypePhone       FieldType = "phone"
	FieldTypeTime        FieldType = "time"
	FieldTypeTimerange   FieldType = "timerange"
	FieldTypeDaterange   FieldType = "daterange"
)

type File

type File struct {
	ID             int         `json:"id"`
	UserID         int         `json:"user_id"`
	DealID         int         `json:"deal_id"`
	PersonID       int         `json:"person_id"`
	OrgID          int         `json:"org_id"`
	ProductID      interface{} `json:"product_id"`
	EmailMessageID interface{} `json:"email_message_id"`
	ActivityID     interface{} `json:"activity_id"`
	NoteID         interface{} `json:"note_id"`
	LogID          interface{} `json:"log_id"`
	AddTime        string      `json:"add_time"`
	UpdateTime     string      `json:"update_time"`
	FileName       string      `json:"file_name"`
	FileType       string      `json:"file_type"`
	FileSize       int         `json:"file_size"`
	ActiveFlag     bool        `json:"active_flag"`
	InlineFlag     bool        `json:"inline_flag"`
	RemoteLocation string      `json:"remote_location"`
	RemoteID       string      `json:"remote_id"`
	Cid            interface{} `json:"cid"`
	S3Bucket       interface{} `json:"s3_bucket"`
	MailMessageID  interface{} `json:"mail_message_id"`
	DealName       string      `json:"deal_name"`
	PersonName     string      `json:"person_name"`
	OrgName        string      `json:"org_name"`
	ProductName    interface{} `json:"product_name"`
	URL            string      `json:"url"`
	Name           string      `json:"name"`
	Description    interface{} `json:"description"`
}

File represents a Pipedrive file.

func (File) String

func (f File) String() string

type FileResponse

type FileResponse struct {
	Success        bool           `json:"success"`
	Data           File           `json:"data"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

FileResponse represents single file response.

type FilesResponse

type FilesResponse struct {
	Success        bool           `json:"success"`
	Data           []File         `json:"data"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

FilesResponse represents multiple files response.

type FilesService

type FilesService service

FilesService handles files related methods of the Pipedrive API.

Pipedrive API dcos: https://developers.pipedrive.com/docs/api/v1/#!/Files

func (*FilesService) CreateRemoteLinkedFile

func (s *FilesService) CreateRemoteLinkedFile(ctx context.Context, opt *CreateRemoteLinkedFileOptions) (*FileResponse, *Response, error)

CreateRemoteLinkedFile creates a remote file and link it to an item.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Files/post_files_remote

func (*FilesService) Delete

func (s *FilesService) Delete(ctx context.Context, id int) (*Response, error)

Delete marks a file as deleted.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Files/delete_files_id

func (*FilesService) GetByID

func (s *FilesService) GetByID(ctx context.Context, id int) (*FileResponse, *Response, error)

GetByID returns specific file.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Files/get_files_id

func (*FilesService) GetDownloadLinkByID

func (s *FilesService) GetDownloadLinkByID(id int) (string, *http.Request, error)

GetDownloadLinkByID returns link for specific file.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Files/get_files_id_download

func (*FilesService) LinkRemoteFileToItem

func (s *FilesService) LinkRemoteFileToItem(ctx context.Context, opt *LinkRemoteFileToItemOptions) (*FileResponse, *Response, error)

LinkRemoteFileToItem links an existing remote file (googledrive, etc) to the item you supply.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Files/post_files_remoteLink

func (*FilesService) List

List all files.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Files/get_files

func (*FilesService) Update

Update the properties of a file.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Files/put_files_id

func (*FilesService) Upload

func (s *FilesService) Upload(ctx context.Context, fileName string, filePath string) (*FileResponse, *Response, error)

Upload a file.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Files/post_files

type Filter

type Filter struct {
	ID            int         `json:"id"`
	Name          string      `json:"name"`
	ActiveFlag    bool        `json:"active_flag"`
	Type          string      `json:"type"`
	TemporaryFlag interface{} `json:"temporary_flag"`
	UserID        int         `json:"user_id"`
	AddTime       string      `json:"add_time"`
	UpdateTime    string      `json:"update_time"`
	VisibleTo     string      `json:"visible_to"`
	CustomViewID  int         `json:"custom_view_id"`
}

Filter represents a Pipedrive filter.

func (Filter) String

func (f Filter) String() string

type FilterConditions

type FilterConditions struct {
	Glue       string `json:"glue"`
	Conditions []struct {
		Glue       string `json:"glue"`
		Conditions []struct {
			Object     string      `json:"object"`
			FieldID    string      `json:"field_id"`
			Operator   string      `json:"operator"`
			Value      string      `json:"value"`
			ExtraValue interface{} `json:"extra_value"`
		} `json:"conditions"`
	} `json:"conditions"`
}

FilterConditions represents filter conditions.

type FilterCreateOptions

type FilterCreateOptions struct {
	Name       string `url:"name,omitempty"`
	Conditions string `url:"conditions,omitempty"`
	Type       string `url:"type,omitempty"`
}

FilterCreateOptions specifices the optional parameters to the FiltersService.Create method.

type FilterResponse

type FilterResponse struct {
	Success bool `json:"success"`
	Data    struct {
		Filter
		Conditions FilterConditions `json:"conditions"`
	} `json:"data"`
}

FilterResponse represents single filter response.

type FilterUpdateOptions

type FilterUpdateOptions struct {
	Name       string `url:"name,omitempty"`
	Conditions string `url:"conditions,omitempty"`
}

FilterUpdateOptions specifices the optional parameters to the FiltersService.Update method.

type FiltersListOptions

type FiltersListOptions struct {
	Type string `url:"type,omitempty"`
}

FiltersListOptions specifices the optional parameters to the FiltersService.List method.

type FiltersResponse

type FiltersResponse struct {
	Success        bool           `json:"success"`
	Data           []Filter       `json:"data"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

FiltersResponse represents multiple filters response.

type FiltersService

type FiltersService service

FiltersService handles activities related methods of the Pipedrive API.

Pipedrive API dcos: https://developers.pipedrive.com/docs/api/v1/#!/Filters

func (*FiltersService) Create

Create a filter.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Filters/post_filters

func (*FiltersService) Delete

func (s *FiltersService) Delete(ctx context.Context, id int) (*Response, error)

Delete a filter.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Filters/delete_filters_id

func (*FiltersService) DeleteMultiple

func (s *FiltersService) DeleteMultiple(ctx context.Context, ids []int) (*Response, error)

DeleteMultiple deletes multiple filters in bulk.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Filters/delete_filters

func (*FiltersService) GetByID

func (s *FiltersService) GetByID(ctx context.Context, id int) (*FilterResponse, *Response, error)

GetByID returns specific filter.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Filters/get_filters_id

func (*FiltersService) List

List filters.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Filters/get_filters

func (*FiltersService) Update

Update a specific filter.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Filters/put_filters_id

type Goal

type Goal struct {
	ID              int         `json:"id"`
	CompanyID       int         `json:"company_id"`
	UserID          int         `json:"user_id"`
	StageID         interface{} `json:"stage_id"`
	ActiveGoalID    int         `json:"active_goal_id"`
	Period          string      `json:"period"`
	Expected        int         `json:"expected"`
	ActiveFlag      bool        `json:"active_flag"`
	AddTime         string      `json:"add_time"`
	GoalType        string      `json:"goal_type"`
	ExpectedSum     int         `json:"expected_sum"`
	Currency        string      `json:"currency"`
	ExpectedType    string      `json:"expected_type"`
	CreatedByUserID int         `json:"created_by_user_id"`
	PipelineID      interface{} `json:"pipeline_id"`
	MasterExpected  int         `json:"master_expected"`
	Delivered       int         `json:"delivered"`
	DeliveredSum    int         `json:"delivered_sum"`
	PeriodStart     string      `json:"period_start"`
	PeriodEnd       string      `json:"period_end"`
	UserName        string      `json:"user_name"`
	Percentage      int         `json:"percentage,omitempty"`
}

Goal represents a Pipedrive goal.

func (Goal) String

func (g Goal) String() string

type GoalCreateOptions

type GoalCreateOptions struct {
	GoalType     string `url:"goal_type"`
	ExpectedType string `url:"expected_type"`
	UserID       uint   `url:"user_io"`
	StageID      uint   `url:"expected_type"`
	Period       string `url:"period"`
	Expected     uint   `url:"expected"`
	Currency     string `url:"currency"`
	PipelineID   uint   `url:"pipeline_id"`
}

GoalCreateOptions specifices the optional parameters to the GoalsService.Create method.

type GoalGetResultsByIDOptions

type GoalGetResultsByIDOptions struct {
	PeriodStart string `url:"period_start"`
	PeriodEnd   uint8  `url:"period_end"`
}

GoalGetResultsByIDOptions specifices the optional parameters to the GoalGetResultsByIdOptions.GetResultsByID method.

type GoalResponse

type GoalResponse struct {
	Success bool `json:"success"`
	Data    Goal `json:"data"`
}

GoalResponse represents single goal response.

type GoalsListOptions

type GoalsListOptions struct {
	UserID   uint  `url:"user_id,omitempty"`
	Everyone uint8 `url:"everyone,omitempty"`
}

GoalsListOptions specifices the optional parameters to the GoalsService.List method.

type GoalsResponse

type GoalsResponse struct {
	Success        bool           `json:"success"`
	Data           []Goal         `json:"data"`
	AdditionalData AdditionalData `json:"additional_data"`
}

GoalsResponse represents multiple goals response.

type GoalsService

type GoalsService service

GoalsService handles goals related methods of the Pipedrive API.

Pipedrive API dcos: https://developers.pipedrive.com/docs/api/v1/#!/Goals

func (*GoalsService) Create

Create a new goal, returns the ID upon success.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Goals/post_goals

func (*GoalsService) Delete

func (s *GoalsService) Delete(ctx context.Context, id int) (*Response, error)

Delete marks goal as deleted.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Goals/delete_goals_id

func (*GoalsService) GetByID

func (s *GoalsService) GetByID(ctx context.Context, id int) (*GoalResponse, *Response, error)

GetByID returns data about a specific goal.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Goals/get_goals_id

func (*GoalsService) GetResultsByID

func (s *GoalsService) GetResultsByID(ctx context.Context, id int, opt *GoalGetResultsByIDOptions) (*GoalsResponse, *Response, error)

GetResultsByID lists results of a specific goal.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Goals/get_goals_id_results

func (*GoalsService) List

List all goals.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Goals/get_goals

func (*GoalsService) Update

Update the properties of a goal.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Goals/put_goals_id

type ItemSearchOptions added in v1.0.0

type ItemSearchOptions struct {
	Term                  string `url:"term,omitempty"`
	ItemTypes             string `url:"item_types,omitempty"`
	Fields                string `url:"fields,omitempty"`
	SearchForRelatedItems bool   `url:"search_for_related_items,omitempty"`
	ExactMatch            bool   `url:"exact_match,omitempty"`
	IncludeFields         string `url:"include_fields,omitempty"`

	CursorListOptions
}

ItemSearchOptions specifies the parameters to the SearchResultsService.Search method.

type Language

type Language struct {
	LanguageCode string `json:"language_code"`
	CountryCode  string `json:"country_code"`
}

type LinkRemoteFileToItemOptions

type LinkRemoteFileToItemOptions struct {
	ItemType       string `url:"item_type"`
	ItemID         uint   `url:"item_id"`
	RemoteID       uint   `url:"remote_id"`
	RemoteLocation string `url:"remote_location"`
}

LinkRemoteFileToItemOptions specifices the optional parameters to the FilesService.LinkRemoteFileToItem method.

type Note

type Note struct {
	ID                       int       `json:"id,omitempty"`
	UserID                   int       `json:"user_id,omitempty"`
	DealID                   int       `json:"deal_id,omitempty"`
	PersonID                 int       `json:"person_id,omitempty"`
	OrgID                    int       `json:"org_id,omitempty"`
	Content                  string    `json:"content,omitempty"`
	AddTime                  Timestamp `json:"add_time,omitempty"`
	UpdateTime               Timestamp `json:"update_time,omitempty"`
	ActiveFlag               bool      `json:"active_flag,omitempty"`
	PinnedToDealFlag         bool      `json:"pinned_to_deal_flag,omitempty"`
	PinnedToPersonFlag       bool      `json:"pinned_to_person_flag,omitempty"`
	PinnedToOrganizationFlag bool      `json:"pinned_to_organization_flag,omitempty"`
	LastUpdateUserID         int       `json:"last_update_user_id,omitempty"`
}

Note represents a Pipedrive note.

func (Note) String

func (n Note) String() string

type NoteCreateOptions

type NoteCreateOptions struct {
	DealID                   uint   `json:"deal_id,omitempty"`
	Content                  string `json:"content,omitempty"`
	PersonID                 uint   `json:"person_id,omitempty"`
	OrgID                    uint   `json:"org_id,omitempty"`
	PinnedToDealFlag         uint8  `json:"pinned_to_deal_flag,omitempty"`
	PinnedToOrganizationFlag uint8  `json:"pinned_to_organization_flag,omitempty"`
	PinnedToPersonFlag       uint8  `json:"pinned_to_person_flag,omitempty"`
}

NoteCreateOptions specifices the optional parameters to the NotesService.Create method.

type NoteField

type NoteField struct {
	ID                   int      `json:"id,omitempty"`
	Key                  string   `json:"key,omitempty"`
	Name                 string   `json:"name,omitempty"`
	ActiveFlag           bool     `json:"active_flag,omitempty"`
	FieldType            string   `json:"field_type,omitempty"`
	EditFlag             int      `json:"edit_flag,omitempty"`
	MandatoryFlag        bool     `json:"mandatory_flag,omitempty"`
	VisibleInExportsFlag bool     `json:"visible_in_exports_flag,omitempty"`
	Options              []Option `json:"options,omitempty"`
}

NoteField represents a Pipedrive note field.

func (NoteField) String

func (nf NoteField) String() string

type NoteFieldsResponse

type NoteFieldsResponse struct {
	Success        bool           `json:"success,omitempty"`
	Data           []NoteField    `json:"data,omitempty"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

NoteFieldsResponse represents multiple note fields esponse.

type NoteFieldsService

type NoteFieldsService service

NoteFieldsService handles note field related methods of the Pipedrive API.

Pipedrive API dcos: https://developers.pipedrive.com/docs/api/v1/#!/ActivityTypes

func (*NoteFieldsService) List

List returns all fields for note.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/NoteFields/get_noteFields

type NoteResponse

type NoteResponse struct {
	Success bool `json:"success,omitempty"`
	Data    Note `json:"data,omitempty"`
}

NoteResponse represents a single note response.

type NoteUpdateOptions

type NoteUpdateOptions struct {
	Content                  string `url:"content"`
	DealID                   uint   `url:"deal_id"`
	PersonID                 uint   `url:"person_id"`
	OrgID                    uint   `url:"org_id"`
	PinnedToDealFlag         uint8  `url:"pinned_to_deal_flag"`
	PinnedToOrganizationFlag uint8  `url:"pinned_to_organization_flag"`
	PinnedToPersonFlag       uint8  `url:"pinned_to_person_flag"`
}

NoteUpdateOptions specifices the optional parameters to the NotesService.Update method.

type NotesResponse

type NotesResponse struct {
	Success        bool           `json:"success,omitempty"`
	Data           []Note         `json:"data,omitempty"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

NotesResponse represents multiple notes response.

type NotesService

type NotesService service

NotesService handles activities related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Notes

func (*NotesService) Create

Create a note.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Notes/get_notes_id

func (*NotesService) Delete

func (s *NotesService) Delete(ctx context.Context, id int) (*Response, error)

Delete marks note as deleted.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Notes/delete_notes_id

func (*NotesService) GetByID

func (s *NotesService) GetByID(ctx context.Context, id int) (*NoteResponse, *Response, error)

GetByID returns a specific note by id.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Notes/get_notes_id

func (*NotesService) List

List returns notes.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Notes/get_notes

func (*NotesService) Update

Update a specific note.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Notes/put_notes_id

type Option

type Option struct {
	ID    int    `json:"id,omitempty"`
	Label string `json:"label,omitempty"`
}

Option represents a Pipedrive option for note field.

type Organization

type Organization struct {
	ID           int                    `json:"id,omitempty"`
	Name         string                 `json:"name,omitempty"`
	OwnerID      int                    `json:"owner_id,omitempty"`
	AddTime      string                 `json:"add_time,omitempty"`
	UpdateTime   string                 `json:"update_time,omitempty"`
	Address      *Address               `json:"address,omitempty"`
	IsDeleted    bool                   `json:"is_deleted,omitempty"`
	VisibleTo    int                    `json:"visible_to,omitempty"`
	LabelIDs     []int                  `json:"label_ids,omitempty"`
	CustomFields map[string]interface{} `json:"custom_fields,omitempty"`
}

Organization represents a Pipedrive organization in the v2 API shape. The owner is a plain identifier, the address is a nested object and custom fields live in the CustomFields map.

func (Organization) String

func (o Organization) String() string

type OrganizationCreateOptions

type OrganizationCreateOptions struct {
	Name         string                 `json:"name,omitempty"`
	OwnerID      int                    `json:"owner_id,omitempty"`
	Address      *Address               `json:"address,omitempty"`
	VisibleTo    int                    `json:"visible_to,omitempty"`
	LabelIDs     []int                  `json:"label_ids,omitempty"`
	AddTime      string                 `json:"add_time,omitempty"`
	CustomFields map[string]interface{} `json:"custom_fields,omitempty"`
}

OrganizationCreateOptions specifies the parameters to the OrganizationsService.Create method.

type OrganizationField

type OrganizationField struct {
	ID                 int         `json:"id"`
	Key                string      `json:"key"`
	Name               string      `json:"name"`
	OrderNr            int         `json:"order_nr"`
	PicklistData       interface{} `json:"picklist_data,omitempty"`
	FieldType          string      `json:"field_type"`
	AddTime            string      `json:"add_time,omitempty"`
	UpdateTime         string      `json:"update_time,omitempty"`
	ActiveFlag         bool        `json:"active_flag"`
	EditFlag           bool        `json:"edit_flag"`
	IndexVisibleFlag   bool        `json:"index_visible_flag,omitempty"`
	DetailsVisibleFlag bool        `json:"details_visible_flag,omitempty"`
	AddVisibleFlag     bool        `json:"add_visible_flag,omitempty"`
	ImportantFlag      bool        `json:"important_flag,omitempty"`
	BulkEditAllowed    bool        `json:"bulk_edit_allowed,omitempty"`
	SearchableFlag     bool        `json:"searchable_flag,omitempty"`
	UseField           string      `json:"use_field,omitempty"`
	Link               string      `json:"link,omitempty"`
	MandatoryFlag      bool        `json:"mandatory_flag"`
	DisplayField       string      `json:"display_field,omitempty"`
	Options            []struct {
		ID    int    `json:"id"`
		Label string `json:"label"`
	} `json:"options,omitempty"`
	IsSubfield bool `json:"is_subfield,omitempty"`
}

OrganizationField represents a Pipedrive organization field.

func (OrganizationField) String

func (of OrganizationField) String() string

type OrganizationFieldCreateOptions

type OrganizationFieldCreateOptions struct {
	Name      string    `url:"name"`
	FieldType FieldType `url:"field_type"`
	Options   string    `url:"options"`
}

OrganizationFieldCreateOptions specifices the optional parameters to the OrganizationFieldsService.Create method.

type OrganizationFieldResponse

type OrganizationFieldResponse struct {
	Success        bool              `json:"success"`
	Data           OrganizationField `json:"data"`
	AdditionalData AdditionalData    `json:"additional_data"`
}

OrganizationFieldResponse represents single organization field response.

type OrganizationFieldUpdateOptions

type OrganizationFieldUpdateOptions struct {
	Name    string `url:"name"`
	Options string `url:"options"`
}

OrganizationFieldUpdateOptions specifices the optional parameters to the OrganizationFieldsService.Update method.

type OrganizationFieldsResponse

type OrganizationFieldsResponse struct {
	Success        bool                `json:"success"`
	Data           []OrganizationField `json:"data"`
	AdditionalData AdditionalData      `json:"additional_data"`
}

OrganizationFieldsResponse represents multiple organization fields response.

type OrganizationFieldsService

type OrganizationFieldsService service

OrganizationFieldsService handles organization fields related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/OrganizationFields

func (*OrganizationFieldsService) Delete

func (s *OrganizationFieldsService) Delete(ctx context.Context, id int) (*Response, error)

Delete marks a specific organization field as deleted.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/OrganizationFields/delete_organizationFields_id

func (*OrganizationFieldsService) DeleteMultiple

func (s *OrganizationFieldsService) DeleteMultiple(ctx context.Context, ids []int) (*Response, error)

DeleteMultiple marks organization fields as deleted.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/OrganizationFields/delete_organizationFields

func (*OrganizationFieldsService) GetByID

GetByID returns a specific organization field.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/OrganizationFields/get_organizationFields_id

func (*OrganizationFieldsService) List

List all organization fields within company.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/OrganizationFields/get_organizationFields

func (*OrganizationFieldsService) Update

Update a specific organization field.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/OrganizationFields/put_organizationFields_id

type OrganizationResponse

type OrganizationResponse struct {
	Success        bool           `json:"success"`
	Data           Organization   `json:"data"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

OrganizationResponse represents single organization response.

type OrganizationSearchItem added in v1.0.0

type OrganizationSearchItem struct {
	ResultScore float64      `json:"result_score,omitempty"`
	Item        Organization `json:"item,omitempty"`
}

OrganizationSearchItem represents one organizations search result.

type OrganizationUpdateOptions added in v1.0.0

type OrganizationUpdateOptions struct {
	Name         string                 `json:"name,omitempty"`
	OwnerID      int                    `json:"owner_id,omitempty"`
	Address      *Address               `json:"address,omitempty"`
	VisibleTo    int                    `json:"visible_to,omitempty"`
	LabelIDs     []int                  `json:"label_ids,omitempty"`
	CustomFields map[string]interface{} `json:"custom_fields,omitempty"`
}

OrganizationUpdateOptions specifies the parameters to the OrganizationsService.Update method.

type OrganizationsListOptions added in v1.0.0

type OrganizationsListOptions struct {
	FilterID      int    `url:"filter_id,omitempty"`
	OwnerID       int    `url:"owner_id,omitempty"`
	UpdatedSince  string `url:"updated_since,omitempty"`
	UpdatedUntil  string `url:"updated_until,omitempty"`
	SortBy        string `url:"sort_by,omitempty"`
	SortDirection string `url:"sort_direction,omitempty"`
	IncludeFields string `url:"include_fields,omitempty"`
	CustomFields  string `url:"custom_fields,omitempty"`
	IDs           string `url:"ids,omitempty"`

	CursorListOptions
}

OrganizationsListOptions specifies the optional parameters to the OrganizationsService.List method.

type OrganizationsResponse

type OrganizationsResponse struct {
	Success        bool           `json:"success"`
	Data           []Organization `json:"data"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

OrganizationsResponse represents multiple organizations response.

type OrganizationsSearchResponse added in v1.0.0

type OrganizationsSearchResponse struct {
	Success bool `json:"success,omitempty"`
	Data    struct {
		Items []OrganizationSearchItem `json:"items,omitempty"`
	} `json:"data,omitempty"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

OrganizationsSearchResponse represents the organizations search response.

type OrganizationsService

type OrganizationsService service

OrganizationsService handles organization related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Organizations

func (*OrganizationsService) Create

Create a new organization.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Organizations#addOrganization

func (*OrganizationsService) Delete

func (s *OrganizationsService) Delete(ctx context.Context, id int) (*Response, error)

Delete marks an organization as deleted.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Organizations#deleteOrganization

func (*OrganizationsService) DeleteFollower

func (s *OrganizationsService) DeleteFollower(ctx context.Context, id int, followerID int) (*Response, error)

DeleteFollower deletes a follower from an organization.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Organizations#deleteOrganizationFollower

func (*OrganizationsService) DeleteMultiple

func (s *OrganizationsService) DeleteMultiple(ctx context.Context, ids []int) (*Response, error)

DeleteMultiple deletes organizations one by one, since the v2 API does not expose a reliable bulk delete endpoint. The response of the last delete is returned; deletion stops at the first error.

func (*OrganizationsService) GetByID added in v1.0.0

GetByID returns details of a specific organization.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Organizations#getOrganization

func (*OrganizationsService) List

List all organizations.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Organizations#getOrganizations

func (*OrganizationsService) Merge

func (s *OrganizationsService) Merge(ctx context.Context, id int, mergeWithID int) (*OrganizationResponse, *Response, error)

Merge organizations.

This endpoint has no v2 equivalent and remains on the v1 API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Organizations#mergeOrganizations

func (*OrganizationsService) Search added in v1.0.0

Search organizations.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Organizations#searchOrganization

func (*OrganizationsService) Update added in v1.0.0

Update a specific organization.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Organizations#updateOrganization

type Pagination

type Pagination struct {
	Start                 int  `json:"start"`
	Limit                 int  `json:"limit"`
	MoreItemsInCollection bool `json:"more_items_in_collection"`
}

type Participant added in v1.0.0

type Participant struct {
	PersonID int  `json:"person_id,omitempty"`
	Primary  bool `json:"primary,omitempty"`
}

Participant represents a v2 activity participant.

type Person

type Person struct {
	ID           int                    `json:"id,omitempty"`
	Name         string                 `json:"name,omitempty"`
	FirstName    string                 `json:"first_name,omitempty"`
	LastName     string                 `json:"last_name,omitempty"`
	OwnerID      int                    `json:"owner_id,omitempty"`
	OrgID        int                    `json:"org_id,omitempty"`
	AddTime      string                 `json:"add_time,omitempty"`
	UpdateTime   string                 `json:"update_time,omitempty"`
	Emails       []ContactValue         `json:"emails,omitempty"`
	Phones       []ContactValue         `json:"phones,omitempty"`
	Ims          []ContactValue         `json:"ims,omitempty"`
	IsDeleted    bool                   `json:"is_deleted,omitempty"`
	VisibleTo    int                    `json:"visible_to,omitempty"`
	LabelIDs     []int                  `json:"label_ids,omitempty"`
	PictureID    int                    `json:"picture_id,omitempty"`
	CustomFields map[string]interface{} `json:"custom_fields,omitempty"`
}

Person represents a Pipedrive person in the v2 API shape. Related entities are plain identifiers, contact details are collections and custom fields live in the CustomFields map.

func (Person) String

func (p Person) String() string

type PersonAddFollowerResponse

type PersonAddFollowerResponse struct {
	Success bool `json:"success,omitempty"`
	Data    struct {
		UserID  int    `json:"user_id,omitempty"`
		AddTime string `json:"add_time,omitempty"`
	} `json:"data,omitempty"`
}

PersonAddFollowerResponse represents add follower response.

type PersonCreateOptions

type PersonCreateOptions struct {
	Name         string                 `json:"name,omitempty"`
	OwnerID      int                    `json:"owner_id,omitempty"`
	OrgID        int                    `json:"org_id,omitempty"`
	Emails       []ContactValue         `json:"emails,omitempty"`
	Phones       []ContactValue         `json:"phones,omitempty"`
	VisibleTo    int                    `json:"visible_to,omitempty"`
	LabelIDs     []int                  `json:"label_ids,omitempty"`
	AddTime      string                 `json:"add_time,omitempty"`
	CustomFields map[string]interface{} `json:"custom_fields,omitempty"`
}

PersonCreateOptions specifies the parameters to the PersonsService.Create method.

type PersonField

type PersonField struct {
	ID                 int         `json:"id"`
	Key                string      `json:"key"`
	Name               string      `json:"name"`
	OrderNr            int         `json:"order_nr"`
	PicklistData       interface{} `json:"picklist_data,omitempty"`
	FieldType          string      `json:"field_type"`
	AddTime            string      `json:"add_time"`
	UpdateTime         string      `json:"update_time"`
	ActiveFlag         bool        `json:"active_flag"`
	EditFlag           bool        `json:"edit_flag"`
	IndexVisibleFlag   bool        `json:"index_visible_flag"`
	DetailsVisibleFlag bool        `json:"details_visible_flag"`
	AddVisibleFlag     bool        `json:"add_visible_flag"`
	ImportantFlag      bool        `json:"important_flag"`
	BulkEditAllowed    bool        `json:"bulk_edit_allowed"`
	SearchableFlag     bool        `json:"searchable_flag"`
	FilteringAllowed   bool        `json:"filtering_allowed"`
	SortableFlag       bool        `json:"sortable_flag"`
	UseField           string      `json:"use_field,omitempty"`
	Link               string      `json:"link,omitempty"`
	MandatoryFlag      bool        `json:"mandatory_flag"`
	DisplayField       string      `json:"display_field,omitempty"`
	Autocomplete       string      `json:"autocomplete,omitempty"`
	Options            []struct {
		ID    int    `json:"id"`
		Label string `json:"label"`
	} `json:"options,omitempty"`
}

PersonField represents a Pipedrive person field.

type PersonFieldCreateOptions

type PersonFieldCreateOptions struct {
	Name      string    `url:"name"`
	FieldType FieldType `url:"field_type"`
	Options   string    `url:"options"`
}

PersonFieldCreateOptions specifices the optional parameters to the PersonFieldsService.Create method.

type PersonFieldResponse

type PersonFieldResponse struct {
	Success        bool           `json:"success"`
	Data           PersonField    `json:"data"`
	AdditionalData AdditionalData `json:"additional_data"`
}

PersonFieldResponse represents single person field response.

type PersonFieldUpdateOptions

type PersonFieldUpdateOptions struct {
	Name    string `url:"name"`
	Options string `url:"options"`
}

PersonFieldUpdateOptions specifices the optional parameters to the PersonFieldsService.Update method.

type PersonFieldsResponse

type PersonFieldsResponse struct {
	Success        bool           `json:"success"`
	Data           []PersonField  `json:"data"`
	AdditionalData AdditionalData `json:"additional_data"`
}

PersonFieldsResponse represents multiple person fields response.

type PersonFieldsService

type PersonFieldsService service

PersonFieldsService handles person fields related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/PersonFields

func (*PersonFieldsService) Delete

func (s *PersonFieldsService) Delete(ctx context.Context, id int) (*Response, error)

Delete marks person field as deleted.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/PersonFields/delete_personFields_id

func (*PersonFieldsService) DeleteMultiple

func (s *PersonFieldsService) DeleteMultiple(ctx context.Context, ids []int) (*Response, error)

DeleteMultiple marks multiple person fields as deleted.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/PersonFields/delete_personFields

func (*PersonFieldsService) GetByID

GetByID returns a specific person field.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/ProductFields/get_productFields_id

func (*PersonFieldsService) List

List all person fields.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/PersonFields/get_personFields

func (*PersonFieldsService) Update

Update a person field.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/PersonFields/put_personFields_id

type PersonResponse

type PersonResponse struct {
	Success        bool           `json:"success,omitempty"`
	Data           Person         `json:"data,omitempty"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

PersonResponse represents single person response.

type PersonSearchData added in v1.0.1

type PersonSearchData struct {
	ID        int      `json:"id,omitempty"`
	Type      string   `json:"type,omitempty"`
	Name      string   `json:"name,omitempty"`
	Phones    []string `json:"phones,omitempty"`
	Emails    []string `json:"emails,omitempty"`
	VisibleTo int      `json:"visible_to,omitempty"`
	Owner     struct {
		ID int `json:"id,omitempty"`
	} `json:"owner,omitempty"`
	Organization struct {
		ID      int         `json:"id,omitempty"`
		Name    string      `json:"name,omitempty"`
		Address interface{} `json:"address,omitempty"`
	} `json:"organization,omitempty"`
	CustomFields []interface{} `json:"custom_fields,omitempty"`
	Notes        []string      `json:"notes,omitempty"`
}

PersonSearchData represents the flattened search item.

type PersonSearchItem added in v1.0.0

type PersonSearchItem struct {
	ResultScore float64          `json:"result_score,omitempty"`
	Item        PersonSearchData `json:"item,omitempty"`
}

PersonSearchItem represents one person search result.

type PersonUpdateOptions

type PersonUpdateOptions struct {
	Name         string                 `json:"name,omitempty"`
	OwnerID      int                    `json:"owner_id,omitempty"`
	OrgID        int                    `json:"org_id,omitempty"`
	Emails       []ContactValue         `json:"emails,omitempty"`
	Phones       []ContactValue         `json:"phones,omitempty"`
	VisibleTo    int                    `json:"visible_to,omitempty"`
	LabelIDs     []int                  `json:"label_ids,omitempty"`
	CustomFields map[string]interface{} `json:"custom_fields,omitempty"`
}

PersonUpdateOptions specifies the parameters to the PersonsService.Update method.

type PersonsListOptions added in v1.0.0

type PersonsListOptions struct {
	FilterID      int    `url:"filter_id,omitempty"`
	OwnerID       int    `url:"owner_id,omitempty"`
	OrgID         int    `url:"org_id,omitempty"`
	UpdatedSince  string `url:"updated_since,omitempty"`
	UpdatedUntil  string `url:"updated_until,omitempty"`
	SortBy        string `url:"sort_by,omitempty"`
	SortDirection string `url:"sort_direction,omitempty"`
	IncludeFields string `url:"include_fields,omitempty"`
	CustomFields  string `url:"custom_fields,omitempty"`
	IDs           string `url:"ids,omitempty"`

	CursorListOptions
}

PersonsListOptions specifies the optional parameters to the PersonsService.List method.

type PersonsResponse

type PersonsResponse struct {
	Success        bool           `json:"success,omitempty"`
	Data           []Person       `json:"data,omitempty"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

PersonsResponse represents multiple persons response.

type PersonsSearchResponse

type PersonsSearchResponse struct {
	Success bool `json:"success,omitempty"`
	Data    struct {
		Items []PersonSearchItem `json:"items,omitempty"`
	} `json:"data,omitempty"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

PersonsSearchResponse represents the persons search response.

type PersonsService

type PersonsService service

PersonsService handles persons related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Persons

func (*PersonsService) AddFollower

func (s *PersonsService) AddFollower(ctx context.Context, id int, userID int) (*PersonAddFollowerResponse, *Response, error)

AddFollower adds a follower to person.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Persons#addPersonFollower

func (*PersonsService) Create

Create a new person.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Persons#addPerson

func (*PersonsService) Delete

func (s *PersonsService) Delete(ctx context.Context, id int) (*Response, error)

Delete marks person as deleted.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Persons#deletePerson

func (*PersonsService) DeleteFollower

func (s *PersonsService) DeleteFollower(ctx context.Context, id int, followerID int) (*Response, error)

DeleteFollower removes follower from person.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Persons#deletePersonFollower

func (*PersonsService) DeleteMultiple

func (s *PersonsService) DeleteMultiple(ctx context.Context, ids []int) (*Response, error)

DeleteMultiple deletes persons one by one, since the v2 API does not expose a reliable bulk delete endpoint. The response of the last delete is returned; deletion stops at the first error.

func (*PersonsService) DeletePicture

func (s *PersonsService) DeletePicture(ctx context.Context, id int) (*Response, error)

DeletePicture deletes person picture.

This endpoint has no v2 equivalent and remains on the v1 API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Persons#deletePersonPicture

func (*PersonsService) Get

Get a specific person.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Persons#getPerson

func (*PersonsService) List

List all persons.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Persons#getPersons

func (*PersonsService) ListActivities

func (s *PersonsService) ListActivities(ctx context.Context, id int) (*ActivitiesReponse, *Response, error)

ListActivities lists activities associated to a person, using the v2 activities endpoint filtered by person.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Activities#getActivities

func (*PersonsService) ListDeals

func (s *PersonsService) ListDeals(ctx context.Context, id int) (*DealsResponse, *Response, error)

ListDeals lists deals associated to a person, using the v2 deals endpoint filtered by person.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Deals#getDeals

func (*PersonsService) Merge

func (s *PersonsService) Merge(ctx context.Context, id int, mergeWithID int) (*PersonResponse, *Response, error)

Merge selected persons.

This endpoint has no v2 equivalent and remains on the v1 API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Persons#mergePersons

func (*PersonsService) Search

Search persons.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Persons#searchPersons

func (*PersonsService) Update

Update a specific person.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Persons#updatePerson

type Pipeline

type Pipeline struct {
	ID                       int    `json:"id,omitempty"`
	Name                     string `json:"name,omitempty"`
	OrderNr                  int    `json:"order_nr"`
	IsSelected               bool   `json:"is_selected,omitempty"`
	IsDeleted                bool   `json:"is_deleted,omitempty"`
	IsDealProbabilityEnabled bool   `json:"is_deal_probability_enabled,omitempty"`
	AddTime                  string `json:"add_time,omitempty"`
	UpdateTime               string `json:"update_time,omitempty"`
}

Pipeline represents a Pipedrive pipeline in the v2 API shape.

func (Pipeline) String

func (p Pipeline) String() string

type PipelineCreateOptions

type PipelineCreateOptions struct {
	Name                     string `json:"name,omitempty"`
	IsDealProbabilityEnabled *bool  `json:"is_deal_probability_enabled,omitempty"`
}

PipelineCreateOptions specifies the parameters to the PipelinesService.Create method.

type PipelineDealsConversionRateResponse

type PipelineDealsConversionRateResponse struct {
	Success bool `json:"success,omitempty"`
	Data    struct {
		StageConversions []struct {
			FromStageID    int     `json:"from_stage_id,omitempty"`
			ToStageID      int     `json:"to_stage_id,omitempty"`
			ConversionRate float64 `json:"conversion_rate,omitempty"`
		} `json:"stage_conversions,omitempty"`
		WonConversion  float64 `json:"won_conversion,omitempty"`
		LostConversion float64 `json:"lost_conversion,omitempty"`
	} `json:"data,omitempty"`
}

PipelineDealsConversionRateResponse represents conversion response.

type PipelineDealsMovementResponse

type PipelineDealsMovementResponse struct {
	Success bool `json:"success,omitempty"`
	Data    struct {
		MovementsBetweenStages struct {
			Count int `json:"count,omitempty"`
		} `json:"movements_between_stages,omitempty"`
		NewDeals struct {
			Count   int   `json:"count,omitempty"`
			DealIds []int `json:"deal_ids,omitempty"`
			Values  struct {
				EUR float64 `json:"EUR,omitempty"`
			} `json:"values,omitempty"`
			FormattedValues struct {
				EUR string `json:"EUR,omitempty"`
			} `json:"formatted_values,omitempty"`
		} `json:"new_deals,omitempty"`
		DealsLeftOpen struct {
			Count   int   `json:"count,omitempty"`
			DealIds []int `json:"deal_ids,omitempty"`
			Values  struct {
				EUR float64 `json:"EUR,omitempty"`
			} `json:"values,omitempty"`
			FormattedValues struct {
				EUR string `json:"EUR,omitempty"`
			} `json:"formatted_values,omitempty"`
		} `json:"deals_left_open,omitempty"`
		WonDeals struct {
			Count   int   `json:"count,omitempty"`
			DealIds []int `json:"deal_ids,omitempty"`
			Values  struct {
				EUR int `json:"EUR,omitempty"`
			} `json:"values,omitempty"`
			FormattedValues struct {
				EUR string `json:"EUR,omitempty"`
			} `json:"formatted_values,omitempty"`
		} `json:"won_deals,omitempty"`
		LostDeals struct {
			Count   int   `json:"count,omitempty"`
			DealIds []int `json:"deal_ids,omitempty"`
			Values  struct {
				EUR int `json:"EUR,omitempty"`
			} `json:"values,omitempty"`
			FormattedValues struct {
				EUR string `json:"EUR,omitempty"`
			} `json:"formatted_values,omitempty"`
		} `json:"lost_deals,omitempty"`
		AverageAgeInDays struct {
			AcrossAllStages float64 `json:"across_all_stages,omitempty"`
			ByStages        []struct {
				StageID int `json:"stage_id,omitempty"`
				Value   int `json:"value,omitempty"`
			} `json:"by_stages,omitempty"`
		} `json:"average_age_in_days,omitempty"`
	} `json:"data,omitempty"`
}

PipelineDealsMovementResponse represents movement response.

type PipelineResponse

type PipelineResponse struct {
	Success        bool           `json:"success,omitempty"`
	Data           Pipeline       `json:"data,omitempty"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

PipelineResponse represents single pipeline response.

type PipelineUpdateOptions

type PipelineUpdateOptions struct {
	Name                     string `json:"name,omitempty"`
	IsDealProbabilityEnabled *bool  `json:"is_deal_probability_enabled,omitempty"`
}

PipelineUpdateOptions specifies the parameters to the PipelinesService.Update method.

type PipelinesListOptions added in v1.0.0

type PipelinesListOptions struct {
	SortBy        string `url:"sort_by,omitempty"`
	SortDirection string `url:"sort_direction,omitempty"`

	CursorListOptions
}

PipelinesListOptions specifies the optional parameters to the PipelinesService.List method.

type PipelinesResponse

type PipelinesResponse struct {
	Success        bool           `json:"success,omitempty"`
	Data           []Pipeline     `json:"data,omitempty"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

PipelinesResponse represents multiple pipelines response.

type PipelinesService

type PipelinesService service

PipelinesService handles pipelines related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Pipelines

func (*PipelinesService) Create

Create a new pipeline.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Pipelines#addPipeline

func (*PipelinesService) Delete

func (s *PipelinesService) Delete(ctx context.Context, id int) (*Response, error)

Delete marks a specific pipeline as deleted.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Pipelines#deletePipeline

func (*PipelinesService) GetByID

GetByID returns data about a specific pipeline.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Pipelines#getPipeline

func (*PipelinesService) GetDeals

func (s *PipelinesService) GetDeals(ctx context.Context, id int) (*DealsResponse, *Response, error)

GetDeals returns deals in a specific pipeline, using the v2 deals endpoint filtered by pipeline.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Deals#getDeals

func (*PipelinesService) GetDealsConversionRate

func (s *PipelinesService) GetDealsConversionRate(ctx context.Context, id int, startDate Timestamp, endDate Timestamp) (*PipelineDealsConversionRateResponse, *Response, error)

GetDealsConversionRate returns deals conversion rate in a specific pipeline.

This endpoint has no v2 equivalent and remains on the v1 API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Pipelines#getPipelineConversionStatistics

func (*PipelinesService) GetDealsMovement

func (s *PipelinesService) GetDealsMovement(ctx context.Context, id int, startDate Timestamp, endDate Timestamp) (*PipelineDealsMovementResponse, *Response, error)

GetDealsMovement returns deals movement in a specific pipeline.

This endpoint has no v2 equivalent and remains on the v1 API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Pipelines#getPipelineMovementStatistics

func (*PipelinesService) List

List returns data about all pipelines.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Pipelines#getPipelines

func (*PipelinesService) Update

Update a specific pipeline.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Pipelines#updatePipeline

type Product

type Product struct {
	ID                     int                    `json:"id,omitempty"`
	Name                   string                 `json:"name,omitempty"`
	Code                   string                 `json:"code,omitempty"`
	Description            string                 `json:"description,omitempty"`
	Unit                   string                 `json:"unit,omitempty"`
	Tax                    float64                `json:"tax,omitempty"`
	Category               string                 `json:"category,omitempty"`
	OwnerID                int                    `json:"owner_id,omitempty"`
	IsLinkable             bool                   `json:"is_linkable,omitempty"`
	IsDeleted              bool                   `json:"is_deleted,omitempty"`
	VisibleTo              int                    `json:"visible_to,omitempty"`
	Prices                 []ProductPrice         `json:"prices,omitempty"`
	BillingFrequency       string                 `json:"billing_frequency,omitempty"`
	BillingFrequencyCycles int                    `json:"billing_frequency_cycles,omitempty"`
	AddTime                string                 `json:"add_time,omitempty"`
	UpdateTime             string                 `json:"update_time,omitempty"`
	CustomFields           map[string]interface{} `json:"custom_fields,omitempty"`
}

Product represents a Pipedrive product in the v2 API shape.

func (Product) String

func (p Product) String() string

type ProductAttachedDealsResponse

type ProductAttachedDealsResponse struct {
	Success        bool           `json:"success"`
	Data           []Deal         `json:"data"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

ProductAttachedDealsResponse represents attached deals response.

type ProductCreateOptions

type ProductCreateOptions struct {
	Name                   string                 `json:"name,omitempty"`
	Code                   string                 `json:"code,omitempty"`
	Description            string                 `json:"description,omitempty"`
	Unit                   string                 `json:"unit,omitempty"`
	Tax                    float64                `json:"tax,omitempty"`
	IsLinkable             *bool                  `json:"is_linkable,omitempty"`
	VisibleTo              int                    `json:"visible_to,omitempty"`
	OwnerID                int                    `json:"owner_id,omitempty"`
	Prices                 []ProductPrice         `json:"prices,omitempty"`
	BillingFrequency       string                 `json:"billing_frequency,omitempty"`
	BillingFrequencyCycles int                    `json:"billing_frequency_cycles,omitempty"`
	CustomFields           map[string]interface{} `json:"custom_fields,omitempty"`
}

ProductCreateOptions specifies the parameters to the ProductsService.Create method.

type ProductField

type ProductField struct {
	ID                 int         `json:"id"`
	Key                string      `json:"key"`
	Name               string      `json:"name"`
	OrderNr            int         `json:"order_nr"`
	PicklistData       interface{} `json:"picklist_data,omitempty"`
	FieldType          string      `json:"field_type"`
	AddTime            string      `json:"add_time"`
	UpdateTime         string      `json:"update_time"`
	ActiveFlag         bool        `json:"active_flag"`
	EditFlag           bool        `json:"edit_flag"`
	IndexVisibleFlag   bool        `json:"index_visible_flag"`
	DetailsVisibleFlag bool        `json:"details_visible_flag"`
	AddVisibleFlag     bool        `json:"add_visible_flag"`
	ImportantFlag      bool        `json:"important_flag"`
	BulkEditAllowed    bool        `json:"bulk_edit_allowed"`
	SearchableFlag     bool        `json:"searchable_flag"`
	FilteringAllowed   bool        `json:"filtering_allowed"`
	SortableFlag       bool        `json:"sortable_flag"`
	UseField           string      `json:"use_field,omitempty"`
	Link               string      `json:"link,omitempty"`
	MandatoryFlag      bool        `json:"mandatory_flag"`
	DisplayField       string      `json:"display_field,omitempty"`
	Options            []struct {
		ID    bool   `json:"id"`
		Label string `json:"label"`
	} `json:"options,omitempty"`
}

ProductField represents a Pipedrive product field.

func (ProductField) String

func (p ProductField) String() string

type ProductFieldCreateOptions

type ProductFieldCreateOptions struct {
	Name      string    `url:"name"`
	FieldType FieldType `url:"field_type"`
	Options   string    `url:"options"`
}

ProductFieldCreateOptions specifices the optional parameters to the ProductFieldsService.Create method.

type ProductFieldResponse

type ProductFieldResponse struct {
	Success        bool           `json:"success"`
	Data           ProductField   `json:"data"`
	AdditionalData AdditionalData `json:"additional_data"`
}

ProductFieldResponse represents single product field response.

type ProductFieldUpdateOptions

type ProductFieldUpdateOptions struct {
	Name    string `url:"name"`
	Options string `url:"options"`
}

ProductFieldUpdateOptions specifices the optional parameters to the ProductFieldsService.Update method.

type ProductFieldsResponse

type ProductFieldsResponse struct {
	Success        bool           `json:"success"`
	Data           []ProductField `json:"data"`
	AdditionalData AdditionalData `json:"additional_data"`
}

ProductFieldsResponse represents multiple product fields response.

type ProductFieldsService

type ProductFieldsService service

ProductFieldsService handles pipelines related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/ProductFields

func (*ProductFieldsService) Create

Create a new product field.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/ProductFields/post_productFields

func (*ProductFieldsService) Delete

func (s *ProductFieldsService) Delete(ctx context.Context, id int) (*Response, error)

Delete marks a specific product field as deleted.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/ProductFields/delete_productFields_id

func (*ProductFieldsService) DeleteMultiple

func (s *ProductFieldsService) DeleteMultiple(ctx context.Context, ids []int) (*Response, error)

DeleteMultiple marks multiple product fields as deleted.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/ProductFields/delete_productFields

func (*ProductFieldsService) GetByID

GetByID returns a specific product field.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/ProductFields/get_productFields_id

func (*ProductFieldsService) List

List returns all data about product fields.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/ProductFields/get_productFields

func (*ProductFieldsService) Update

Update a specific product field.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/ProductFields/put_productFields_id

type ProductPrice added in v1.0.0

type ProductPrice struct {
	ProductID  int     `json:"product_id,omitempty"`
	Price      float64 `json:"price,omitempty"`
	Currency   string  `json:"currency,omitempty"`
	Cost       float64 `json:"cost,omitempty"`
	DirectCost float64 `json:"direct_cost,omitempty"`
}

ProductPrice represents a v2 product price entry.

type ProductResponse

type ProductResponse struct {
	Success        bool           `json:"success"`
	Data           Product        `json:"data"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

ProductResponse represents single product response.

type ProductSearchItem added in v1.0.0

type ProductSearchItem struct {
	ResultScore float64 `json:"result_score,omitempty"`
	Item        Product `json:"item,omitempty"`
}

ProductSearchItem represents one products search result.

type ProductUpdateOptions

type ProductUpdateOptions struct {
	Name                   string                 `json:"name,omitempty"`
	Code                   string                 `json:"code,omitempty"`
	Description            string                 `json:"description,omitempty"`
	Unit                   string                 `json:"unit,omitempty"`
	Tax                    float64                `json:"tax,omitempty"`
	IsLinkable             *bool                  `json:"is_linkable,omitempty"`
	VisibleTo              int                    `json:"visible_to,omitempty"`
	OwnerID                int                    `json:"owner_id,omitempty"`
	Prices                 []ProductPrice         `json:"prices,omitempty"`
	BillingFrequency       string                 `json:"billing_frequency,omitempty"`
	BillingFrequencyCycles int                    `json:"billing_frequency_cycles,omitempty"`
	CustomFields           map[string]interface{} `json:"custom_fields,omitempty"`
}

ProductUpdateOptions specifies the parameters to the ProductsService.Update method.

type ProductsListOptions added in v1.0.0

type ProductsListOptions struct {
	FilterID      int    `url:"filter_id,omitempty"`
	OwnerID       int    `url:"owner_id,omitempty"`
	SortBy        string `url:"sort_by,omitempty"`
	SortDirection string `url:"sort_direction,omitempty"`
	CustomFields  string `url:"custom_fields,omitempty"`
	IDs           string `url:"ids,omitempty"`

	CursorListOptions
}

ProductsListOptions specifies the optional parameters to the ProductsService.List method.

type ProductsResponse

type ProductsResponse struct {
	Success        bool           `json:"success"`
	Data           []Product      `json:"data"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

ProductsResponse represents multiple products response.

type ProductsSearchResponse added in v1.0.0

type ProductsSearchResponse struct {
	Success bool `json:"success,omitempty"`
	Data    struct {
		Items []ProductSearchItem `json:"items,omitempty"`
	} `json:"data,omitempty"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

ProductsSearchResponse represents the products search response.

type ProductsService

type ProductsService service

ProductsService handles products related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Products

func (*ProductsService) Create

Create a new product.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Products#addProduct

func (*ProductsService) Delete

func (s *ProductsService) Delete(ctx context.Context, id int) (*Response, error)

Delete a specific product.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Products#deleteProduct

func (*ProductsService) DeleteFollower

func (s *ProductsService) DeleteFollower(ctx context.Context, id int, followerID int) (*Response, error)

DeleteFollower removes follower from a specific product.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Products#deleteProductFollower

func (*ProductsService) GetAttachedDeals

func (s *ProductsService) GetAttachedDeals(ctx context.Context, id int) (*ProductAttachedDealsResponse, *Response, error)

GetAttachedDeals returns product attached deals.

This endpoint has no v2 equivalent and remains on the v1 API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Products#getProductDeals

func (*ProductsService) GetByID

func (s *ProductsService) GetByID(ctx context.Context, id int) (*ProductResponse, *Response, error)

GetByID returns a specific product.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Products#getProduct

func (*ProductsService) List

List returns all data about products.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Products#getProducts

func (*ProductsService) Search added in v1.0.0

Search products.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Products#searchProducts

func (*ProductsService) Update

Update a specific product.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Products#updateProduct

type Rate

type Rate struct {
	Limit     int       `json:"limit"`
	Remaining int       `json:"remaining"`
	Reset     Timestamp `json:"reset"`
}

func (Rate) String

func (r Rate) String() string

type RateLimitError

type RateLimitError struct {
	Rate     Rate
	Response *http.Response
	Message  string
}

RateLimitError occurs when Pipedrive returns 403 Forbidden response with a rate limit remaining value of 0.

func (*RateLimitError) Error

func (e *RateLimitError) Error() string

type RecentRecord

type RecentRecord struct {
	Item string                `json:"item"`
	ID   int                   `json:"id"`
	Data []RecentRecordDetails `json:"data"`
}

RecentRecord represents a Pipedrive recent record.

type RecentRecordDetails

type RecentRecordDetails struct {
	ID                  int    `json:"id"`
	Name                string `json:"name"`
	DefaultCurrency     string `json:"default_currency"`
	Locale              string `json:"locale"`
	Lang                int    `json:"lang"`
	Email               string `json:"email"`
	Phone               string `json:"phone"`
	Activated           bool   `json:"activated"`
	LastLogin           string `json:"last_login"`
	Created             string `json:"created"`
	Modified            string `json:"modified"`
	SignupFlowVariation string `json:"signup_flow_variation"`
	HasCreatedCompany   bool   `json:"has_created_company"`
	IsAdmin             int    `json:"is_admin"`
	TimezoneName        string `json:"timezone_name"`
	TimezoneOffset      string `json:"timezone_offset"`
	ActiveFlag          bool   `json:"active_flag"`
	RoleID              int    `json:"role_id"`
	IconURL             string `json:"icon_url"`
	IsYou               bool   `json:"is_you"`
}

RecentRecordDetails represents a Pipedrive recent record details.

func (RecentRecordDetails) String

func (rrd RecentRecordDetails) String() string

type RecentsListOptions

type RecentsListOptions struct {
	SinceTimestamp string `url:"since_timestamp,omitempty"`
	Items          string `url:"items,omitempty"`
	Start          uint   `url:"start,omitempty"`
	Limit          uint   `url:"limit,omitempty"`
}

RecentsListOptions specifices the optional parameters to the RecentsService.List method.

type RecentsResponse

type RecentsResponse struct {
	Success        bool           `json:"success"`
	Data           []RecentRecord `json:"data"`
	AdditionalData AdditionalData `json:"additional_data"`
}

RecentsResponse represents multiple recents response.

type RecentsService

type RecentsService service

RecentsService handles activities related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Recents

func (*RecentsService) List

List returns data about all recent changes occured after given timestamp.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Recents/get_recents

type Response

type Response struct {
	*http.Response
	Rate
}

type SearchOptions

type SearchOptions struct {
	Term          string `url:"term,omitempty"`
	Fields        string `url:"fields,omitempty"`
	ExactMatch    bool   `url:"exact_match,omitempty"`
	IncludeFields string `url:"include_fields,omitempty"`
	Cursor        string `url:"cursor,omitempty"`
	Limit         int    `url:"limit,omitempty"`
}

SearchOptions holds the common parameters of the v2 entity search endpoints (/deals/search, /persons/search, /organizations/search, /products/search).

type SearchResultItem added in v1.0.0

type SearchResultItem struct {
	ResultScore float64         `json:"result_score,omitempty"`
	Item        json.RawMessage `json:"item,omitempty"`
}

SearchResultItem represents one item search result. The Item payload shape depends on the entity type of the result, so it is left as raw JSON for the caller to decode into the matching entity type.

func (SearchResultItem) String added in v1.0.0

func (sr SearchResultItem) String() string

type SearchResults

type SearchResults struct {
	Success bool `json:"success"`
	Data    struct {
		Items        []SearchResultItem `json:"items,omitempty"`
		RelatedItems []SearchResultItem `json:"related_items,omitempty"`
	} `json:"data,omitempty"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

SearchResults represents the item search response.

type SearchResultsService

type SearchResultsService service

SearchResultsService handles cross-entity search related methods of the Pipedrive API, backed by the v2 itemSearch endpoints.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/ItemSearch

func (*SearchResultsService) Search

Search performs a search from all items across the account.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem

func (*SearchResultsService) SearchField added in v1.0.0

SearchField performs a search from the values of a specific field.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItemByField

type Stage

type Stage struct {
	ID               int    `json:"id,omitempty"`
	OrderNr          int    `json:"order_nr"`
	Name             string `json:"name,omitempty"`
	IsDeleted        bool   `json:"is_deleted,omitempty"`
	DealProbability  int    `json:"deal_probability,omitempty"`
	PipelineID       int    `json:"pipeline_id,omitempty"`
	IsDealRotEnabled bool   `json:"is_deal_rot_enabled,omitempty"`
	DaysToRotten     int    `json:"days_to_rotten,omitempty"`
	AddTime          string `json:"add_time,omitempty"`
	UpdateTime       string `json:"update_time,omitempty"`
}

Stage represents a Pipedrive stage in the v2 API shape.

func (Stage) String

func (s Stage) String() string

type StageResponse

type StageResponse struct {
	Success bool  `json:"success"`
	Data    Stage `json:"data"`
}

StageResponse represents single stage response.

type StagesCreateOptions

type StagesCreateOptions struct {
	Name             string `json:"name,omitempty"`
	PipelineID       int    `json:"pipeline_id,omitempty"`
	DealProbability  int    `json:"deal_probability,omitempty"`
	IsDealRotEnabled *bool  `json:"is_deal_rot_enabled,omitempty"`
	DaysToRotten     int    `json:"days_to_rotten,omitempty"`
}

StagesCreateOptions specifies the parameters to the StagesService.Create method.

type StagesGetDealsInStageOptions

type StagesGetDealsInStageOptions struct {
	FilterID int `url:"filter_id,omitempty"`
	OwnerID  int `url:"owner_id,omitempty"`

	CursorListOptions
}

StagesGetDealsInStageOptions specifies the optional parameters to the StagesService.GetDealsInStage method.

type StagesListOptions

type StagesListOptions struct {
	PipelineID    int    `url:"pipeline_id,omitempty"`
	SortBy        string `url:"sort_by,omitempty"`
	SortDirection string `url:"sort_direction,omitempty"`

	CursorListOptions
}

StagesListOptions specifies the optional parameters to the StagesService.List method.

type StagesResponse

type StagesResponse struct {
	Success        bool           `json:"success"`
	Data           []Stage        `json:"data"`
	AdditionalData AdditionalData `json:"additional_data,omitempty"`
}

StagesResponse represents multiple stages response.

type StagesService

type StagesService service

StagesService handles stages related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Stages

func (*StagesService) Create

Create a new stage, returns the ID upon success.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Stages#addStage

func (*StagesService) Delete

func (s *StagesService) Delete(ctx context.Context, id int) (*Response, error)

Delete marks a stage as deleted.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Stages#deleteStage

func (*StagesService) DeleteMultiple

func (s *StagesService) DeleteMultiple(ctx context.Context, ids []int) (*Response, error)

DeleteMultiple deletes stages one by one, since the v2 API does not expose a reliable bulk delete endpoint. The response of the last delete is returned; deletion stops at the first error.

func (*StagesService) GetByID

func (s *StagesService) GetByID(ctx context.Context, id int) (*StageResponse, *Response, error)

GetByID returns data about a specific stage.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Stages#getStage

func (*StagesService) GetDealsInStage

func (s *StagesService) GetDealsInStage(ctx context.Context, id int, opt *StagesGetDealsInStageOptions) (*DealsResponse, *Response, error)

GetDealsInStage lists deals in a specific stage, using the v2 deals endpoint filtered by stage.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Deals#getDeals

func (*StagesService) List

List returns data about all stages.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Stages#getStages

func (*StagesService) Update

Update the properties of a stage.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/Stages#updateStage

type StagesUpdateOptions

type StagesUpdateOptions struct {
	Name             string `json:"name,omitempty"`
	PipelineID       int    `json:"pipeline_id,omitempty"`
	OrderNr          int    `json:"order_nr"`
	DealProbability  int    `json:"deal_probability,omitempty"`
	IsDealRotEnabled *bool  `json:"is_deal_rot_enabled,omitempty"`
	DaysToRotten     int    `json:"days_to_rotten,omitempty"`
}

StagesUpdateOptions specifies the parameters to the StagesService.Update method.

type Timestamp

type Timestamp struct {
	time.Time
}

func (Timestamp) Format

func (t Timestamp) Format() string

func (Timestamp) FormatFull

func (t Timestamp) FormatFull() string

func (Timestamp) String

func (t Timestamp) String() string

func (*Timestamp) UnmarshalJSON added in v1.0.0

func (t *Timestamp) UnmarshalJSON(data []byte) error

UnmarshalJSON accepts RFC 3339 and legacy v1 timestamps.

type UpdateFileDetailsOptions

type UpdateFileDetailsOptions struct {
	Name        string `url:"name"`
	Description string `url:"description"`
}

UpdateFileDetailsOptions specifices the optional parameters to the FilesService.Update method.

type User

type User struct {
	ID                int      `json:"id"`
	Name              string   `json:"name"`
	DefaultCurrency   string   `json:"default_currency"`
	Locale            string   `json:"locale"`
	Lang              int      `json:"lang"`
	Email             string   `json:"email"`
	Phone             string   `json:"phone"`
	Activated         bool     `json:"activated"`
	LastLogin         string   `json:"last_login"`
	Created           string   `json:"created"`
	Modified          string   `json:"modified"`
	HasCreatedCompany bool     `json:"has_created_company"`
	Access            []Access `json:"access"`
	ActiveFlag        bool     `json:"active_flag"`
	TimezoneName      string   `json:"timezone_name"`
	TimezoneOffset    string   `json:"timezone_offset"`
	RoleID            int      `json:"role_id"`
	IconURL           string   `json:"icon_url"`
	IsYou             bool     `json:"is_you"`
	CompanyID         int      `json:"company_id"`
	CompanyName       string   `json:"company_name"`
	CompanyDomain     string   `json:"company_domain"`
	CompanyCountry    string   `json:"company_country"`
	CompanyIndustry   string   `json:"company_industry"`
	Language          Language `json:"language"`
}

User represents a Pipedrive user.

func (User) String

func (u User) String() string

type UserConnections

type UserConnections struct {
	Success bool `json:"success"`
	Data    struct {
		Google string `json:"google"`
	} `json:"data"`
}

UserConnections represents a Pipedrive user connections.

type UserConnectionsService

type UserConnectionsService service

UserConnectionsService handles activities related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/UserConnections

func (*UserConnectionsService) List

List returns data about all connections for authorized user.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/UserConnections/get_userConnections

type UserCreateOptions

type UserCreateOptions struct {
	Name       string `url:"name"`
	Email      string `url:"email"`
	ActiveFlag uint8  `url:"active_flag"`
}

UserCreateOptions specifices the optional parameters to the UsersService.Create method.

type UserFollowersResponse

type UserFollowersResponse struct {
	Success        bool           `json:"success"`
	Data           []int          `json:"data"`
	AdditionalData AdditionalData `json:"additional_data"`
}

UserFollowersResponse represents user followers response.

type UserPermissionsResponse

type UserPermissionsResponse struct {
	Success bool `json:"success"`
	Data    struct {
		CanAddProducts              bool `json:"can_add_products"`
		CanBulkEditItems            bool `json:"can_bulk_edit_items"`
		CanChangeVisibilityOfItems  bool `json:"can_change_visibility_of_items"`
		CanDeleteActivities         bool `json:"can_delete_activities"`
		CanDeleteDeals              bool `json:"can_delete_deals"`
		CanEditDealsClosedDate      bool `json:"can_edit_deals_closed_date"`
		CanEditProducts             bool `json:"can_edit_products"`
		CanEditSharedFilters        bool `json:"can_edit_shared_filters"`
		CanExportDataFromLists      bool `json:"can_export_data_from_lists"`
		CanFollowOtherUsers         bool `json:"can_follow_other_users"`
		CanMergeDeals               bool `json:"can_merge_deals"`
		CanMergeOrganizations       bool `json:"can_merge_organizations"`
		CanMergePeople              bool `json:"can_merge_people"`
		CanSeeCompanyWideStatistics bool `json:"can_see_company_wide_statistics"`
		CanSeeDealsListSummary      bool `json:"can_see_deals_list_summary"`
		CanSeeHiddenItemsNames      bool `json:"can_see_hidden_items_names"`
		CanSeeOtherUsers            bool `json:"can_see_other_users"`
		CanSeeOtherUsersStatistics  bool `json:"can_see_other_users_statistics"`
		CanShareFilters             bool `json:"can_share_filters"`
		CanUseAPI                   bool `json:"can_use_api"`
	} `json:"data"`
}

UserPermissionsResponse represents user permissions response.

type UserRoleSettingsResponse

type UserRoleSettingsResponse struct {
	Success bool `json:"success"`
	Data    struct {
		DealDefaultVisibility    int `json:"deal_default_visibility"`
		OrgDefaultVisibility     int `json:"org_default_visibility"`
		PersonDefaultVisibility  int `json:"person_default_visibility"`
		ProductDefaultVisibility int `json:"product_default_visibility"`
		DealAccessLevel          int `json:"deal_access_level"`
		OrgAccessLevel           int `json:"org_access_level"`
		PersonAccessLevel        int `json:"person_access_level"`
		ProductAccessLevel       int `json:"product_access_level"`
	} `json:"data"`
}

UserRoleSettingsResponse represents user role settings response.

type UserSettings

type UserSettings struct {
	Success bool `json:"success"`
	Data    struct {
		ShowGettingStartedVideo                 bool          `json:"show_getting_started_video"`
		ListLimit                               int           `json:"list_limit"`
		BetaApp                                 bool          `json:"beta_app"`
		FileUploadDestination                   string        `json:"file_upload_destination"`
		CalltoLinkSyntax                        string        `json:"callto_link_syntax"`
		AutofillDealExpectedCloseDate           bool          `json:"autofill_deal_expected_close_date"`
		PersonDuplicateCondition                string        `json:"person_duplicate_condition"`
		OrganizationDuplicateCondition          string        `json:"organization_duplicate_condition"`
		AddFollowersWhenImporting               bool          `json:"add_followers_when_importing"`
		SearchBackend                           string        `json:"search_backend"`
		BillingManagedBySales                   bool          `json:"billing_managed_by_sales"`
		MaxDealAgeInAverageProgressCalculation  int           `json:"max_deal_age_in_average_progress_calculation"`
		ThirdPartyLinks                         []interface{} `json:"third_party_links"`
		ElasticWriteTargetDuringMigration       string        `json:"elastic_write_target_during_migration"`
		AutoCreateNewPersonsFromForwarderEmails bool          `json:"auto_create_new_persons_from_forwarder_emails"`
		CompanyAdvancedDebugLogs                bool          `json:"company_advanced_debug_logs"`
		DealBlockOrder                          []struct {
			Type    string `json:"type"`
			Visible bool   `json:"visible"`
		} `json:"deal_block_order"`
		PersonBlockOrder []struct {
			Type    string `json:"type"`
			Visible bool   `json:"visible"`
		} `json:"person_block_order"`
		OrganizationBlockOrder []struct {
			Type    string `json:"type"`
			Visible bool   `json:"visible"`
		} `json:"organization_block_order"`
		NylasSync                            bool          `json:"nylas_sync"`
		OnboardingComplete                   bool          `json:"onboarding_complete"`
		ActivityEmailReminders               bool          `json:"activity_email_reminders"`
		ActivityEmailRemindersSendType       string        `json:"activity_email_reminders_send_type"`
		ActivityEmailRemindersAmountBefore   int           `json:"activity_email_reminders_amount_before"`
		ActivityNotificationsLanguageID      int           `json:"activity_notifications_language_id"`
		FileConvertAllowed                   bool          `json:"file_convert_allowed"`
		DefaultCurrency                      string        `json:"default_currency"`
		SendEmailNotifications               string        `json:"send_email_notifications"`
		ShowUpdateNotifications              bool          `json:"show_update_notifications"`
		CreateFolderInGoogleDrive            bool          `json:"create_folder_in_google_drive"`
		ShareGoogleDriveFilesWithCompany     bool          `json:"share_google_drive_files_with_company"`
		DealsTimelineDefaultField            string        `json:"deals_timeline_default_field"`
		DealsTimelineInterval                string        `json:"deals_timeline_interval"`
		DealsTimelineArrangeBy               string        `json:"deals_timeline_arrange_by"`
		DealsTimelineColumnCount             int           `json:"deals_timeline_column_count"`
		DealsTimelineShowProgress            bool          `json:"deals_timeline_show_progress"`
		ShareIncomingEmails                  bool          `json:"share_incoming_emails"`
		ConnectThreadsWithDeals              bool          `json:"connect_threads_with_deals"`
		EmailSignature                       bool          `json:"email_signature"`
		EmailSignatureText                   string        `json:"email_signature_text"`
		GlobalSearchSurveyLinkClicked        bool          `json:"global_search_survey_link_clicked"`
		GoogleCalendarActivityType           string        `json:"google_calendar_activity_type"`
		GoogleCalendarIgnoreActivityTypes    []interface{} `json:"google_calendar_ignore_activity_types"`
		UploadAllVisiblePersonsToGoogle      bool          `json:"upload_all_visible_persons_to_google"`
		FormatPhoneNumbersEnabled            bool          `json:"format_phone_numbers_enabled"`
		OnboardingCompletedTours             []interface{} `json:"onboarding_completed_tours"`
		OpenEmailLinksInNewTab               bool          `json:"open_email_links_in_new_tab"`
		TotalsConvertCurrency                bool          `json:"totals_convert_currency"`
		EmailSyncFilter                      string        `json:"email_sync_filter"`
		EmailSyncFilterLabels                []interface{} `json:"email_sync_filter_labels"`
		DealDetailsOpen                      bool          `json:"deal_details_open"`
		PersonDetailsOpen                    bool          `json:"person_details_open"`
		OrganizationDetailsOpen              bool          `json:"organization_details_open"`
		GoogleCalendarSubjectFormat          string        `json:"google_calendar_subject_format"`
		GoogleCalendarActivityReminders      []interface{} `json:"google_calendar_activity_reminders"`
		HideEmailSettingsPromotionBanner     bool          `json:"hide_email_settings_promotion_banner"`
		UserAdvancedDebugLogs                bool          `json:"user_advanced_debug_logs"`
		ShowFiltercolumnsTutorial            bool          `json:"show_filtercolumns_tutorial"`
		ShowDuplicates                       bool          `json:"show_duplicates"`
		ShowImportTutorial                   bool          `json:"show_import_tutorial"`
		ShowStatisticsTutorial               bool          `json:"show_statistics_tutorial"`
		ShowActivitycrossitemTutorial        bool          `json:"show_activitycrossitem_tutorial"`
		HasSeenDropboxOldDetailsDeprecNotice bool          `json:"has_seen_dropbox_old_details_deprec_notice"`
		LinkPersonToOrg                      bool          `json:"link_person_to_org"`
		TimezoneAutomaticUpdate              bool          `json:"timezone_automatic_update"`
		UsePipedriveMailtoLinks              bool          `json:"use_pipedrive_mailto_links"`
		AbMailPromotion1Enabled              bool          `json:"ab_mail_promotion1_enabled"`
		MailFiltersInbox                     []interface{} `json:"mail_filters_inbox"`
		MailFiltersDrafts                    []interface{} `json:"mail_filters_drafts"`
		MailFiltersSent                      []interface{} `json:"mail_filters_sent"`
		MailFiltersArchive                   []interface{} `json:"mail_filters_archive"`
		PromoteGsFilters                     bool          `json:"promote_gs_filters"`
		PromoteGsNotesAndFields              bool          `json:"promote_gs_notes_and_fields"`
		HasSeenHelpTooltip                   bool          `json:"has_seen_help_tooltip"`
		InvitationLastTime                   int           `json:"invitation_last_time"`
		InvitationResentCount                int           `json:"invitation_resent_count"`
		ExpandedCalendarAllday               bool          `json:"expanded_calendar_allday"`
		TimelinePanelOpen                    bool          `json:"timeline_panel_open"`
		TimelinePanelOnboardingDone          bool          `json:"timeline_panel_onboarding_done"`
		HasNotifications                     bool          `json:"has_notifications"`
		ActivitiesViewMode                   string        `json:"activities_view_mode"`
		ActivityQuickfilterRange             string        `json:"activity_quickfilter_range"`
		CurrentPipelineID                    int           `json:"current_pipeline_id"`
		DealsTimelineShowWeightedValues      bool          `json:"deals_timeline_show_weighted_values"`
		DealsViewMode                        string        `json:"deals_view_mode"`
		FeedViewType                         string        `json:"feed_view_type"`
		FilterActivities                     string        `json:"filter_activities"`
		FilterDeals                          string        `json:"filter_deals"`
		FilterOrg                            string        `json:"filter_org"`
		FilterPeople                         string        `json:"filter_people"`
		FilterPipeline1                      string        `json:"filter_pipeline_1"`
		FilterPipeline2                      string        `json:"filter_pipeline_2"`
		FilterProducts                       string        `json:"filter_products"`
		GoogledocsFolderID                   string        `json:"googledocs_folder_id"`
		GoogleCalendarSync                   bool          `json:"google_calendar_sync"`
	} `json:"data"`
}

UserSettings represents a Pipedrive user settings.

type UserSettingsService

type UserSettingsService service

UserSettingsService handles user settings related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/UserSettings

func (*UserSettingsService) List

List settings of authorized user.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/UserSettings/get_userSettings

type UserSingleResponse

type UserSingleResponse struct {
	Success        bool           `json:"success"`
	Data           User           `json:"data"`
	AdditionalData AdditionalData `json:"additional_data"`
}

UserSingleResponse represents single user response.

type UsersFindByNameOptions

type UsersFindByNameOptions struct {
	Term          string `url:"term,omitempty"`
	SearchByEmail int    `url:"search_by_email,omitempty"`
}

UsersFindByNameOptions specifices the optional parameters to the UsersService.FindByName method.

type UsersResponse

type UsersResponse struct {
	Success        bool           `json:"success"`
	Error          string         `json:"error,omitempty"`
	ErrorInfo      string         `json:"error_info,omitempty"`
	Data           []User         `json:"data"`
	AdditionalData AdditionalData `json:"additional_data"`
}

UsersResponse represents multiple users response.

type UsersService

type UsersService service

UsersService handles users related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Users

func (*UsersService) Create

Create a user.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Users/post_users

func (*UsersService) DeletePermissionSetAssignment

func (s *UsersService) DeletePermissionSetAssignment(ctx context.Context, id int, opt *DeletePermissionSetAssignmentOptions) (*Response, error)

DeletePermissionSetAssignment deletes a permission set assignment for a user.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Users/delete_users_id_permissionSetAssignments

func (*UsersService) DeleteRoleAssignment

func (s *UsersService) DeleteRoleAssignment(ctx context.Context, id int, opt *DeleteRoleAssignmentOptions) (*Response, error)

DeleteRoleAssignment deletes a role assignment for a user.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Users/delete_users_id_roleAssignments

func (*UsersService) FindByName

FindByName finds users by their name.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Users/get_users_find

func (*UsersService) GetByID

GetByID returns specific user.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Users/get_users_id

func (*UsersService) GetCurrentUserData

func (s *UsersService) GetCurrentUserData(ctx context.Context) (*UserSingleResponse, *Response, error)

GetCurrentUserData returns data about an authorized user within the company.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Users/get_users_me

func (*UsersService) List

List returns data about all users within the company.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Users/get_users

func (*UsersService) ListFollowers

func (s *UsersService) ListFollowers(ctx context.Context, id int) (*UserFollowersResponse, *Response, error)

ListFollowers lists followers of a specific user.

https://developers.pipedrive.com/docs/api/v1/#!/Users/get_users_id_followers

func (*UsersService) ListUserPermissions

func (s *UsersService) ListUserPermissions(ctx context.Context, id int) (*UserPermissionsResponse, *Response, error)

ListUserPermissions lists aggregated permissions over all assigned permission sets for a user.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Users/get_users_id_permissions

func (*UsersService) ListUserRoleSettings

func (s *UsersService) ListUserRoleSettings(ctx context.Context, id int) (*UserRoleSettingsResponse, *Response, error)

ListUserRoleSettings lists settings of user's assigned role.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Users/get_users_id_roleSettings

func (*UsersService) UpdateUserDetails

func (s *UsersService) UpdateUserDetails(ctx context.Context, id int, opt *UsersUpdateUserDetailsOptions) (*Response, error)

UpdateUserDetails updates the properties of a user. Currently, only active_flag can be updated.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Users/put_users_id

type UsersUpdateUserDetailsOptions

type UsersUpdateUserDetailsOptions struct {
	ActiveFlag uint8 `url:"active_flag,omitempty"`
}

UsersUpdateUserDetailsOptions specifices the optional parameters to the UsersService.UpdateUserDetails method.

type VisibleTo

type VisibleTo uint8

Visiblity

const (
	VisibleToOwnersFollowers VisibleTo = 1
	VisibleToEntireCompany   VisibleTo = 3
)

type Webhook

type Webhook struct {
	ID               int         `json:"id"`
	CompanyID        int         `json:"company_id"`
	OwnerID          int         `json:"owner_id"`
	UserID           int         `json:"user_id"`
	EventAction      string      `json:"event_action"`
	EventObject      string      `json:"event_object"`
	SubscriptionURL  string      `json:"subscription_url"`
	Version          string      `json:"version"`
	IsActive         int         `json:"is_active"`
	AddTime          Timestamp   `json:"add_time"`
	RemoveTime       interface{} `json:"remove_time"`
	Type             string      `json:"type"`
	HTTPAuthUser     interface{} `json:"http_auth_user"`
	HTTPAuthPassword interface{} `json:"http_auth_password"`
	RemoveReason     interface{} `json:"remove_reason"`
	AdditionalData   struct{}    `json:"additional_data"`
	LastDeliveryTime Timestamp   `json:"last_delivery_time"`
	// LastHTTPStatus can be numeric or status text.
	LastHTTPStatus interface{} `json:"last_http_status"`
	AdminID        int         `json:"admin_id"`
	Name           string      `json:"name"`
}

Webhook represents a Pipedrive webhook.

func (Webhook) String

func (w Webhook) String() string

type WebhookResponse

type WebhookResponse struct {
	Status  string  `json:"status,omitempty"`
	Success bool    `json:"success,omitempty"`
	Data    Webhook `json:"data,omitempty"`
}

WebhookResponse represents single webhook response.

type WebhookVersion added in v0.1.1

type WebhookVersion string
const (
	WebhookVersion1 WebhookVersion = "1.0"
	WebhookVersion2 WebhookVersion = "2.0"
)

type WebhooksCreateOptions

type WebhooksCreateOptions struct {
	SubscriptionURL  string         `json:"subscription_url,omitempty"`
	EventAction      EventAction    `json:"event_action,omitempty"`
	EventObject      EventObject    `json:"event_object,omitempty"`
	Name             string         `json:"name,omitempty"`
	UserID           int            `json:"user_id,omitempty"`
	HTTPAuthUser     string         `json:"http_auth_user,omitempty"`
	HTTPAuthPassword string         `json:"http_auth_password,omitempty"`
	Version          WebhookVersion `json:"version,omitempty"`
}

WebhooksCreateOptions specifices the optional parameters to the WebhooksService.Create method.

type WebhooksResponse

type WebhooksResponse struct {
	Status  string    `json:"status,omitempty"`
	Success bool      `json:"success,omitempty"`
	Data    []Webhook `json:"data,omitempty"`
}

WebhooksResponse represents multiple webhooks response.

type WebhooksService

type WebhooksService service

WebhooksService handles webhooks related methods of the Pipedrive API.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Webhooks

func (*WebhooksService) Create

Create a webhook.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Webhooks/post_webhooks

func (*WebhooksService) Delete

func (s *WebhooksService) Delete(ctx context.Context, id int) (*Response, error)

Delete a webhook.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Webhooks/delete_webhooks_id

func (*WebhooksService) List

List all webhooks.

Pipedrive API docs: https://developers.pipedrive.com/docs/api/v1/#!/Webhooks/get_webhooks

Jump to

Keyboard shortcuts

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