Skip to content

Latest commit

 

History

History
391 lines (262 loc) · 11.1 KB

FiltersApi.md

File metadata and controls

391 lines (262 loc) · 11.1 KB

Pipedrive.FiltersApi

All URIs are relative to https://api.pipedrive.com/v1

Method HTTP request Description
addFilter POST /filters Add a new filter
deleteFilter DELETE /filters/{id} Delete a filter
deleteFilters DELETE /filters Delete multiple filters in bulk
getFilter GET /filters/{id} Get one filter
getFilterHelpers GET /filters/helpers Get all filter helpers
getFilters GET /filters Get all filters
updateFilter PUT /filters/{id} Update filter

addFilter

FiltersPostResponse addFilter(opts)

Add a new filter

Adds a new filter, returns the ID upon success. Note that in the conditions JSON object only one first-level condition group is supported, and it must be glued with 'AND', and only two second level condition groups are supported of which one must be glued with 'AND' and the second with 'OR'. Other combinations do not work (yet) but the syntax supports introducing them in future. For more information, see the tutorial for <a href=&quot;https://pipedrive.readme.io/docs/adding-a-filter\" target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;>adding a filter</a>.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.FiltersApi(apiClient);
let opts = Pipedrive.AddFilterRequest.constructFromObject({
  // Properties that you want to update
});
apiInstance.addFilter(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
AddFilterRequest AddFilterRequest [optional]

Return type

FiltersPostResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteFilter

FiltersDeleteResponse deleteFilter(id)

Delete a filter

Marks a filter as deleted.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.FiltersApi(apiClient);
let id = 56; // Number | The ID of the filter
apiInstance.deleteFilter(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the filter

Return type

FiltersDeleteResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

deleteFilters

FiltersBulkDeleteResponse deleteFilters(ids)

Delete multiple filters in bulk

Marks multiple filters as deleted.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.FiltersApi(apiClient);
let ids = "ids_example"; // String | The comma-separated filter IDs to delete
apiInstance.deleteFilters(ids).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
ids String The comma-separated filter IDs to delete

Return type

FiltersBulkDeleteResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getFilter

FiltersGetResponse getFilter(id)

Get one filter

Returns data about a specific filter. Note that this also returns the condition lines of the filter.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.FiltersApi(apiClient);
let id = 56; // Number | The ID of the filter
apiInstance.getFilter(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the filter

Return type

FiltersGetResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getFilterHelpers

Object getFilterHelpers()

Get all filter helpers

Returns all supported filter helpers. It helps to know what conditions and helpers are available when you want to <a href=&quot;/docs/api/v1/Filters#addFilter&quot;>add</a> or <a href=&quot;/docs/api/v1/Filters#updateFilter&quot;>update</a> filters. For more information, see the tutorial for <a href=&quot;https://pipedrive.readme.io/docs/adding-a-filter\" target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;>adding a filter</a>.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.FiltersApi(apiClient);
apiInstance.getFilterHelpers().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

Object

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getFilters

FiltersBulkGetResponse getFilters(opts)

Get all filters

Returns data about all filters.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.FiltersApi(apiClient);
// snake_case as well as camelCase is supported for naming opts properties
let opts = {
  'type': new Pipedrive.FilterType() // FilterType | The types of filters to fetch
};
apiInstance.getFilters(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
type FilterType The types of filters to fetch [optional]

Return type

FiltersBulkGetResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

updateFilter

FiltersPostResponse updateFilter(id, opts)

Update filter

Updates an existing filter.

Example

import Pipedrive from 'pipedrive';
let apiClient = new Pipedrive.ApiClient();
// Configure API key authorization: api_key
let api_key = apiClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = apiClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.FiltersApi(apiClient);
let id = 56; // Number | The ID of the filter
let opts = Pipedrive.UpdateFilterRequest.constructFromObject({
  // Properties that you want to update
});
apiInstance.updateFilter(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number The ID of the filter
UpdateFilterRequest UpdateFilterRequest [optional]

Return type

FiltersPostResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json