diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d65ab75..9127047d 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 /api/v2/persons/{id}/picture` endpoint to retrieve picture information for a specific person, including ID, file size, and URLs for both 128x128 (thumbnail) and 512x512 (full-size) versions of the person's profile picture ## [30.8.0] - 2025-12-05 ### Added diff --git a/docs/v2.md b/docs/v2.md index c4314561..f023f2bd 100644 --- a/docs/v2.md +++ b/docs/v2.md @@ -97,6 +97,7 @@ PersonsApi | deletePersonFollower | **DELETE** /persons/{id}/followers/{follower PersonsApi | getPerson | **GET** /persons/{id} | Get details of a person PersonsApi | getPersonFollowers | **GET** /persons/{id}/followers | List followers of a person PersonsApi | getPersonFollowersChangelog | **GET** /persons/{id}/followers/changelog | List followers changelog of a person +PersonsApi | getPersonPicture | **GET** /persons/{id}/picture | Get picture of a person PersonsApi | getPersons | **GET** /persons | Get all persons PersonsApi | searchPersons | **GET** /persons/search | Search persons PersonsApi | updatePerson | **PATCH** /persons/{id} | Update a person diff --git a/src/versions/v2/api/persons-api.ts b/src/versions/v2/api/persons-api.ts index 9a58a076..cccf9a5d 100644 --- a/src/versions/v2/api/persons-api.ts +++ b/src/versions/v2/api/persons-api.ts @@ -36,6 +36,8 @@ import { GetFollowerChangelogsResponse } from '../models'; // @ts-ignore import { GetFollowersResponse } from '../models'; // @ts-ignore +import { GetPersonPictureResponse } from '../models'; +// @ts-ignore import { GetPersonSearchResponse } from '../models'; // @ts-ignore import { GetPersonsResponse } from '../models'; @@ -365,6 +367,47 @@ export const PersonsApiAxiosParamCreator = function (configuration?: Configurati + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns the picture associated with a person. The picture URLs include both 128x128 and 512x512 pixel versions. + * @summary Get picture of a person + * @param {number} id The ID of the person + + * @throws {RequiredError} + */ + getPersonPicture: async (id: number, ): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getPersonPicture', 'id', id) + const localVarPath = `/persons/{id}/picture` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // 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", ["contacts:read", "contacts:full"], configuration) + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, }; @@ -691,6 +734,17 @@ export const PersonsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonFollowersChangelog(id, limit, cursor, ); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Returns the picture associated with a person. The picture URLs include both 128x128 and 512x512 pixel versions. + * @summary Get picture of a person + * @param {number} id The ID of the person + + * @throws {RequiredError} + */ + async getPersonPicture(id: number, ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPersonPicture(id, ); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. * @summary Get all persons @@ -823,6 +877,16 @@ export const PersonsApiFactory = function (configuration?: Configuration, basePa getPersonFollowersChangelog(requestParameters: PersonsApiGetPersonFollowersChangelogRequest, ): Promise { return localVarFp.getPersonFollowersChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(axios, basePath)); }, + /** + * Returns the picture associated with a person. The picture URLs include both 128x128 and 512x512 pixel versions. + * @summary Get picture of a person + * @param {PersonsApiGetPersonPictureRequest} requestParameters Request parameters. + + * @throws {RequiredError} + */ + getPersonPicture(requestParameters: PersonsApiGetPersonPictureRequest, ): Promise { + return localVarFp.getPersonPicture(requestParameters.id, ).then((request) => request(axios, basePath)); + }, /** * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. * @summary Get all persons @@ -1010,6 +1074,20 @@ export interface PersonsApiGetPersonFollowersChangelogRequest { readonly cursor?: string } +/** + * Request parameters for getPersonPicture operation in PersonsApi. + * @export + * @interface PersonsApiGetPersonPictureRequest + */ +export interface PersonsApiGetPersonPictureRequest { + /** + * The ID of the person + * @type {number} + * @memberof PersonsApiGetPersonPicture + */ + readonly id: number +} + /** * Request parameters for getPersons operation in PersonsApi. * @export @@ -1276,6 +1354,18 @@ export class PersonsApi extends BaseAPI { return PersonsApiFp(this.configuration).getPersonFollowersChangelog(requestParameters.id, requestParameters.limit, requestParameters.cursor, ).then((request) => request(this.axios, this.basePath)); } + /** + * Returns the picture associated with a person. The picture URLs include both 128x128 and 512x512 pixel versions. + * @summary Get picture of a person + * @param {PersonsApiGetPersonPictureRequest} requestParameters Request parameters. + + * @throws {RequiredError} + * @memberof PersonsApi + */ + public getPersonPicture(requestParameters: PersonsApiGetPersonPictureRequest, ) { + return PersonsApiFp(this.configuration).getPersonPicture(requestParameters.id, ).then((request) => request(this.axios, this.basePath)); + } + /** * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company. * @summary Get all persons diff --git a/src/versions/v2/models/get-person-picture-response-data-pictures.ts b/src/versions/v2/models/get-person-picture-response-data-pictures.ts new file mode 100644 index 00000000..c2621c81 --- /dev/null +++ b/src/versions/v2/models/get-person-picture-response-data-pictures.ts @@ -0,0 +1,34 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Pipedrive API v2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + + + +/** +* Picture URLs indexed by size. +* @export +* @interface GetPersonPictureResponseDataPictures +*/ +export interface GetPersonPictureResponseDataPictures { + /** + * The URL of the 128x128 picture. + * @type {string} + */ + '128'?: string; + /** + * The URL of the 512x512 picture. + * @type {string} + */ + '512'?: string; +} + diff --git a/src/versions/v2/models/get-person-picture-response-data.ts b/src/versions/v2/models/get-person-picture-response-data.ts new file mode 100644 index 00000000..74c083b1 --- /dev/null +++ b/src/versions/v2/models/get-person-picture-response-data.ts @@ -0,0 +1,62 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Pipedrive API v2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { GetPersonPictureResponseDataPictures } from './get-person-picture-response-data-pictures'; + +/** +* +* @export +* @interface GetPersonPictureResponseData +*/ +export interface GetPersonPictureResponseData { + /** + * The ID of the picture. + * @type {number} + */ + 'id'?: number; + /** + * The type of item the picture is associated with. + * @type {string} + */ + 'item_type'?: string; + /** + * The ID of the person this picture belongs to. + * @type {number} + */ + 'item_id'?: number; + /** + * The ID of the user who added the picture. + * @type {number} + */ + 'added_by_user_id'?: number; + /** + * Whether the picture is active or not. + * @type {boolean} + */ + 'active_flag'?: boolean; + /** + * The file size in bytes. + * @type {number} + */ + 'file_size'?: number; + /** + * + * @type {GetPersonPictureResponseDataPictures} + */ + 'pictures'?: GetPersonPictureResponseDataPictures; +} + diff --git a/src/versions/v2/models/get-person-picture-response.ts b/src/versions/v2/models/get-person-picture-response.ts new file mode 100644 index 00000000..d33a833e --- /dev/null +++ b/src/versions/v2/models/get-person-picture-response.ts @@ -0,0 +1,37 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Pipedrive API v2 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.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. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { GetPersonPictureResponseData } from './get-person-picture-response-data'; + +/** +* +* @export +* @interface GetPersonPictureResponse +*/ +export interface GetPersonPictureResponse { + /** + * If the response is successful or not + * @type {boolean} + */ + 'success'?: boolean; + /** + * + * @type {GetPersonPictureResponseData} + */ + 'data'?: GetPersonPictureResponseData; +} + diff --git a/src/versions/v2/models/get-pipelines-response-all-of-data-inner.ts b/src/versions/v2/models/get-pipelines-response-all-of-data-inner.ts index 13be9770..aac35b7a 100644 --- a/src/versions/v2/models/get-pipelines-response-all-of-data-inner.ts +++ b/src/versions/v2/models/get-pipelines-response-all-of-data-inner.ts @@ -36,11 +36,6 @@ export interface GetPipelinesResponseAllOfDataInner { */ 'order_nr'?: number; /** - * Whether this pipeline is selected or not - * @type {boolean} - */ - 'is_selected'?: boolean; - /** * Whether this pipeline is marked as deleted or not * @type {boolean} */ diff --git a/src/versions/v2/models/index.ts b/src/versions/v2/models/index.ts index 960a1f62..0660f15e 100644 --- a/src/versions/v2/models/index.ts +++ b/src/versions/v2/models/index.ts @@ -170,6 +170,9 @@ export * from './get-person-fields200-response-data-inner-important-fields'; export * from './get-person-fields200-response-data-inner-required-fields'; export * from './get-person-fields200-response-data-inner-ui-visibility'; export * from './get-person-fields200-response-data-inner-ui-visibility-show-in-add-deal-dialog'; +export * from './get-person-picture-response'; +export * from './get-person-picture-response-data'; +export * from './get-person-picture-response-data-pictures'; export * from './get-person-search-response'; export * from './get-person-search-response-all-of'; export * from './get-person-search-response-all-of-data'; diff --git a/src/versions/v2/models/upsert-pipeline-response-data-data.ts b/src/versions/v2/models/upsert-pipeline-response-data-data.ts index 09d0f666..370c3b1d 100644 --- a/src/versions/v2/models/upsert-pipeline-response-data-data.ts +++ b/src/versions/v2/models/upsert-pipeline-response-data-data.ts @@ -36,11 +36,6 @@ export interface UpsertPipelineResponseDataData { */ 'order_nr'?: number; /** - * Whether this pipeline is selected or not - * @type {boolean} - */ - 'is_selected'?: boolean; - /** * Whether this pipeline is marked as deleted or not * @type {boolean} */