diff --git a/CHANGELOG.md b/CHANGELOG.md index c765732d..ec64c3cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ The file format of it is based on [Keep a Changelog](http://keepachangelog.com/e 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). ## [Unreleased] +### Added +- Added `GET /v1/leadFields` endpoint for fetching all lead fields ## [30.5.0] - 2025-12-02 ### Added diff --git a/docs/v1.md b/docs/v1.md index dca16f00..7e5b32bc 100644 --- a/docs/v1.md +++ b/docs/v1.md @@ -89,6 +89,7 @@ GoalsApi | getGoals | **GET** /goals/find | Find goals GoalsApi | updateGoal | **PUT** /goals/{id} | Update existing goal ItemSearchApi | searchItem | **GET** /itemSearch | Perform a search from multiple item types ItemSearchApi | searchItemByField | **GET** /itemSearch/field | Perform a search using a specific field from an item type +LeadFieldsApi | getLeadFields | **GET** /leadFields | Get all lead fields LeadLabelsApi | addLeadLabel | **POST** /leadLabels | Add a lead label LeadLabelsApi | deleteLeadLabel | **DELETE** /leadLabels/{id} | Delete a lead label LeadLabelsApi | getLeadLabels | **GET** /leadLabels | Get all lead labels diff --git a/src/versions/v1/api.ts b/src/versions/v1/api.ts index d08836dd..f0f65ace 100644 --- a/src/versions/v1/api.ts +++ b/src/versions/v1/api.ts @@ -27,6 +27,7 @@ export * from './api/files-api'; export * from './api/filters-api'; export * from './api/goals-api'; export * from './api/item-search-api'; +export * from './api/lead-fields-api'; export * from './api/lead-labels-api'; export * from './api/lead-sources-api'; export * from './api/leads-api'; diff --git a/src/versions/v1/api/lead-fields-api.ts b/src/versions/v1/api/lead-fields-api.ts new file mode 100644 index 00000000..cd5211e0 --- /dev/null +++ b/src/versions/v1/api/lead-fields-api.ts @@ -0,0 +1,164 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +// @ts-ignore +import { GetFieldsResponse } from '../models'; +/** + * LeadFieldsApi - axios parameter creator + * @export + */ +export const LeadFieldsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Returns data about all lead fields. + * @summary Get all lead fields + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + getLeadFields: async (start?: number, limit?: number, ): Promise => { + const localVarPath = `/leadFields`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication api_key required + await setApiKeyToObject(localVarHeaderParameter, "x-api-token", configuration) + + // authentication oauth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "oauth2", ["leads:read", "leads:full", "admin"], configuration) + + if (start !== undefined) { + localVarQueryParameter['start'] = start; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + + +/** + * LeadFieldsApi - functional programming interface + * @export + */ +export const LeadFieldsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = LeadFieldsApiAxiosParamCreator(configuration) + return { + /** + * Returns data about all lead fields. + * @summary Get all lead fields + * @param {number} [start] Pagination start + * @param {number} [limit] Items shown per page + + * @throws {RequiredError} + */ + async getLeadFields(start?: number, limit?: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLeadFields(start, limit, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * LeadFieldsApi - factory interface + * @export + */ +export const LeadFieldsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = LeadFieldsApiFp(configuration) + return { + /** + * Returns data about all lead fields. + * @summary Get all lead fields + * @param {LeadFieldsApiGetLeadFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getLeadFields(requestParameters: LeadFieldsApiGetLeadFieldsRequest = {}, ): Promise { + return localVarFp.getLeadFields(requestParameters.start, requestParameters.limit, ).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for getLeadFields operation in LeadFieldsApi. + * @export + * @interface LeadFieldsApiGetLeadFieldsRequest + */ +export interface LeadFieldsApiGetLeadFieldsRequest { + /** + * Pagination start + * @type {number} + * @memberof LeadFieldsApiGetLeadFields + */ + readonly start?: number + + /** + * Items shown per page + * @type {number} + * @memberof LeadFieldsApiGetLeadFields + */ + readonly limit?: number +} + +/** + * LeadFieldsApi - object-oriented interface + * @export + * @class LeadFieldsApi + * @extends {BaseAPI} + */ +export class LeadFieldsApi extends BaseAPI { + /** + * Returns data about all lead fields. + * @summary Get all lead fields + * @param {LeadFieldsApiGetLeadFieldsRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof LeadFieldsApi + */ + public getLeadFields(requestParameters: LeadFieldsApiGetLeadFieldsRequest = {}, ) { + return LeadFieldsApiFp(this.configuration).getLeadFields(requestParameters.start, requestParameters.limit, ).then((request) => request(this.axios, this.basePath)); + } +}