Skip to content

Latest commit

 

History

History
407 lines (278 loc) · 12.5 KB

PersonFieldsApi.md

File metadata and controls

407 lines (278 loc) · 12.5 KB

Pipedrive\PersonFieldsApi

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

Method HTTP request Description
addPersonField() POST /personFields Add a new person field
deletePersonField() DELETE /personFields/{id} Delete a person field
deletePersonFields() DELETE /personFields Delete multiple person fields in bulk
getPersonField() GET /personFields/{id} Get one person field
getPersonFields() GET /personFields Get all person fields
updatePersonField() PUT /personFields/{id} Update a person field

addPersonField()

addPersonField($field_create_request): \Pipedrive\Model\FieldResponse

Add a new person field

Adds a new person field. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/adding-a-new-custom-field\" target="_blank" rel="noopener noreferrer">adding a new custom field.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: api_key
$config = (new Pipedrive\Configuration())->setApiKey('api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer');

// Configure OAuth2 access token for authorization: oauth2
$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Pipedrive\Api\PersonFieldsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$field_create_request = new \Pipedrive\Model\FieldCreateRequest(); // \Pipedrive\Model\FieldCreateRequest

try {
    $result = $apiInstance->addPersonField($field_create_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PersonFieldsApi->addPersonField: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
field_create_request \Pipedrive\Model\FieldCreateRequest [optional]

Return type

\Pipedrive\Model\FieldResponse

Authorization

api_key, oauth2

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deletePersonField()

deletePersonField($id): \Pipedrive\Model\DeleteResponse

Delete a person field

Marks a field as deleted. For more information, see the tutorial for <a href="https://pipedrive.readme.io/docs/deleting-a-custom-field\" target="_blank" rel="noopener noreferrer">deleting a custom field.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: api_key
$config = (new Pipedrive\Configuration())->setApiKey('api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer');

// Configure OAuth2 access token for authorization: oauth2
$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Pipedrive\Api\PersonFieldsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 56; // int | The ID of the field

try {
    $result = $apiInstance->deletePersonField($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PersonFieldsApi->deletePersonField: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id int The ID of the field

Return type

\Pipedrive\Model\DeleteResponse

Authorization

api_key, oauth2

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deletePersonFields()

deletePersonFields($ids): \Pipedrive\Model\BulkDeleteResponse

Delete multiple person fields in bulk

Marks multiple fields as deleted.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: api_key
$config = (new Pipedrive\Configuration())->setApiKey('api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer');

// Configure OAuth2 access token for authorization: oauth2
$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Pipedrive\Api\PersonFieldsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$ids = 'ids_example'; // string | The comma-separated field IDs to delete

try {
    $result = $apiInstance->deletePersonFields($ids);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PersonFieldsApi->deletePersonFields: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
ids string The comma-separated field IDs to delete

Return type

\Pipedrive\Model\BulkDeleteResponse

Authorization

api_key, oauth2

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getPersonField()

getPersonField($id): \Pipedrive\Model\FieldResponse

Get one person field

Returns data about a specific person field.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: api_key
$config = (new Pipedrive\Configuration())->setApiKey('api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer');

// Configure OAuth2 access token for authorization: oauth2
$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Pipedrive\Api\PersonFieldsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 56; // int | The ID of the field

try {
    $result = $apiInstance->getPersonField($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PersonFieldsApi->getPersonField: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id int The ID of the field

Return type

\Pipedrive\Model\FieldResponse

Authorization

api_key, oauth2

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getPersonFields()

getPersonFields($start, $limit): \Pipedrive\Model\FieldsResponse

Get all person fields

Returns data about all person fields.
If a company uses the Campaigns product, then this endpoint will also return the data.marketing_status field.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: api_key
$config = (new Pipedrive\Configuration())->setApiKey('api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer');

// Configure OAuth2 access token for authorization: oauth2
$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Pipedrive\Api\PersonFieldsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$start = 0; // int | Pagination start
$limit = 56; // int | Items shown per page

try {
    $result = $apiInstance->getPersonFields($start, $limit);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PersonFieldsApi->getPersonFields: ', $e->getMessage(), PHP_EOL;
}

Parameters

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

Return type

\Pipedrive\Model\FieldsResponse

Authorization

api_key, oauth2

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updatePersonField()

updatePersonField($id, $field_update_request): \Pipedrive\Model\FieldResponse

Update a person field

Updates a person field. For more information, see the tutorial for <a href=" https://pipedrive.readme.io/docs/updating-custom-field-value " target="_blank" rel="noopener noreferrer">updating custom fields' values.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: api_key
$config = (new Pipedrive\Configuration())->setApiKey('api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer');

// Configure OAuth2 access token for authorization: oauth2
$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Pipedrive\Api\PersonFieldsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 56; // int | The ID of the field
$field_update_request = new \Pipedrive\Model\FieldUpdateRequest(); // \Pipedrive\Model\FieldUpdateRequest

try {
    $result = $apiInstance->updatePersonField($id, $field_update_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PersonFieldsApi->updatePersonField: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id int The ID of the field
field_update_request \Pipedrive\Model\FieldUpdateRequest [optional]

Return type

\Pipedrive\Model\FieldResponse

Authorization

api_key, oauth2

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]