Skip to content

Commit 1109965

Browse files
author
pipedrive-bot
committed
Build 294 - version-minor
1 parent 01a5eae commit 1109965

File tree

5 files changed

+186
-5
lines changed

5 files changed

+186
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ The file format of it is based on [Keep a Changelog](http://keepachangelog.com/e
77
For public Changelog covering all changes done to Pipedrive’s API, webhooks and app extensions platforms, see [public Changelog](https://pipedrive.readme.io/docs/changelog) with discussion area in [Developers Community](https://devcommunity.pipedrive.com/c/documentation/changelog/19).
88

99
## [Unreleased]
10+
### Added
11+
- Added `GET /v1/leadFields` endpoint for fetching all lead fields
1012

1113
## [30.4.0] - 2025-11-18
1214
### Added

docs/v1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ GoalsApi | getGoals | **GET** /goals/find | Find goals
8989
GoalsApi | updateGoal | **PUT** /goals/{id} | Update existing goal
9090
ItemSearchApi | searchItem | **GET** /itemSearch | Perform a search from multiple item types
9191
ItemSearchApi | searchItemByField | **GET** /itemSearch/field | Perform a search using a specific field from an item type
92+
LeadFieldsApi | getLeadFields | **GET** /leadFields | Get all lead fields
9293
LeadLabelsApi | addLeadLabel | **POST** /leadLabels | Add a lead label
9394
LeadLabelsApi | deleteLeadLabel | **DELETE** /leadLabels/{id} | Delete a lead label
9495
LeadLabelsApi | getLeadLabels | **GET** /leadLabels | Get all lead labels

src/versions/v1/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export * from './api/files-api';
2727
export * from './api/filters-api';
2828
export * from './api/goals-api';
2929
export * from './api/item-search-api';
30+
export * from './api/lead-fields-api';
3031
export * from './api/lead-labels-api';
3132
export * from './api/lead-sources-api';
3233
export * from './api/leads-api';
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* Pipedrive API v1
5+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6+
*
7+
* The version of the OpenAPI document: 1.0.0
8+
*
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
16+
import type { Configuration } from '../configuration';
17+
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
18+
import globalAxios from 'axios';
19+
// Some imports not used depending on template conditions
20+
// @ts-ignore
21+
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
22+
// @ts-ignore
23+
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
24+
// @ts-ignore
25+
import { GetFieldsResponse } from '../models';
26+
/**
27+
* LeadFieldsApi - axios parameter creator
28+
* @export
29+
*/
30+
export const LeadFieldsApiAxiosParamCreator = function (configuration?: Configuration) {
31+
return {
32+
/**
33+
* Returns data about all lead fields.
34+
* @summary Get all lead fields
35+
* @param {number} [start] Pagination start
36+
* @param {number} [limit] Items shown per page
37+
38+
* @throws {RequiredError}
39+
*/
40+
getLeadFields: async (start?: number, limit?: number, ): Promise<RequestArgs> => {
41+
const localVarPath = `/leadFields`;
42+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
43+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
44+
let baseOptions;
45+
if (configuration) {
46+
baseOptions = configuration.baseOptions;
47+
}
48+
49+
const localVarRequestOptions = { method: 'GET', ...baseOptions };
50+
const localVarHeaderParameter = {} as any;
51+
const localVarQueryParameter = {} as any;
52+
53+
// authentication api_key required
54+
await setApiKeyToObject(localVarHeaderParameter, "x-api-token", configuration)
55+
56+
// authentication oauth2 required
57+
// oauth required
58+
await setOAuthToObject(localVarHeaderParameter, "oauth2", ["leads:read", "leads:full", "admin"], configuration)
59+
60+
if (start !== undefined) {
61+
localVarQueryParameter['start'] = start;
62+
}
63+
64+
if (limit !== undefined) {
65+
localVarQueryParameter['limit'] = limit;
66+
}
67+
68+
69+
70+
setSearchParams(localVarUrlObj, localVarQueryParameter);
71+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
72+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, };
73+
74+
return {
75+
url: toPathString(localVarUrlObj),
76+
options: localVarRequestOptions,
77+
};
78+
},
79+
}
80+
};
81+
82+
83+
/**
84+
* LeadFieldsApi - functional programming interface
85+
* @export
86+
*/
87+
export const LeadFieldsApiFp = function(configuration?: Configuration) {
88+
const localVarAxiosParamCreator = LeadFieldsApiAxiosParamCreator(configuration)
89+
return {
90+
/**
91+
* Returns data about all lead fields.
92+
* @summary Get all lead fields
93+
* @param {number} [start] Pagination start
94+
* @param {number} [limit] Items shown per page
95+
96+
* @throws {RequiredError}
97+
*/
98+
async getLeadFields(start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<GetFieldsResponse>> {
99+
const localVarAxiosArgs = await localVarAxiosParamCreator.getLeadFields(start, limit, );
100+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
101+
},
102+
}
103+
};
104+
105+
/**
106+
* LeadFieldsApi - factory interface
107+
* @export
108+
*/
109+
export const LeadFieldsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
110+
const localVarFp = LeadFieldsApiFp(configuration)
111+
return {
112+
/**
113+
* Returns data about all lead fields.
114+
* @summary Get all lead fields
115+
* @param {LeadFieldsApiGetLeadFieldsRequest} requestParameters Request parameters.
116+
117+
* @throws {RequiredError}
118+
*/
119+
getLeadFields(requestParameters: LeadFieldsApiGetLeadFieldsRequest = {}, ): Promise<GetFieldsResponse> {
120+
return localVarFp.getLeadFields(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath));
121+
},
122+
};
123+
};
124+
125+
/**
126+
* Request parameters for getLeadFields operation in LeadFieldsApi.
127+
* @export
128+
* @interface LeadFieldsApiGetLeadFieldsRequest
129+
*/
130+
export interface LeadFieldsApiGetLeadFieldsRequest {
131+
/**
132+
* Pagination start
133+
* @type {number}
134+
* @memberof LeadFieldsApiGetLeadFields
135+
*/
136+
readonly start?: number
137+
138+
/**
139+
* Items shown per page
140+
* @type {number}
141+
* @memberof LeadFieldsApiGetLeadFields
142+
*/
143+
readonly limit?: number
144+
}
145+
146+
/**
147+
* LeadFieldsApi - object-oriented interface
148+
* @export
149+
* @class LeadFieldsApi
150+
* @extends {BaseAPI}
151+
*/
152+
export class LeadFieldsApi extends BaseAPI {
153+
/**
154+
* Returns data about all lead fields.
155+
* @summary Get all lead fields
156+
* @param {LeadFieldsApiGetLeadFieldsRequest} requestParameters Request parameters.
157+
158+
* @throws {RequiredError}
159+
* @memberof LeadFieldsApi
160+
*/
161+
public getLeadFields(requestParameters: LeadFieldsApiGetLeadFieldsRequest = {}, ) {
162+
return LeadFieldsApiFp(this.configuration).getLeadFields(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath));
163+
}
164+
}

src/versions/v2/api/persons-api.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati
381381
* @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
382382
* @param {number} [owner_id] If supplied, only persons owned by the specified user are returned. If filter_id is provided, this is ignored.
383383
* @param {number} [org_id] If supplied, only persons linked to the specified organization are returned. If filter_id is provided, this is ignored.
384+
* @param {number} [deal_id] If supplied, only persons linked to the specified deal are returned. If filter_id is provided, this is ignored.
384385
* @param {string} [updated_since] If set, only persons with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
385386
* @param {string} [updated_until] If set, only persons with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
386387
* @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
@@ -392,7 +393,7 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati
392393
393394
* @throws {RequiredError}
394395
*/
395-
getPersons: async (filter_id?: number, ids?: string, owner_id?: number, org_id?: number, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status', custom_fields?: string, limit?: number, cursor?: string, ): Promise<RequestArgs> => {
396+
getPersons: async (filter_id?: number, ids?: string, owner_id?: number, org_id?: number, deal_id?: number, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status', custom_fields?: string, limit?: number, cursor?: string, ): Promise<RequestArgs> => {
396397
const localVarPath = `/persons`;
397398
// use dummy base URL string because the URL constructor only accepts absolute URLs.
398399
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -428,6 +429,10 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati
428429
localVarQueryParameter['org_id'] = org_id;
429430
}
430431

432+
if (deal_id !== undefined) {
433+
localVarQueryParameter['deal_id'] = deal_id;
434+
}
435+
431436
if (updated_since !== undefined) {
432437
localVarQueryParameter['updated_since'] = updated_since;
433438
}
@@ -693,6 +698,7 @@ export const PersonsApiFp = function(configuration?: Configuration) {
693698
* @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
694699
* @param {number} [owner_id] If supplied, only persons owned by the specified user are returned. If filter_id is provided, this is ignored.
695700
* @param {number} [org_id] If supplied, only persons linked to the specified organization are returned. If filter_id is provided, this is ignored.
701+
* @param {number} [deal_id] If supplied, only persons linked to the specified deal are returned. If filter_id is provided, this is ignored.
696702
* @param {string} [updated_since] If set, only persons with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
697703
* @param {string} [updated_until] If set, only persons with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
698704
* @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
@@ -704,8 +710,8 @@ export const PersonsApiFp = function(configuration?: Configuration) {
704710
705711
* @throws {RequiredError}
706712
*/
707-
async getPersons(filter_id?: number, ids?: string, owner_id?: number, org_id?: number, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status', custom_fields?: string, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<GetPersonsResponse>> {
708-
const localVarAxiosArgs = await localVarAxiosParamCreator.getPersons(filter_id, ids, owner_id, org_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor, );
713+
async getPersons(filter_id?: number, ids?: string, owner_id?: number, org_id?: number, deal_id?: number, updated_since?: string, updated_until?: string, sort_by?: 'id' | 'update_time' | 'add_time', sort_direction?: 'asc' | 'desc', include_fields?: 'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status', custom_fields?: string, limit?: number, cursor?: string, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<GetPersonsResponse>> {
714+
const localVarAxiosArgs = await localVarAxiosParamCreator.getPersons(filter_id, ids, owner_id, org_id, deal_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor, );
709715
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
710716
},
711717
/**
@@ -825,7 +831,7 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa
825831
* @throws {RequiredError}
826832
*/
827833
getPersons(requestParameters: PersonsApiGetPersonsRequest = {}, ): Promise<GetPersonsResponse> {
828-
return localVarFp.getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath));
834+
return localVarFp.getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.deal_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath));
829835
},
830836
/**
831837
* Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found persons can be filtered by organization ID.
@@ -1038,6 +1044,13 @@ export interface PersonsApiGetPersonsRequest {
10381044
*/
10391045
readonly org_id?: number
10401046

1047+
/**
1048+
* If supplied, only persons linked to the specified deal are returned. If filter_id is provided, this is ignored.
1049+
* @type {number}
1050+
* @memberof PersonsApiGetPersons
1051+
*/
1052+
readonly deal_id?: number
1053+
10411054
/**
10421055
* If set, only persons with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
10431056
* @type {string}
@@ -1272,7 +1285,7 @@ export class PersonsApi extends BaseAPI {
12721285
* @memberof PersonsApi
12731286
*/
12741287
public getPersons(requestParameters: PersonsApiGetPersonsRequest = {}, ) {
1275-
return PersonsApiFp(this.configuration).getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath));
1288+
return PersonsApiFp(this.configuration).getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.deal_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath));
12761289
}
12771290

12781291
/**

0 commit comments

Comments
 (0)