Skip to content

Latest commit

 

History

History
343 lines (231 loc) · 10.1 KB

ProductFieldsApi.md

File metadata and controls

343 lines (231 loc) · 10.1 KB

Pipedrive.ProductFieldsApi

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

Method HTTP request Description
addProductField POST /productFields Add a new product field
deleteProductField DELETE /productFields/{id} Delete a product field
deleteProductFields DELETE /productFields Delete multiple product fields in bulk
getProductField GET /productFields/{id} Get one product field
getProductFields GET /productFields Get all product fields
updateProductField PUT /productFields/{id} Update a product field

addProductField

GetProductFieldResponse addProductField(opts)

Add a new product field

Adds a new product field. For more information, see the tutorial for <a href=&quot;https://pipedrive.readme.io/docs/adding-a-new-custom-field\" target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;>adding a new custom field</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.ProductFieldsApi(apiClient);
let opts = Pipedrive.NewProductField.constructFromObject({
  // Properties that you want to update
});
apiInstance.addProductField(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
NewProductField NewProductField [optional]

Return type

GetProductFieldResponse

Authorization

api_key, oauth2

HTTP request headers

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

deleteProductField

DeleteProductFieldResponse deleteProductField(id)

Delete a product field

Marks a product field as deleted. For more information, see the tutorial for <a href=&quot;https://pipedrive.readme.io/docs/deleting-a-custom-field\" target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;>deleting a custom field</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.ProductFieldsApi(apiClient);
let id = 56; // Number | The ID of the product field
apiInstance.deleteProductField(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 product field

Return type

DeleteProductFieldResponse

Authorization

api_key, oauth2

HTTP request headers

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

deleteProductFields

DeleteMultipleProductFieldsResponse deleteProductFields(ids)

Delete multiple product fields in bulk

Marks multiple fields 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.ProductFieldsApi(apiClient);
let ids = "ids_example"; // String | The comma-separated field IDs to delete
apiInstance.deleteProductFields(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 field IDs to delete

Return type

DeleteMultipleProductFieldsResponse

Authorization

api_key, oauth2

HTTP request headers

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

getProductField

GetProductFieldResponse getProductField(id)

Get one product field

Returns data about a specific product field.

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.ProductFieldsApi(apiClient);
let id = 56; // Number | The ID of the product field
apiInstance.getProductField(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 product field

Return type

GetProductFieldResponse

Authorization

api_key, oauth2

HTTP request headers

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

getProductFields

GetAllProductFieldsResponse getProductFields(opts)

Get all product fields

Returns data about all product fields.

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.ProductFieldsApi(apiClient);
// snake_case as well as camelCase is supported for naming opts properties
let opts = {
  'start': 0, // Number | Pagination start
  'limit': 56 // Number | Items shown per page
};
apiInstance.getProductFields(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
start Number Pagination start [optional] [default to 0]
limit Number Items shown per page [optional]

Return type

GetAllProductFieldsResponse

Authorization

api_key, oauth2

HTTP request headers

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

updateProductField

GetProductFieldResponse updateProductField(id, opts)

Update a product field

Updates a product field. For more information, see the tutorial for <a href=&quot; https://pipedrive.readme.io/docs/updating-custom-field-value &quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;>updating custom fields' values</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.ProductFieldsApi(apiClient);
let id = 56; // Number | The ID of the product field
let opts = Pipedrive.UpdateProductField.constructFromObject({
  // Properties that you want to update
});
apiInstance.updateProductField(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 product field
UpdateProductField UpdateProductField [optional]

Return type

GetProductFieldResponse

Authorization

api_key, oauth2

HTTP request headers

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