Pipedrive is a sales pipeline software that gets you organized. It's a powerful sales CRM with effortless sales pipeline management. See www.pipedrive.com for details.
This is the official Pipedrive API wrapper-client for PHP based apps, distributed by Pipedrive Inc freely under the MIT licence. It provides convenient access to the Pipedrive API, allowing you to operate with objects such as Deals, Persons, Organizations, Products and much more.
⚠️ Version 1 is the initial release of our official php client. It provides its users access to our API in a convenient way using either API tokens or OAuth2.Please use the issues page for reporting bugs or leaving feedback. Keep in mind most of the code is automatically generated.
You can install the package via composer require
command:
composer require pipedrive/pipedrive
Or simply add it to your composer.json dependences and run composer update
:
"require": {
"pipedrive/pipedrive": "^3.0"
}
The Pipedrive REST API documentation can be found at https://developers.pipedrive.com/v1
This Pipedrive API client is distributed under the MIT licence.
<?php
require_once __DIR__.'/vendor/autoload.php';
session_start();
// Client configuration
$apiToken = 'YOUR_API_TOKEN_HERE';
$client = new Pipedrive\Client(null, null, null, $apiToken); // First 3 parameters are for OAuth2
try {
$response = $client->getUsers()->getCurrentUserData();
echo '<pre>';
var_dump($response);
echo '</pre>';
} catch (\Pipedrive\APIException $e) {
echo $e;
}
In order to setup authentication in the API client, you need the following information.
Parameter | Description |
---|---|
oAuthClientId | OAuth 2 Client ID |
oAuthClientSecret | OAuth 2 Client Secret |
oAuthRedirectUri | OAuth 2 Redirection endpoint or Callback Uri |
API client can be initialized as following:
$oAuthClientId = 'oAuthClientId'; // OAuth 2 Client ID
$oAuthClientSecret = 'oAuthClientSecret'; // OAuth 2 Client Secret
$oAuthRedirectUri = 'https://example.com/oauth/callback'; // OAuth 2 Redirection endpoint or Callback Uri
$client = new Pipedrive\Client($oAuthClientId, $oAuthClientSecret, $oAuthRedirectUri);
You must now authorize the client.
Your application must obtain user authorization before it can execute an endpoint call. The SDK uses OAuth 2.0 authorization to obtain a user's consent to perform an API request on user's behalf.
To obtain user's consent, you must redirect the user to the authorization page. The buildAuthorizationUrl()
method creates the URL to the authorization page.
$authUrl = $client->auth()->buildAuthorizationUrl();
header('Location: ' . filter_var($authUrl, FILTER_SANITIZE_URL));
Once the user responds to the consent request, the OAuth 2.0 server responds to your application's access request by redirecting the user to the redirect URI specified set in Configuration
.
If the user approves the request, the authorization code will be sent as the code
query string:
https://example.com/oauth/callback?code=XXXXXXXXXXXXXXXXXXXXXXXXX
If the user does not approve the request, the response contains an error
query string:
https://example.com/oauth/callback?error=access_denied
After the server receives the code, it can exchange this for an access token. The access token is an object containing information for authorizing client requests and refreshing the token itself.
try {
$client->auth()->authorize($_GET['code']);
} catch (Pipedrive\Exceptions\OAuthProviderException $ex) {
// handle exception
}
An access token may expire after sometime. To extend its lifetime, you must refresh the token.
if ($client->auth()->isTokenExpired()) {
try {
$client->auth()->refreshToken();
} catch (Pipedrive\Exceptions\OAuthProviderException $ex) {
// handle exception
}
}
If a token expires, the SDK will attempt to automatically refresh the token before the next endpoint call requiring authentication.
It is recommended that you store the access token for reuse.
You can store the access token in the $_SESSION
global:
// store token
$_SESSION['access_token'] = Pipedrive\Configuration::$oAuthToken;
However, since the the SDK will attempt to automatically refresh the token when it expires, it is recommended that you register a token update callback to detect any change to the access token.
Pipedrive\Configuration::$oAuthTokenUpdateCallback = function($token) {
// use session or some other way to persist the $token
$_SESSION['access_token'] = $token;
};
The token update callback will be fired upon authorization as well as token refresh.
To authorize a client from a stored access token, just set the access token in Configuration
along with the other configuration parameters before creating the client:
// load token later...
Pipedrive\Configuration::$oAuthToken = $_SESSION['access_token'];
// Set other configuration, then instantiate client
$client = new Pipedrive\Client();
In this example, the index.php
will first check if an access token is available for the user. If one is not set,
it redirects the user to authcallback.php
which will obtain an access token and redirect the user back to the index.php
page.
Now that an access token is set, index.php
can use the client to make authorized calls to the server.
<?php
require_once __DIR__.'/vendor/autoload.php';
session_start();
// Client configuration
$oAuthClientId = 'oAuthClientId';
$oAuthClientSecret = 'oAuthClientSecret';
$oAuthRedirectUri = 'http://' . $_SERVER['HTTP_HOST'] . '/authcallback.php';
$client = new Pipedrive\Client($oAuthClientId, $oAuthClientSecret, $oAuthRedirectUri);
// callback stores token for reuse when token is updated
Pipedrive\Configuration::$oAuthTokenUpdateCallback = function($token) {
$_SESSION['access_token'] = $token;
};
// check if a token is available
if (isset($_SESSION['access_token']) && $_SESSION['access_token']) {
// set access token in configuration
Pipedrive\Configuration::$oAuthToken = $_SESSION['access_token'];
try {
$response = $client->getUsers()->getCurrentUserData();
echo '<pre>';
var_dump($response);
echo '</pre>';
} catch (\Pipedrive\APIException $e) {
echo $e;
}
// now you can use $client to make endpoint calls
// client will automatically refresh the token when it expires and call the token update callback
} else {
// redirect user to a page that handles authorization
header('Location: ' . filter_var($oAuthRedirectUri, FILTER_SANITIZE_URL));
}
<?php
require_once __DIR__.'/vendor/autoload.php';
session_start();
// Client configuration
$oAuthClientId = 'oAuthClientId';
$oAuthClientSecret = 'oAuthClientSecret';
$oAuthRedirectUri = 'http://' . $_SERVER['HTTP_HOST'] . '/authcallback.php';
$client = new Pipedrive\Client($oAuthClientId, $oAuthClientSecret, $oAuthRedirectUri);
// callback stores token for reuse when token is updated
Pipedrive\Configuration::$oAuthTokenUpdateCallback = function($token) {
$_SESSION['access_token'] = $token;
};
if (! isset($_GET['code'])) {
// if authorization code is absent, redirect to authorization page
$authUrl = $client->auth()->buildAuthorizationUrl();
header('Location: ' . filter_var($authUrl, FILTER_SANITIZE_URL));
} else {
try {
// authorize client (calls token update callback as well)
$token = $client->auth()->authorize($_GET['code']);
// resume user activity
$redirect_uri = 'http://' . $_SERVER['HTTP_HOST'] . '/';
header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL));
} catch (Pipedrive\Exceptions\OAuthProviderException $ex) {
// handle exception
}
}
- Run tests
- Open a pull request
Please be aware that most of the code is auto-generated. You are welcome to suggest changes and report bugs. However, any updates will have to be implemented in the underlying generator.
Unit tests in this SDK can be run using PHPUnit.
- First install the dependencies using composer including the
require-dev
dependencies. - Run
vendor\bin\phpunit --verbose
from commandline to execute tests. If you have installed PHPUnit globally, run tests usingphpunit --verbose
instead.
You can change the PHPUnit test configuration in the phpunit.xml
file.
- ActivitiesController
- ActivityFieldsController
- ActivityTypesController
- CallLogsController
- CurrenciesController
- DealFieldsController
- DealsController
- FilesController
- FiltersController
- GlobalMessagesController
- GoalsController
- ItemSearchController
- MailMessagesController
- MailThreadsController
- NoteFieldsController
- NotesController
- OrganizationFieldsController
- OrganizationRelationshipsController
- OrganizationsController
- PermissionSetsController
- PersonFieldsController
- PersonsController
- PipelinesController
- ProductFieldsController
- ProductsController
- RecentsController
- RolesController
- SearchResultsController
- StagesController
- TeamsController
- UserConnectionsController
- UserSettingsController
- UsersController
- WebhooksController
The singleton instance of the ActivitiesController
class can be accessed from the API Client.
$activities = $client->getActivities();
Marks multiple activities as deleted.
function deleteMultipleActivitiesInBulk($ids)
Parameter | Tags | Description |
---|---|---|
ids | Required |
Comma-separated IDs that will be deleted |
$ids = 'ids';
$activities->deleteMultipleActivitiesInBulk($ids);
Returns all activities assigned to a particular user.
function getAllActivitiesAssignedToAParticularUser($options)
Parameter | Tags | Description |
---|---|---|
userId | Optional |
ID of the user whose activities will be fetched. If omitted, the user associated with the API token will be used. If 0, activities for all company users will be fetched based on the permission sets. |
filterId | Optional |
ID of the filter to use (will narrow down results if used together with user_id parameter). |
type | Optional |
Type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the key_string parameter of ActivityTypes. |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
startDate | Optional |
Date in format of YYYY-MM-DD from which activities to fetch from. |
endDate | Optional |
Date in format of YYYY-MM-DD until which activities to fetch to. |
done | Optional |
Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. |
$userId = 119;
$collect['userId'] = $userId;
$filterId = 119;
$collect['filterId'] = $filterId;
$type = 'type';
$collect['type'] = $type;
$start = 0;
$collect['start'] = $start;
$limit = 119;
$collect['limit'] = $limit;
$startDate = date("D M d, Y G:i");
$collect['startDate'] = $startDate;
$endDate = date("D M d, Y G:i");
$collect['endDate'] = $endDate;
$done = int::ENUM_0;
$collect['done'] = $done;
$activities->getAllActivitiesAssignedToAParticularUser($collect);
Adds a new activity. Includes more_activities_scheduled_in_context property in response's additional_data which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). For more information on how to add an activity, see this tutorial.
function addAnActivity($options)
Parameter | Tags | Description |
---|---|---|
subject | Required |
Subject of the activity |
type | Required |
Type of the activity. This is in correlation with the key_string parameter of ActivityTypes. |
done | Optional |
Whether the activity is done or not. 0 = Not done, 1 = Done |
dueDate | Optional |
Due date of the activity. Format: YYYY-MM-DD |
dueTime | Optional |
Due time of the activity in UTC. Format: HH:MM |
duration | Optional |
Duration of the activity. Format: HH:MM |
userId | Optional |
ID of the user whom the activity will be assigned to. If omitted, the activity will be assigned to the authorized user. |
dealId | Optional |
ID of the deal this activity will be associated with |
personId | Optional |
ID of the person this activity will be associated with |
participants | Optional |
List of multiple persons (participants) this activity will be associated with. If omitted, single participant from person_id field is used. It requires a structure as follows: [{"person_id":1,"primary_flag":true}] |
orgId | Optional |
ID of the organization this activity will be associated with |
note | Optional |
Note of the activity (HTML format) |
busyFlag | Optional |
Set the activity as 'Busy' or 'Free'. If the flag is set to true, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with null. When the value of the flag is unset (null), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. Format: true/false |
$subject = 'subject';
$collect['subject'] = $subject;
$type = 'type';
$collect['type'] = $type;
$done = int::ENUM_0;
$collect['done'] = $done;
$dueDate = date("D M d, Y G:i");
$collect['dueDate'] = $dueDate;
$dueTime = 'due_time';
$collect['dueTime'] = $dueTime;
$duration = 'duration';
$collect['duration'] = $duration;
$userId = 119;
$collect['userId'] = $userId;
$dealId = 119;
$collect['dealId'] = $dealId;
$personId = 119;
$collect['personId'] = $personId;
$participants = 'participants';
$collect['participants'] = $participants;
$orgId = 119;
$collect['orgId'] = $orgId;
$note = 'note';
$collect['note'] = $note;
$busyFlag = true;
$collect['busyFlag'] = $busyFlag;
$activities->addAnActivity($collect);
Deletes an activity.
function deleteAnActivity($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the activity |
$id = 119;
$activities->deleteAnActivity($id);
Returns details of a specific activity.
function getDetailsOfAnActivity($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the activity |
$id = 119;
$activities->getDetailsOfAnActivity($id);
Modifies an activity. Includes more_activities_scheduled_in_context property in response's additional_data which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data).
function updateEditAnActivity($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the activity |
subject | Required |
Subject of the activity |
type | Required |
Type of the activity. This is in correlation with the key_string parameter of ActivityTypes. |
done | Optional |
TODO: Add a parameter description |
dueDate | Optional |
Due date of the activity. Format: YYYY-MM-DD |
dueTime | Optional |
Due time of the activity in UTC. Format: HH:MM |
duration | Optional |
Duration of the activity. Format: HH:MM |
userId | Optional |
ID of the user whom the activity will be assigned to. If omitted, the activity will be assigned to the authorized user. |
dealId | Optional |
ID of the deal this activity will be associated with |
personId | Optional |
ID of the person this activity will be associated with |
participants | Optional |
List of multiple persons (participants) this activity will be associated with. If omitted, single participant from person_id field is used. It requires a structure as follows: [{"person_id":1,"primary_flag":true}] |
orgId | Optional |
ID of the organization this activity will be associated with |
note | Optional |
Note of the activity (HTML format) |
busyFlag | Optional |
Set the activity as 'Busy' or 'Free'. If the flag is set to true, your customers will not be able to book that time slot through any Scheduler links. The flag can also be unset by never setting it or overriding it with null. When the value of the flag is unset (null), the flag defaults to 'Busy' if it has a time set, and 'Free' if it is an all-day event without specified time. Format: true/false |
$id = 119;
$collect['id'] = $id;
$subject = 'subject';
$collect['subject'] = $subject;
$type = 'type';
$collect['type'] = $type;
$done = int::ENUM_0;
$collect['done'] = $done;
$dueDate = date("D M d, Y G:i");
$collect['dueDate'] = $dueDate;
$dueTime = 'due_time';
$collect['dueTime'] = $dueTime;
$duration = 'duration';
$collect['duration'] = $duration;
$userId = 119;
$collect['userId'] = $userId;
$dealId = 119;
$collect['dealId'] = $dealId;
$personId = 119;
$collect['personId'] = $personId;
$participants = 'participants';
$collect['participants'] = $participants;
$orgId = 119;
$collect['orgId'] = $orgId;
$note = 'note';
$collect['note'] = $note;
$activities->updateEditAnActivity($collect);
The singleton instance of the ActivityFieldsController
class can be accessed from the API Client.
$activityFields = $client->getActivityFields();
Return list of all fields for activity
function getAllFieldsForAnActivity()
$activityFields->getAllFieldsForAnActivity();
The singleton instance of the ActivityTypesController
class can be accessed from the API Client.
$activityTypes = $client->getActivityTypes();
Marks multiple activity types as deleted.
function deleteMultipleActivityTypesInBulk($ids)
Parameter | Tags | Description |
---|---|---|
ids | Required |
Comma-separated activity type IDs to delete |
$ids = 'ids';
$activityTypes->deleteMultipleActivityTypesInBulk($ids);
Returns all activity types
function getAllActivityTypes()
$activityTypes->getAllActivityTypes();
Adds a new activity type, returns the ID, the key_string and the order number of the newly added activity type upon success.
function addNewActivityType($options)
Parameter | Tags | Description |
---|---|---|
name | Required |
Name of the activity type |
iconKey | Required |
Icon graphic to use for representing this activity type. |
color | Optional |
A designated color for the activity type in 6-character HEX format (e.g. FFFFFF for white, 000000 for black). |
$name = 'name';
$collect['name'] = $name;
$iconKey = string::TASK;
$collect['iconKey'] = $iconKey;
$color = 'color';
$collect['color'] = $color;
$activityTypes->addNewActivityType($collect);
Marks an activity type as deleted.
function deleteAnActivityType($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the activity type |
$id = 119;
$activityTypes->deleteAnActivityType($id);
Updates an activity type.
function updateEditActivityType($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the activity type |
name | Optional |
Name of the activity type |
iconKey | Optional |
Icon graphic to use for representing this activity type. |
color | Optional |
A designated color for the activity type in 6-character HEX format (e.g. FFFFFF for white, 000000 for black). |
orderNr | Optional |
An order number for this activity type. Order numbers should be used to order the types in the activity type selections. |
$id = 119;
$collect['id'] = $id;
$name = 'name';
$collect['name'] = $name;
$iconKey = string::TASK;
$collect['iconKey'] = $iconKey;
$color = 'color';
$collect['color'] = $color;
$orderNr = 119;
$collect['orderNr'] = $orderNr;
$activityTypes->updateEditActivityType($collect);
The singleton instance of the CallLogsController
class can be accessed from the API Client.
$callLogs = $client->getCallLogs();
Returns all call logs assigned to a particular user
function getAllCallLogsAssignedToAParticularUser($options)
Parameter | Tags | Description |
---|---|---|
start | Optional |
For pagination, the position that represents the first result for the page |
limit | Optional |
For pagination, the limit of entries to be returned |
$start = 0;
$options['start'] = $start;
$limit = 119;
$options['limit'] = $limit;
$callLogs->getAllCallLogsAssignedToAParticularUser($options);
Returns details of a specific call log
function getDetailsOfACallLog($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the field |
$id = 1;
$callLogs->getDetailsOfACallLog($id);
Adds a new call log
function addACallLog($collect)
Parameter | Tags | Description |
---|---|---|
user_id | optional |
The ID of the owner of the call log |
activity_id | optional |
If specified, this activity will be converted into a call log, with the information provided. When this field is used, you don't need to specify deal_id, person_id or org_id, as they will be ignored in favor of the values already available in the activity. |
subject | optional |
Name of the activity this call is attached to |
duration | optional |
Call duration in seconds |
outcome | required |
Describes the outcome of the call |
from_phone_number | optional |
The number that made the call |
to_phone_number | required |
The number called |
start_time | required |
The date and time of the start of the call in UTC. Format: YYYY-MM-DD HH:MM:SS. |
end_time | required |
The date and time of the end of the call in UTC. Format: YYYY-MM-DD HH:MM:SS. |
person_id | optional |
The ID of the Person this call is associated with |
org_id | optional |
The ID of the Organization this call is associated with |
deal_id | optional |
The ID of the Deal this call is associated with |
$subject = 'subject';
$collect['subject'] = $subject;
$duration = 60;
$collect['duration'] = $duration;
$outcome = 'connected'
$collect['outcome'] = $connected;
$fromPhoneNumber = '+55 555 5555';
$collect['from_phone_number'] = $fromPhoneNumber;
$fromPhoneNumber = '+55 555 5556';
$collect['to_phone_number'] = $fromPhoneNumber;
$startTime = '2021-01-30 22:30:00';
$collect['start_time'] = $startTime;
$endTime = '2021-01-30 22:31:00';
$collect['end_time'] = $endTime;
$personId = 1;
$collect['person_id'] = $personId;
$orgId = 1;
$collect['org_id'] = $orgId;
$dealId = 1;
$collect['deal_id'] = $dealId;
$note = 'note';
$collect['note'] = $note;
$callLogs->addACallLog($collect);
Adds an audio recording to the call log. That audio can be played by those who have access to the call log object.
function attachAnAudioFileToTheCallLog($id, $collect)
Parameter | Tags | Description |
---|---|---|
id | required |
The ID received when you create the call log |
file | required |
Audio file supported by the HTML5 specification |
mime_type | required |
The mime type of the file, according to html5 standards (eg.: audio/wave for a .wav file ) |
$id = 'id';
$file = "PathToFile";
$collect['file'] = $file;
$callLogs->attachAnAudioFileToTheCallLog($id, $collect);
Deletes a call log. If there is an audio recording attached to it, it will also be deleted. The related activity will not be removed by this request. If you want to remove the related activities, please use the endpoint which is specific for activities.
function deleteACallLog($id)
Parameter | Tags | Description |
---|---|---|
id | required |
ID of the callLog |
$id = 'id';
$callLogs->deleteACallLog($id);
The singleton instance of the CurrenciesController
class can be accessed from the API Client.
$currencies = $client->getCurrencies();
Returns all supported currencies in given account which should be used when saving monetary values with other objects. The 'code' parameter of the returning objects is the currency code according to ISO 4217 for all non-custom currencies.
function getAllSupportedCurrencies($term = null)
Parameter | Tags | Description |
---|---|---|
term | Optional |
Optional search term that is searched for from currency's name and/or code. |
$term = 'term';
$result = $currencies->getAllSupportedCurrencies($term);
The singleton instance of the DealFieldsController
class can be accessed from the API Client.
$dealFields = $client->getDealFields();
Marks multiple fields as deleted.
function deleteMultipleDealFieldsInBulk($ids)
Parameter | Tags | Description |
---|---|---|
ids | Required |
Comma-separated field IDs to delete |
$ids = 'ids';
$dealFields->deleteMultipleDealFieldsInBulk($ids);
Returns data about all fields deals can have
function getAllDealFields($options)
Parameter | Tags | Description |
---|---|---|
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$start = 0;
$collect['start'] = $start;
$limit = 119;
$collect['limit'] = $limit;
$dealFields->getAllDealFields($collect);
Adds a new deal field. For more information on adding a new custom field, see this tutorial.
function addANewDealField($body = null)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
$body = array('key' => 'value');
$dealFields->addANewDealField($body);
Marks a field as deleted. For more information on how to delete a custom field, see this tutorial.
function deleteADealField($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the field |
$id = 119;
$dealFields->deleteADealField($id);
Returns data about a specific deal field.
function getOneDealField($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the field |
$id = 119;
$dealFields->getOneDealField($id);
Updates a deal field. See an example of updating custom fields’ values in this tutorial.
function updateADealField($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the field |
name | Required |
Name of the field |
options | Optional |
When field_type is either set or enum, possible options must be supplied as a JSON-encoded sequential array, for example: ["red","blue","lilac"] |
$id = 119;
$collect['id'] = $id;
$name = 'name';
$collect['name'] = $name;
$options = 'options';
$collect['options'] = $options;
$dealFields->updateADealField($collect);
The singleton instance of the DealsController
class can be accessed from the API Client.
$deals = $client->getDeals();
Marks multiple deals as deleted.
function deleteMultipleDealsInBulk($ids)
Parameter | Tags | Description |
---|---|---|
ids | Required |
Comma-separated IDs that will be deleted |
$ids = 'ids';
$result = $deals->deleteMultipleDealsInBulk($ids);
Returns all deals. For more information on how to get all deals, see this tutorial.
function getAllDeals($options)
Parameter | Tags | Description |
---|---|---|
userId | Optional |
If supplied, only deals matching the given user will be returned. |
filterId | Optional |
ID of the filter to use |
stageId | Optional |
If supplied, only deals within the given stage will be returned. |
status | Optional DefaultValue |
Only fetch deals with specific status. If omitted, all not deleted deals are fetched. |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
sort | Optional |
Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). |
ownedByYou | Optional |
When supplied, only deals owned by you are returned. However filter_id takes precedence over owned_by_you when both are supplied. |
$userId = 119;
$collect['userId'] = $userId;
$filterId = 119;
$collect['filterId'] = $filterId;
$stageId = 119;
$collect['stageId'] = $stageId;
$status = string::ALL_NOT_DELETED;
$collect['status'] = $status;
$start = 0;
$collect['start'] = $start;
$limit = 119;
$collect['limit'] = $limit;
$sort = 'sort';
$collect['sort'] = $sort;
$ownedByYou = int::ENUM_0;
$collect['ownedByYou'] = $ownedByYou;
$result = $deals->getAllDeals($collect);
Searches all Deals by title, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found Deals can be filtered by Person ID and Organization ID.
function searchDeals($options)
Parameter | Tags | Description |
---|---|---|
term | Required |
The search term to look for. Minimum 2 characters (or 1 if using exact_match). |
fields | Optional |
A comma-separated string array. The fields to perform the search from. Defaults to all of them. |
exactMatch | Optional |
When enabled, only full exact matches against the given term are returned. It is not case sensitive. |
personId | Optional |
Will filter Deals by the provided Person ID. The upper limit of found Deals associated with the Person is 2000. |
organizationId | Optional |
Will filter Deals by the provided Organization ID. The upper limit of found Deals associated with the Organization is 2000. |
status | Optional |
Will filter Deals by the provided specific status. open = Open, won = Won, lost = Lost. The upper limit of found Deals associated with the status is 2000. |
includeFields | Optional |
Supports including optional fields in the results which are not provided by default. |
start | Optional |
Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. |
limit | Optional |
Items shown per page |
$term = 'term';
$collect['term'] = $term;
$results = $deals->searchDeals($collect);
Adds a new deal. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the dealFields and look for 'key' values. For more information on how to add a deal, see this tutorial.
function addADeal($body = null)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
$body = array('key' => 'value');
$result = $deals->addADeal($body);
Returns summary of all the deals.
function getDealsSummary($options)
Parameter | Tags | Description |
---|---|---|
status | Optional |
Only fetch deals with specific status. open = Open, won = Won, lost = Lost |
filterId | Optional |
user_id will not be considered. Only deals matching the given filter will be returned. |
userId | Optional |
Only deals matching the given user will be returned. user_id will not be considered if you use filter_id. |
stageId | Optional |
Only deals within the given stage will be returned. |
pipelineId | Optional |
Only deals within the given pipeline will be returned. |
$status = string::OPEN;
$collect['status'] = $status;
$filterId = 119;
$collect['filterId'] = $filterId;
$userId = 119;
$collect['userId'] = $userId;
$stageId = 119;
$collect['stageId'] = $stageId;
$result = $deals->getDealsSummary($collect);
Returns open and won deals, grouped by defined interval of time set in a date-type dealField (field_key) — e.g. when month is the chosen interval, and 3 months are asked starting from January 1st, 2012, deals are returned grouped into 3 groups — January, February and March — based on the value of the given field_key.
function getDealsTimeline($options)
Parameter | Tags | Description |
---|---|---|
startDate | Required |
Date where first interval starts. Format: YYYY-MM-DD |
interval | Required |
Type of interval.
|
amount | Required |
Number of given intervals, starting from start_date, to fetch. E.g. 3 (months). |
fieldKey | Required |
The name of the date field by which to get deals by. |
userId | Optional |
If supplied, only deals matching the given user will be returned. |
pipelineId | Optional |
If supplied, only deals matching the given pipeline will be returned. |
filterId | Optional |
If supplied, only deals matching the given filter will be returned. |
excludeDeals | Optional |
Whether to exclude deals list (1) or not (0). Note that when deals are excluded, the timeline summary (counts and values) is still returned. |
totalsConvertCurrency | Optional |
3-letter currency code of any of the supported currencies. When supplied, totals_converted is returned per each interval which contains the currency-converted total amounts in the given currency. You may also set this parameter to 'default_currency' in which case users default currency is used. |
$startDate = date("D M d, Y G:i");
$collect['startDate'] = $startDate;
$interval = string::DAY;
$collect['interval'] = $interval;
$amount = 119;
$collect['amount'] = $amount;
$fieldKey = 'field_key';
$collect['fieldKey'] = $fieldKey;
$userId = 119;
$collect['userId'] = $userId;
$pipelineId = 119;
$collect['pipelineId'] = $pipelineId;
$filterId = 119;
$collect['filterId'] = $filterId;
$excludeDeals = int::ENUM_0;
$collect['excludeDeals'] = $excludeDeals;
$totalsConvertCurrency = 'totals_convert_currency';
$collect['totalsConvertCurrency'] = $totalsConvertCurrency;
$result = $deals->getDealsTimeline($collect);
Marks a deal as deleted.
function deleteADeal($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
$id = 119;
$result = $deals->deleteADeal($id);
Returns details of a specific deal. Note that this also returns some additional fields which are not present when asking for all deals – such as deal age and stay in pipeline stages. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the 'key' value of dealFields. For more information on how to get all details of a deal, see this tutorial.
function getDetailsOfADeal($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
$id = 119;
$result = $deals->getDetailsOfADeal($id);
Updates the properties of a deal. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the dealFields and look for 'key' values. For more information on how to update a deal, see this tutorial.
function updateADeal($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
title | Optional |
Deal title |
value | Optional |
Value of the deal. If omitted, value will be set to 0. |
currency | Optional |
Currency of the deal. Accepts a 3-character currency code. If omitted, currency will be set to the default currency of the authorized user. |
user_id | Optional |
ID of the user who will be marked as the owner of this deal. If omitted, the authorized user ID will be used. |
person_id | Optional |
ID of the person this deal will be associated with |
org_id | Optional |
ID of the organization this deal will be associated with |
stage_id | Optional |
ID of the stage this deal will be placed in a pipeline (note that you can't supply the ID of the pipeline as this will be assigned automatically based on stage_id). If omitted, the deal will be placed in the first stage of the default pipeline. |
status | Optional |
open = Open, won = Won, lost = Lost, deleted = Deleted. If omitted, status will be set to open. |
expected_close_date | Optional |
The expected close date of the Deal. In ISO 8601 format: YYYY-MM-DD. |
probability | Optional |
Deal success probability percentage. Used/shown only when deal_probability for the pipeline of the deal is enabled. |
lost_reason | Optional |
Optional message about why the deal was lost (to be used when status=lost) |
visible_to | Optional |
Visibility of the deal. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.
|
$id = 27;
$collect['id'] = $id;
$title = 'title';
$collect['title'] = $title;
$value = 'value';
$collect['value'] = $value;
$currency = 'currency';
$collect['currency'] = $currency;
$userId = 27;
$collect['user_id'] = $userId;
$personId = 27;
$collect['person_id'] = $personId;
$orgId = 27;
$collect['org_id'] = $orgId;
$stageId = 27;
$collect['stage_id'] = $stageId;
$status = string::OPEN;
$collect['status'] = $status;
$probability = 27.9633801840075;
$collect['probability'] = $probability;
$lostReason = 'lost_reason';
$collect['lost_reason'] = $lostReason;
$visibleTo = int::ENUM_1;
$collect['visible_to'] = $visibleTo;
$result = $deals->updateADeal($collect);
Lists activities associated with a deal.
function listActivitiesAssociatedWithADeal($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
done | Optional |
Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. |
exclude | Optional |
A comma-separated string of activity IDs to exclude from result |
$id = 27;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 27;
$collect['limit'] = $limit;
$done = int::ENUM_0;
$collect['done'] = $done;
$exclude = 'exclude';
$collect['exclude'] = $exclude;
$deals->listActivitiesAssociatedWithADeal($collect);
Duplicate a deal
function createDuplicateDeal($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
$id = 27;
$result = $deals->createDuplicateDeal($id);
Lists files associated with a deal.
function listFilesAttachedToADeal($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
includeDeletedFiles | Optional |
When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work. |
sort | Optional |
Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment. |
$id = 27;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 27;
$collect['limit'] = $limit;
$includeDeletedFiles = int::ENUM_0;
$collect['includeDeletedFiles'] = $includeDeletedFiles;
$sort = 'sort';
$collect['sort'] = $sort;
$deals->listFilesAttachedToADeal($collect);
Lists updates about a deal.
function listUpdatesAboutADeal($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$id = 27;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 27;
$collect['limit'] = $limit;
$deals->listUpdatesAboutADeal($collect);
Lists the followers of a deal.
function listFollowersOfADeal($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
$id = 27;
$deals->listFollowersOfADeal($id);
Adds a follower to a deal.
function addAFollowerToADeal($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
userId | Required |
ID of the user |
$id = 27;
$collect['id'] = $id;
$userId = 27;
$collect['userId'] = $userId;
$result = $deals->addAFollowerToADeal($collect);
Deletes a follower from a deal.
function deleteAFollowerFromADeal($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
followerId | Required |
ID of the follower |
$id = 27;
$collect['id'] = $id;
$followerId = 27;
$collect['followerId'] = $followerId;
$result = $deals->deleteAFollowerFromADeal($collect);
Lists mail messages associated with a deal.
function listMailMessagesAssociatedWithADeal($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$id = 27;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 27;
$collect['limit'] = $limit;
$deals->listMailMessagesAssociatedWithADeal($collect);
Merges a deal with another deal. For more information on how to merge two deals, see this tutorial.
function updateMergeTwoDeals($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
mergeWithId | Required |
ID of the deal that the deal will be merged with |
$id = 27;
$collect['id'] = $id;
$mergeWithId = 27;
$collect['mergeWithId'] = $mergeWithId;
$result = $deals->updateMergeTwoDeals($collect);
Lists participants associated with a deal.
function listParticipantsOfADeal($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$id = 27;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 27;
$collect['limit'] = $limit;
$deals->listParticipantsOfADeal($collect);
Adds a participant to a deal.
function addAParticipantToADeal($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
personId | Required |
ID of the person |
$id = 27;
$collect['id'] = $id;
$personId = 27;
$collect['personId'] = $personId;
$deals->addAParticipantToADeal($collect);
Deletes a participant from a deal.
function deleteAParticipantFromADeal($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
dealParticipantId | Required |
ID of the deal participant |
$id = 27;
$collect['id'] = $id;
$dealParticipantId = 27;
$collect['dealParticipantId'] = $dealParticipantId;
$result = $deals->deleteAParticipantFromADeal($collect);
List users permitted to access a deal
function listPermittedUsers($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
$id = 27;
$deals->listPermittedUsers($id);
Lists all persons associated with a deal, regardless of whether the person is the primary contact of the deal, or added as a participant.
function listAllPersonsAssociatedWithADeal($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$id = 27;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 27;
$collect['limit'] = $limit;
$deals->listAllPersonsAssociatedWithADeal($collect);
Lists products attached to a deal.
function listProductsAttachedToADeal($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
includeProductData | Optional |
Whether to fetch product data along with each attached product (1) or not (0, default). |
$id = 27;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 27;
$collect['limit'] = $limit;
$includeProductData = int::ENUM_0;
$collect['includeProductData'] = $includeProductData;
$deals->listProductsAttachedToADeal($collect);
Adds a product to the deal.
function addAProductToADeal($options);
function addAProductToTheDealEventuallyCreatingANewItemCalledADealProduct($options);
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
body | Required |
Body object that has all required body parameters |
$id = 27;
$collect['id'] = $id;
$body = array('key' => 'value');
$collect['body'] = $body;
$result = $deals->addAProductToADeal($collect);
// OR
// $result = $deals->addAProductToTheDealEventuallyCreatingANewItemCalledADealProduct($collect);
updateProductAttachmentDetailsOfTheDealProductAProductAlreadyAttachedToADeal
alias updateTheProductAttachedToADeal
Updates product attachment details.
function updateTheProductAttachedToADeal($options);
function updateProductAttachmentDetailsOfTheDealProductAProductAlreadyAttachedToADeal($options);
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
productAttachmentId | Required |
The ID of the deal-product (the ID of the product attached to the deal) |
productId | Required |
The ID of the product to use |
itemPrice | Required |
Price at which this product will be added to the deal |
quantity | Required |
Quantity – e.g. how many items of this product will be added to the deal |
discountPercentage | Optional |
Discount %. If omitted, will be set to 0 |
duration | Optional |
Duration of the product (when product durations are not enabled for the company or if omitted, defaults to 1) |
productVariationId | Optional |
ID of the product variation to use. When omitted, no variation will be used. |
comments | Optional |
Any textual comment associated with this product-deal attachment. Visible and editable in the application UI. |
enabledFlag | Optional |
Whether the product is enabled on the deal or not. This makes it possible to add products to a deal with specific price and discount criteria - but keep them disabled, which refrains them from being included in deal price calculation. When omitted, the product will be marked as enabled by default. |
$id = 27;
$collect['id'] = $id;
$productAttachmentId = 27;
$collect['productAttachmentId'] = $productAttachmentId;
$productId = 2;
$collect['productId'] = $productId;
$itemPrice = 27.9633801840075;
$collect['itemPrice'] = $itemPrice;
$quantity = 27;
$collect['quantity'] = $quantity;
$discountPercentage = 27.9633801840075;
$collect['discountPercentage'] = $discountPercentage;
$duration = 27.9633801840075;
$collect['duration'] = $duration;
$productVariationId = 27;
$collect['productVariationId'] = $productVariationId;
$comments = 'comments';
$collect['comments'] = $comments;
$enabledFlag = int::ENUM_0;
$collect['enabledFlag'] = $enabledFlag;
$result = $deals->updateTheProductAttachedToADeal($collect);
// OR
// $result = $deals->updateProductAttachmentDetailsOfTheDealProductAProductAlreadyAttachedToADeal($collect);
Deletes a product attachment from a deal, using the product_attachment_id.
function deleteAnAttachedProductFromADeal($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the deal |
productAttachmentId | Required |
Product attachment ID. This is returned as product_attachment_id after attaching a product to a deal or as id when listing the products attached to a deal. |
$id = 27;
$collect['id'] = $id;
$productAttachmentId = 27;
$collect['productAttachmentId'] = $productAttachmentId;
$result = $deals->deleteAnAttachedProductFromADeal($collect);
The singleton instance of the FilesController
class can be accessed from the API Client.
$files = $client->getFiles();
Returns data about all files.
function getAllFiles($options)
Parameter | Tags | Description |
---|---|---|
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
includeDeletedFiles | Optional |
When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work. |
sort | Optional |
Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment. |
$start = 0;
$collect['start'] = $start;
$limit = 27;
$collect['limit'] = $limit;
$includeDeletedFiles = int::ENUM_0;
$collect['includeDeletedFiles'] = $includeDeletedFiles;
$sort = 'sort';
$collect['sort'] = $sort;
$files->getAllFiles($collect);
Lets you upload a file and associate it with Deal, Person, Organization, Activity or Product. For more information on how to add a file, see this tutorial.
function addFile($options)
Parameter | Tags | Description |
---|---|---|
file | Required |
A single file, supplied in the multipart/form-data encoding and contained within the given boundaries. |
dealId | Optional |
ID of the deal to associate file(s) with |
personId | Optional |
ID of the person to associate file(s) with |
orgId | Optional |
ID of the organization to associate file(s) with |
productId | Optional |
ID of the product to associate file(s) with |
activityId | Optional |
ID of the activity to associate file(s) with |
noteId | Optional |
ID of the note to associate file(s) with |
$file = "PathToFile";
$collect['file'] = $file;
$dealId = 27;
$collect['dealId'] = $dealId;
$personId = 27;
$collect['personId'] = $personId;
$orgId = 27;
$collect['orgId'] = $orgId;
$productId = 27;
$collect['productId'] = $productId;
$activityId = 27;
$collect['activityId'] = $activityId;
$noteId = 27;
$collect['noteId'] = $noteId;
$files->addFile($collect);
Creates a new empty file in the remote location (googledrive) that will be linked to the item you supply. For more information on how to add a remote file, see this tutorial.
function createARemoteFileAndLinkItToAnItem($options)
Parameter | Tags | Description |
---|---|---|
fileType | Required |
The file type |
title | Required |
The title of the file |
itemType | Required |
The item type |
itemId | Required |
ID of the item to associate the file with |
remoteLocation | Required |
The location type to send the file to. Only googledrive is supported at the moment. |
$fileType = string::GDOC;
$collect['fileType'] = $fileType;
$title = 'title';
$collect['title'] = $title;
$itemType = string::DEAL;
$collect['itemType'] = $itemType;
$itemId = 27;
$collect['itemId'] = $itemId;
$remoteLocation = string::GOOGLEDRIVE;
$collect['remoteLocation'] = $remoteLocation;
$files->createARemoteFileAndLinkItToAnItem($collect);
Links an existing remote file (googledrive) to the item you supply. For more information on how to link a remote file, see this tutorial.
function createLinkARemoteFileToAnItem($options)
Parameter | Tags | Description |
---|---|---|
itemType | Required |
The item type |
itemId | Required |
ID of the item to associate the file with |
remoteId | Required |
The remote item id |
remoteLocation | Required |
The location type to send the file to. Only googledrive is supported at the moment. |
$itemType = string::DEAL;
$collect['itemType'] = $itemType;
$itemId = 27;
$collect['itemId'] = $itemId;
$remoteId = 'remote_id';
$collect['remoteId'] = $remoteId;
$remoteLocation = string::GOOGLEDRIVE;
$collect['remoteLocation'] = $remoteLocation;
$files->createLinkARemoteFileToAnItem($collect);
Marks a file as deleted.
function deleteAFile($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the file |
$id = 27;
$files->deleteAFile($id);
Returns data about a specific file.
function getOneFile($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the file |
$id = 27;
$files->getOneFile($id);
Updates the properties of a file.
function updateFileDetails($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the file |
name | Optional |
Visible name of the file |
description | Optional |
Description of the file |
$id = 27;
$collect['id'] = $id;
$name = 'name';
$collect['name'] = $name;
$description = 'description';
$collect['description'] = $description;
$files->updateFileDetails($collect);
Initializes a file download.
function getDownloadOneFile($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the file |
$id = 27;
$files->getDownloadOneFile($id);
The singleton instance of the FiltersController
class can be accessed from the API Client.
$filters = $client->getFilters();
Marks multiple filters as deleted.
function deleteMultipleFiltersInBulk($ids)
Parameter | Tags | Description |
---|---|---|
ids | Required |
Comma-separated filter IDs to delete |
$ids = 'ids';
$filters->deleteMultipleFiltersInBulk($ids);
Returns data about all filters
function getAllFilters($type = null)
Parameter | Tags | Description |
---|---|---|
type | Optional |
Types of filters to fetch |
$type = string::DEALS;
$filters->getAllFilters($type);
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 on how to add a new filter, see this tutorial.
function addANewFilter($options)
Parameter | Tags | Description |
---|---|---|
name | Required |
Filter name |
conditions | Required |
Filter conditions as a JSON object. It requires a minimum structure as follows: {"glue":"and","conditions":[{"glue":"and","conditions": [CONDITION_OBJECTS]},{"glue":"or","conditions":[CONDITION_OBJECTS]}]}. Replace CONDITION_OBJECTS with JSON objects of the following structure: {"object":"","field_id":"", "operator":"","value":"", "extra_value":""} or leave the array empty. Depending on the object type you should use another API endpoint to get field_id. There are five types of objects you can choose from: "person", "deal", "organization", "product", "activity" and you can use these types of operators depending on what type of a field you have: "IS NOT NULL", "IS NULL", "<=", ">=", "<", ">", "!=", "=", "LIKE '%$%'", "NOT LIKE '%$%'", "LIKE '$%'", "NOT LIKE '$%'", "LIKE '%$'", "NOT LIKE '%$'". To get a better understanding of how filters work try creating them directly from the Pipedrive application. |
type | Required |
Type of filter to create. |
$name = 'name';
$collect['name'] = $name;
$conditions = 'conditions';
$collect['conditions'] = $conditions;
$type = string::DEALS;
$collect['type'] = $type;
$filters->addANewFilter($collect);
Returns all supported filter helpers. It helps to know what conditions and helpers are available when you want to add or update filters. For more information on how filter’s helpers can be used, see this tutorial.
function getAllFilterHelpers()
$filters->getAllFilterHelpers();
Marks a filter as deleted.
function deleteAFilter($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the filter |
$id = 27;
$filters->deleteAFilter($id);
Returns data about a specific filter. Note that this also returns the condition lines of the filter.
function getOneFilter($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the filter |
$id = 27;
$filters->getOneFilter($id);
Updates existing filter.
function updateFilter($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the filter |
conditions | Required |
Filter conditions as a JSON object. It requires a minimum structure as follows: {"glue":"and","conditions":[{"glue":"and","conditions": [CONDITION_OBJECTS]},{"glue":"or","conditions":[CONDITION_OBJECTS]}]}. Replace CONDITION_OBJECTS with JSON objects of the following structure: {"object":"","field_id":"", "operator":"","value":"", "extra_value":""} or leave the array empty. Depending on the object type you should use another API endpoint to get field_id. There are five types of objects you can choose from: "person", "deal", "organization", "product", "activity" and you can use these types of operators depending on what type of a field you have: "IS NOT NULL", "IS NULL", "<=", ">=", "<", ">", "!=", "=", "LIKE '%$%'", "NOT LIKE '%$%'", "LIKE '$%'", "NOT LIKE '$%'", "LIKE '%$'", "NOT LIKE '%$'". To get a better understanding of how filters work try creating them directly from the Pipedrive application. |
name | Optional |
Filter name |
$id = 27;
$collect['id'] = $id;
$conditions = 'conditions';
$collect['conditions'] = $conditions;
$name = 'name';
$collect['name'] = $name;
$filters->updateFilter($collect);
The singleton instance of the GlobalMessagesController
class can be accessed from the API Client.
$globalMessages = $client->getGlobalMessages();
Returns data about global messages to display for the authorized user.
function getGlobalMessages($limit = 1)
Parameter | Tags | Description |
---|---|---|
limit | Optional DefaultValue |
Number of messages to get from 1 to 100. The message number 1 is returned by default. |
$limit = 1;
$result = $globalMessages->getGlobalMessages($limit);
Removes global message from being shown, if message is dismissible
function deleteDismissAGlobalMessage($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of global message to be dismissed. |
$id = 27;
$result = $globalMessages->deleteDismissAGlobalMessage($id);
The singleton instance of the GoalsController
class can be accessed from the API Client.
$goals = $client->getGoals();
Adds a new goal.
function addANewGoal($body = null)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
$body = array('key' => 'value');
$goals->addANewGoal($body);
Returns data about goals based on criteria. For searching, append
{searchField}={searchValue}
to the URL, wheresearchField
can be any one of the lowest-level fields in dot-notation (e.g.type.params.pipeline_id
;title
).searchValue
should be the value you are looking for on that field. Additionally,is_active=<true|false>
can be provided to search for only active/inactive goals. When providingperiod.start
,period.end
must also be provided and vice versa.
function findGoals($options)
Parameter | Tags | Description |
---|---|---|
typeName | Optional |
Type of the goal. If provided, everyone's goals will be returned. |
title | Optional |
Title of the goal. |
isActive | Optional DefaultValue |
Whether goal is active or not. |
assigneeId | Optional |
ID of the user who's goal to fetch. When omitted, only your goals will be returned. |
assigneeType | Optional |
Type of the goal's assignee. If provided, everyone's goals will be returned. |
expectedOutcomeTarget | Optional |
Numeric value of the outcome. If provided, everyone's goals will be returned. |
expectedOutcomeTrackingMetric | Optional |
Tracking metric of the expected outcome of the goal. If provided, everyone's goals will be returned. |
expectedOutcomeCurrencyId | Optional |
Numeric ID of the goal's currency. Only applicable to goals with expected_outcome.tracking_metric with value sum . If provided, everyone's goals will be returned. |
typeParamsPipelineId | Optional |
ID of the pipeline or null for all pipelines. If provided, everyone's goals will be returned. |
typeParamsStageId | Optional |
ID of the stage. Applicable to only deals_progressed type of goals. If provided, everyone's goals will be returned. |
typeParamsActivityTypeId | Optional |
ID of the activity type. Applicable to only activities_completed or activities_added types of goals. If provided, everyone's goals will be returned. |
periodStart | Optional |
Start date of the period for which to find goals. Date in format of YYYY-MM-DD. When period.start is provided, period.end must be provided too. |
periodEnd | Optional |
End date of the period for which to find goals. Date in format of YYYY-MM-DD. |
$typeName = string::DEALS_WON;
$collect['typeName'] = $typeName;
$title = 'title';
$collect['title'] = $title;
$isActive = true;
$collect['isActive'] = $isActive;
$assigneeId = 27;
$collect['assigneeId'] = $assigneeId;
$assigneeType = string::PERSON;
$collect['assigneeType'] = $assigneeType;
$expectedOutcomeTarget = 27.9633801840075;
$collect['expectedOutcomeTarget'] = $expectedOutcomeTarget;
$expectedOutcomeTrackingMetric = string::QUANTITY;
$collect['expectedOutcomeTrackingMetric'] = $expectedOutcomeTrackingMetric;
$expectedOutcomeCurrencyId = 27;
$collect['expectedOutcomeCurrencyId'] = $expectedOutcomeCurrencyId;
$typeParamsPipelineId = 27;
$collect['typeParamsPipelineId'] = $typeParamsPipelineId;
$typeParamsStageId = 27;
$collect['typeParamsStageId'] = $typeParamsStageId;
$typeParamsActivityTypeId = 27;
$collect['typeParamsActivityTypeId'] = $typeParamsActivityTypeId;
$periodStart = date("D M d, Y G:i");
$collect['periodStart'] = $periodStart;
$periodEnd = date("D M d, Y G:i");
$collect['periodEnd'] = $periodEnd;
$goals->findGoals($collect);
Updates existing goal.
function updateExistingGoal($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the goal to be updated. |
title | Optional |
Title of the goal. |
assignee | Optional |
Who is this goal assigned to. It requires the following JSON structure: { "id": "1", "type": "person" }. type can be either person , company or team . ID of the assignee person, company or team. |
type | Optional |
Type of the goal. It requires the following JSON structure: { "name": "deals_started", "params": { "pipeline_id": 1 } }. Type can be one of: deals_won ,deals_progressed ,activities_completed ,activities_added or deals_started . params can include pipeline_id , stage_id or activity_type_id . stage_id is related to only deals_progressed type of goals and activity_type_id to activities_completed or activities_added types of goals. To track goal in all pipelines set pipeline_id as null . |
expectedOutcome | Optional |
Expected outcome of the goal. Expected outcome can be tracked either by quantity or by sum . It requires the following JSON structure: { "target": "50", "tracking_metric": "quantity" } or { "target": "50", "tracking_metric": "sum", "currency_id": 1 }. currency_id should only be added to sum type of goals. |
duration | Optional |
Date when the goal starts and ends. It requires the following JSON structure: { "start": "2019-01-01", "end": "2022-12-31" }. Date in format of YYYY-MM-DD. |
interval | Optional |
Date when the goal starts and ends. It requires the following JSON structure: { "start": "2019-01-01", "end": "2022-12-31" }. Date in format of YYYY-MM-DD. |
$id = 'id';
$collect['id'] = $id;
$title = 'title';
$collect['title'] = $title;
$assignee = array('key' => 'value');
$collect['assignee'] = $assignee;
$type = array('key' => 'value');
$collect['type'] = $type;
$expectedOutcome = array('key' => 'value');
$collect['expectedOutcome'] = $expectedOutcome;
$duration = array('key' => 'value');
$collect['duration'] = $duration;
$interval = string::WEEKLY;
$collect['interval'] = $interval;
$goals->updateExistingGoal($collect);
Marks goal as deleted.
function deleteExistingGoal($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the goal to be deleted. |
$id = 'id';
$goals->deleteExistingGoal($id);
Gets progress of a goal for specified period.
function getResultOfAGoal($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the goal that the results are looked for. |
periodStart | Required |
Start date of the period for which to find progress of a goal. Date in format of YYYY-MM-DD. |
periodEnd | Required |
End date of the period for which to find progress of a goal. Date in format of YYYY-MM-DD. |
$id = 'id';
$collect['id'] = $id;
$periodStart = date("D M d, Y G:i");
$collect['periodStart'] = $periodStart;
$periodEnd = date("D M d, Y G:i");
$collect['periodEnd'] = $periodEnd;
$goals->getResultOfAGoal($collect);
The singleton instance of the ItemSearchController
class can be accessed from the API Client.
$itemSearch = $client->getItemSearch();
Perform a search from multiple item types
function performASearchFromMultipleItemTypes($options)
Parameter | Tags | Description |
---|---|---|
term | Required |
Search term to look for, minimum 2 characters. |
itemTypes | Optional |
A comma-separated string array. The type of items to perform the search from. Defaults to all. |
fields | Optional |
A comma-separated string array. The fields to perform the search from. Defaults to all. |
searchForRelatedItems | Optional |
When enabled, the response will include up to 100 newest related Leads and 100 newest related Deals for each found Person and Organization and up to 100 newest related Persons for each found Organization. |
exactMatch | Optional |
When enabled, only full exact matches against the given term are returned. It is not case sensitive. |
includeFields | Optional |
A comma-separated string array. Supports including optional fields in the results which are not provided by default. |
start | Optional |
Pagination start |
limit | Optional |
Items shown per page |
$term = 'term';
$collect['term'] = $term;
$results = $itemSearch->performASearchFromMultipleItemTypes($collect);
Perform a search using a specific field from an item type
function performASearchUsingASpecificFieldFromAnItemType($options)
Parameter | Tags | Description |
---|---|---|
term | Required |
The search term to look for. Minimum 2 characters (or 1 if using exact_match). |
fieldType | Required |
The type of the field to perform the search from |
fieldKey | Required |
The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields' API GET methods (dealFields, personFields, etc.). |
exactMatch | Optional |
When enabled, only full exact matches against the given term are returned. The search is case sensitive. |
returnItemIds | Optional |
Whether to return the IDs of the matching items or not. When not set or set to 0 or false, only distinct values of the searched field are returned. When set to 1 or true, the ID of each found item is returned. |
start | Optional |
Pagination start |
limit | Optional |
Items shown per page |
$collect['term'] = 'term';
$collect['fieldType'] = 'dealField';
$collect['fieldKey'] = 'title';
$results = $itemSearch->performASearchUsingASpecificFieldFromAnItemType($collect);
The singleton instance of the MailMessagesController
class can be accessed from the API Client.
$mailMessages = $client->getMailMessages();
Returns data about specific mail message.
function getOneMailMessage($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the mail message to fetch. |
includeBody | Optional |
Whether to include full message body or not. 0 = Don't include, 1 = Include |
$id = 27;
$collect['id'] = $id;
$includeBody = int::ENUM_0;
$collect['includeBody'] = $includeBody;
$result = $mailMessages->getOneMailMessage($collect);
The singleton instance of the MailThreadsController
class can be accessed from the API Client.
$mailThreads = $client->getMailThreads();
Returns mail threads in specified folder ordered by most recent message within.
function getMailThreads($options)
Parameter | Tags | Description |
---|---|---|
folder | Required DefaultValue |
Type of folder to fetch. |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$folder = string::INBOX;
$collect['folder'] = $folder;
$start = 0;
$collect['start'] = $start;
$limit = 27;
$collect['limit'] = $limit;
$result = $mailThreads->getMailThreads($collect);
Marks mail thread as deleted.
function deleteMailThread($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the mail thread |
$id = 27;
$result = $mailThreads->deleteMailThread($id);
Returns specific mail thread.
function getOneMailThread($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the mail thread |
$id = 27;
$result = $mailThreads->getOneMailThread($id);
Updates the properties of a mail thread.
function updateMailThreadDetails($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the mail thread |
dealId | Optional |
ID of the deal this thread is associated with |
sharedFlag | Optional |
TODO: Add a parameter description |
readFlag | Optional |
TODO: Add a parameter description |
archivedFlag | Optional |
TODO: Add a parameter description |
$id = 27;
$collect['id'] = $id;
$dealId = 27;
$collect['dealId'] = $dealId;
$sharedFlag = int::ENUM_0;
$collect['sharedFlag'] = $sharedFlag;
$readFlag = int::ENUM_0;
$collect['readFlag'] = $readFlag;
$archivedFlag = int::ENUM_0;
$collect['archivedFlag'] = $archivedFlag;
$result = $mailThreads->updateMailThreadDetails($collect);
Get mail messages inside specified mail thread.
function getAllMailMessagesOfMailThread($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the mail thread |
$id = 27;
$result = $mailThreads->getAllMailMessagesOfMailThread($id);
The singleton instance of the NoteFieldsController
class can be accessed from the API Client.
$noteFields = $client->getNoteFields();
Return list of all fields for note
function getAllFieldsForANote()
$noteFields->getAllFieldsForANote();
The singleton instance of the NotesController
class can be accessed from the API Client.
$notes = $client->getNotes();
Returns all notes.
function getAllNotes($options)
Parameter | Tags | Description |
---|---|---|
userId | Optional |
ID of the user whose notes to fetch. If omitted, notes by all users will be returned. |
leadId | Optional |
ID of the lead which notes to fetch. If omitted, notes about all leads will be returned. |
dealId | Optional |
ID of the deal which notes to fetch. If omitted, notes about all deals will be returned. |
personId | Optional |
ID of the person whose notes to fetch. If omitted, notes about all persons will be returned. |
orgId | Optional |
ID of the organization which notes to fetch. If omitted, notes about all organizations will be returned. |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
sort | Optional |
Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, content, add_time, update_time. |
startDate | Optional |
Date in format of YYYY-MM-DD from which notes to fetch from. |
endDate | Optional |
Date in format of YYYY-MM-DD until which notes to fetch to. |
pinnedToLeadlFlag | Optional |
If set, then results are filtered by note to lead pinning state. |
pinnedToDealFlag | Optional |
If set, then results are filtered by note to deal pinning state. |
pinnedToOrganizationFlag | Optional |
If set, then results are filtered by note to organization pinning state. |
pinnedToPersonFlag | Optional |
If set, then results are filtered by note to person pinning state. |
$userId = 69;
$collect['userId'] = $userId;
$leadId = 'adf21080-0e10-11eb-879b-05d71fb426ec';
$collect['leadId'] = $leadId;
$dealId = 69;
$collect['dealId'] = $dealId;
$personId = 69;
$collect['personId'] = $personId;
$orgId = 69;
$collect['orgId'] = $orgId;
$start = 0;
$collect['start'] = $start;
$limit = 69;
$collect['limit'] = $limit;
$sort = 'sort';
$collect['sort'] = $sort;
$startDate = date("D M d, Y G:i");
$collect['startDate'] = $startDate;
$endDate = date("D M d, Y G:i");
$collect['endDate'] = $endDate;
$pinnedToLeadFlag = int::ENUM_0;
$collect['pinnedToLeadFlag'] = $pinnedToLeadFlag;
$pinnedToDealFlag = int::ENUM_0;
$collect['pinnedToDealFlag'] = $pinnedToDealFlag;
$pinnedToOrganizationFlag = int::ENUM_0;
$collect['pinnedToOrganizationFlag'] = $pinnedToOrganizationFlag;
$pinnedToPersonFlag = int::ENUM_0;
$collect['pinnedToPersonFlag'] = $pinnedToPersonFlag;
$result = $notes->getAllNotes($collect);
Adds a new note.
function addANote($options)
Parameter | Tags | Description |
---|---|---|
content | Required |
Content of the note in HTML format. Subject to sanitization on the back-end. |
userId | Optional |
ID of the user who will be marked as the author of this note. Only an admin can change the author. |
leadId | Optional |
ID of the lead the note will be attached to. |
dealId | Optional |
ID of the deal the note will be attached to. |
personId | Optional |
ID of the person this note will be attached to. |
orgId | Optional |
ID of the organization this note will be attached to. |
addTime | Optional |
Optional creation date & time of the Note in UTC. Can be set in the past or in the future. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS |
pinnedToLeadFlag | Optional |
If set, then results are filtered by note to lead pinning state (lead_id is also required). |
pinnedToDealFlag | Optional |
If set, then results are filtered by note to deal pinning state (deal_id is also required). |
pinnedToOrganizationFlag | Optional |
If set, then results are filtered by note to organization pinning state (org_id is also required). |
pinnedToPersonFlag | Optional |
If set, then results are filtered by note to person pinning state (person_id is also required). |
$content = 'content';
$collect['content'] = $content;
$userId = 69;
$collect['userId'] = $userId;
$leadId = 'adf21080-0e10-11eb-879b-05d71fb426ec';
$collect['leadId'] = $leadId;
$dealId = 69;
$collect['dealId'] = $dealId;
$personId = 69;
$collect['personId'] = $personId;
$orgId = 69;
$collect['orgId'] = $orgId;
$addTime = 'add_time';
$collect['addTime'] = $addTime;
$pinnedToLeadFlag = int::ENUM_0;
$collect['pinnedToLeadFlag'] = $pinnedToLeadFlag;
$pinnedToDealFlag = int::ENUM_0;
$collect['pinnedToDealFlag'] = $pinnedToDealFlag;
$pinnedToOrganizationFlag = int::ENUM_0;
$collect['pinnedToOrganizationFlag'] = $pinnedToOrganizationFlag;
$pinnedToPersonFlag = int::ENUM_0;
$collect['pinnedToPersonFlag'] = $pinnedToPersonFlag;
$result = $notes->addANote($collect);
Deletes a specific note.
function deleteANote($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the note |
$id = 69;
$result = $notes->deleteANote($id);
Returns details about a specific note.
function getOneNote($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the note |
$id = 69;
$result = $notes->getOneNote($id);
Updates a note.
function updateANote($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the note |
content | Required |
Content of the note in HTML format. Subject to sanitization on the back-end. |
userId | Optional |
ID of the user who will be marked as the author of this note. Only an admin can change the author. |
leadId | Optional |
ID of the lead the note will be attached to. |
dealId | Optional |
ID of the deal the note will be attached to. |
personId | Optional |
ID of the person this note will be attached to. |
orgId | Optional |
ID of the organization this note will be attached to. |
addTime | Optional |
Optional creation date & time of the Note in UTC. Can be set in the past or in the future. Requires admin user API token. Format: YYYY-MM-DD HH:MM:SS |
pinnedToLeadFlag | Optional |
If set, then results are filtered by note to lead pinning state (lead_id is also required). |
pinnedToDealFlag | Optional |
If set, then results are filtered by note to deal pinning state (deal_id is also required). |
pinnedToOrganizationFlag | Optional |
If set, then results are filtered by note to organization pinning state (org_id is also required). |
pinnedToPersonFlag | Optional |
If set, then results are filtered by note to person pinning state (person_id is also required). |
$id = 69;
$collect['id'] = $id;
$content = 'content';
$collect['content'] = $content;
$userId = 69;
$collect['userId'] = $userId;
$leadId = 'adf21080-0e10-11eb-879b-05d71fb426ec';
$collect['leadId'] = $leadId;
$dealId = 69;
$collect['dealId'] = $dealId;
$personId = 69;
$collect['personId'] = $personId;
$orgId = 69;
$collect['orgId'] = $orgId;
$addTime = 'add_time';
$collect['addTime'] = $addTime;
$pinnedToLeadFlag = int::ENUM_0;
$collect['pinnedToLeadFlag'] = $pinnedToLeadFlag;
$pinnedToDealFlag = int::ENUM_0;
$collect['pinnedToDealFlag'] = $pinnedToDealFlag;
$pinnedToOrganizationFlag = int::ENUM_0;
$collect['pinnedToOrganizationFlag'] = $pinnedToOrganizationFlag;
$pinnedToPersonFlag = int::ENUM_0;
$collect['pinnedToPersonFlag'] = $pinnedToPersonFlag;
$result = $notes->updateANote($collect);
The singleton instance of the OrganizationFieldsController
class can be accessed from the API Client.
$organizationFields = $client->getOrganizationFields();
Marks multiple fields as deleted.
function deleteMultipleOrganizationFieldsInBulk($ids)
Parameter | Tags | Description |
---|---|---|
ids | Required |
Comma-separated field IDs to delete |
$ids = 'ids';
$organizationFields->deleteMultipleOrganizationFieldsInBulk($ids);
Returns data about all organization fields
function getAllOrganizationFields()
$organizationFields->getAllOrganizationFields();
Adds a new organization field. For more information on adding a new custom field, see this tutorial.
function addANewOrganizationField($body = null)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
$body = array('key' => 'value');
$organizationFields->addANewOrganizationField($body);
Marks a field as deleted. For more information on how to delete a custom field, see this tutorial.
function deleteAnOrganizationField($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the field |
$id = 69;
$organizationFields->deleteAnOrganizationField($id);
Returns data about a specific organization field.
function getOneOrganizationField($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the field |
$id = 69;
$organizationFields->getOneOrganizationField($id);
Updates an organization field. See an example of updating custom fields’ values in this tutorial.
function updateAnOrganizationField($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the field |
name | Required |
Name of the field |
options | Optional |
When field_type is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. All active items must be supplied and already existing items must have their ID supplied. New items only require a label. Example: [{"id":123,"label":"Existing Item"},{"label":"New Item"}] |
$id = 69;
$collect['id'] = $id;
$name = 'name';
$collect['name'] = $name;
$options = 'options';
$collect['options'] = $options;
$organizationFields->updateAnOrganizationField($collect);
The singleton instance of the OrganizationRelationshipsController
class can be accessed from the API Client.
$organizationRelationships = $client->getOrganizationRelationships();
Gets all of the relationships for a supplied organization id.
function getAllRelationshipsForOrganization($orgId)
Parameter | Tags | Description |
---|---|---|
orgId | Required |
ID of the organization to get relationships for |
$orgId = 69;
$organizationRelationships->getAllRelationshipsForOrganization($orgId);
Creates and returns an organization relationship.
function createAnOrganizationRelationship($body = null)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
$body = array('key' => 'value');
$organizationRelationships->createAnOrganizationRelationship($body);
Deletes an organization relationship and returns the deleted id.
function deleteAnOrganizationRelationship($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization relationship |
$id = 69;
$organizationRelationships->deleteAnOrganizationRelationship($id);
Finds and returns an organization relationship from its ID.
function getOneOrganizationRelationship($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization relationship |
orgId | Optional |
ID of the base organization for the returned calculated values |
$id = 69;
$collect['id'] = $id;
$orgId = 69;
$collect['orgId'] = $orgId;
$organizationRelationships->getOneOrganizationRelationship($collect);
Updates and returns an organization relationship.
function updateAnOrganizationRelationship($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization relationship |
orgId | Optional |
ID of the base organization for the returned calculated values |
type | Optional |
The type of organization relationship. |
relOwnerOrgId | Optional |
The owner of this relationship. If type is 'parent', then the owner is the parent and the linked organization is the daughter. |
relLinkedOrgId | Optional |
The linked organization in this relationship. If type is 'parent', then the linked organization is the daughter. |
$id = 69;
$collect['id'] = $id;
$orgId = 69;
$collect['orgId'] = $orgId;
$type = string::PARENT;
$collect['type'] = $type;
$relOwnerOrgId = 69;
$collect['relOwnerOrgId'] = $relOwnerOrgId;
$relLinkedOrgId = 69;
$collect['relLinkedOrgId'] = $relLinkedOrgId;
$organizationRelationships->updateAnOrganizationRelationship($collect);
The singleton instance of the OrganizationsController
class can be accessed from the API Client.
$organizations = $client->getOrganizations();
Marks multiple organizations as deleted.
function deleteMultipleOrganizationsInBulk($ids)
Parameter | Tags | Description |
---|---|---|
ids | Required |
Comma-separated IDs that will be deleted |
$ids = 'ids';
$organizations->deleteMultipleOrganizationsInBulk($ids);
Returns all organizations
function getAllOrganizations($options)
Parameter | Tags | Description |
---|---|---|
userId | Optional |
If supplied, only organizations owned by the given user will be returned. |
filterId | Optional |
ID of the filter to use |
firstChar | Optional |
If supplied, only organizations whose name starts with the specified letter will be returned (case insensitive). |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
sort | Optional |
Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). |
$userId = 69;
$collect['userId'] = $userId;
$filterId = 69;
$collect['filterId'] = $filterId;
$firstChar = 'first_char';
$collect['firstChar'] = $firstChar;
$start = 0;
$collect['start'] = $start;
$limit = 69;
$collect['limit'] = $limit;
$sort = 'sort';
$collect['sort'] = $sort;
$organizations->getAllOrganizations($collect);
Searches all Organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope.
function searchOrganizations($options)
Parameter | Tags | Description |
---|---|---|
term | Required |
The search term to look for. Minimum 2 characters (or 1 if using exact_match). |
fields | Optional |
A comma-separated string array. The fields to perform the search from. Defaults to all of them. |
exactMatch | Optional |
When enabled, only full exact matches against the given term are returned. It is not case sensitive. |
start | Optional |
Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. |
limit | Optional |
Items shown per page |
$term = 'term';
$collect['term'] = $term;
$results = $organizations->searchOrganizations($collect);
Adds a new organization. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the organizationFields and look for 'key' values. For more information on how to add an organization, see this tutorial.
function addAnOrganization($body = null)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
$body = array('key' => 'value');
$organizations->addAnOrganization($body);
Marks an organization as deleted.
function deleteAnOrganization($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization |
$id = 69;
$organizations->deleteAnOrganization($id);
Returns details of an organization. Note that this also returns some additional fields which are not present when asking for all organizations. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the 'key' value of organizationFields.
function getDetailsOfAnOrganization($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization |
$id = 69;
$organizations->getDetailsOfAnOrganization($id);
Updates the properties of an organization. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the organizationFields and look for 'key' values.
function updateAnOrganization($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization |
name | Optional |
Organization name |
ownerId | Optional |
ID of the user who will be marked as the owner of this organization. When omitted, the authorized user ID will be used. |
visibleTo | Optional |
Visibility of the organization. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.<dl class="fields-list"> |
$id = 69;
$collect['id'] = $id;
$name = 'name';
$collect['name'] = $name;
$ownerId = 69;
$collect['ownerId'] = $ownerId;
$visibleTo = int::ENUM_1;
$collect['visibleTo'] = $visibleTo;
$organizations->updateAnOrganization($collect);
Lists activities associated with an organization.
function listActivitiesAssociatedWithAnOrganization($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
done | Optional |
Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. |
exclude | Optional |
A comma-separated string of activity IDs to exclude from result |
$id = 69;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 69;
$collect['limit'] = $limit;
$done = int::ENUM_0;
$collect['done'] = $done;
$exclude = 'exclude';
$collect['exclude'] = $exclude;
$organizations->listActivitiesAssociatedWithAnOrganization($collect);
Lists deals associated with an organization.
function listDealsAssociatedWithAnOrganization($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
status | Optional DefaultValue |
Only fetch deals with specific status. If omitted, all not deleted deals are fetched. |
sort | Optional |
Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). |
onlyPrimaryAssociation | Optional |
If set, only deals that are directly associated to the organization are fetched. If not set (default), all deals are fetched that are either directly or indirectly related to the organization. Indirect relations include relations through custom, organization-type fields and through persons of the given organization. |
$id = 69;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 69;
$collect['limit'] = $limit;
$status = string::ALL_NOT_DELETED;
$collect['status'] = $status;
$sort = 'sort';
$collect['sort'] = $sort;
$onlyPrimaryAssociation = int::ENUM_0;
$collect['onlyPrimaryAssociation'] = $onlyPrimaryAssociation;
$organizations->listDealsAssociatedWithAnOrganization($collect);
Lists files associated with an organization.
function listFilesAttachedToAnOrganization($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
includeDeletedFiles | Optional |
When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work. |
sort | Optional |
Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment. |
$id = 69;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 69;
$collect['limit'] = $limit;
$includeDeletedFiles = int::ENUM_0;
$collect['includeDeletedFiles'] = $includeDeletedFiles;
$sort = 'sort';
$collect['sort'] = $sort;
$organizations->listFilesAttachedToAnOrganization($collect);
Lists updates about an organization.
function listUpdatesAboutAnOrganization($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$id = 69;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 69;
$collect['limit'] = $limit;
$organizations->listUpdatesAboutAnOrganization($collect);
Lists the followers of an organization.
function listFollowersOfAnOrganization($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization |
$id = 69;
$organizations->listFollowersOfAnOrganization($id);
Adds a follower to an organization.
function addAFollowerToAnOrganization($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization |
userId | Required |
ID of the user |
$id = 69;
$collect['id'] = $id;
$userId = 69;
$collect['userId'] = $userId;
$organizations->addAFollowerToAnOrganization($collect);
Deletes a follower from an organization. You can retrieve the follower_id from the List followers of an organization endpoint.
function deleteAFollowerFromAnOrganization($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization |
followerId | Required |
ID of the follower |
$id = 69;
$collect['id'] = $id;
$followerId = 69;
$collect['followerId'] = $followerId;
$organizations->deleteAFollowerFromAnOrganization($collect);
Lists mail messages associated with an organization.
function listMailMessagesAssociatedWithAnOrganization($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$id = 69;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 69;
$collect['limit'] = $limit;
$organizations->listMailMessagesAssociatedWithAnOrganization($collect);
Merges an organization with another organization. For more information on how to merge two organizations, see this tutorial.
function updateMergeTwoOrganizations($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization |
mergeWithId | Required |
ID of the organization that the organization will be merged with |
$id = 69;
$collect['id'] = $id;
$mergeWithId = 69;
$collect['mergeWithId'] = $mergeWithId;
$organizations->updateMergeTwoOrganizations($collect);
List users permitted to access an organization
function listPermittedUsers($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization |
$id = 69;
$organizations->listPermittedUsers($id);
Lists persons associated with an organization.
function listPersonsOfAnOrganization($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the organization |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$id = 69;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 69;
$collect['limit'] = $limit;
$organizations->listPersonsOfAnOrganization($collect);
The singleton instance of the PermissionSetsController
class can be accessed from the API Client.
$permissionSets = $client->getPermissionSets();
Get all Permission Sets
function getAllPermissionSets()
$result = $permissionSets->getAllPermissionSets();
Error Code | Error Description |
---|---|
404 | If the User ID has no assignments, then it will return NotFound |
Get one Permission Set
function getOnePermissionSet($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the permission set |
$id = 69;
$result = $permissionSets->getOnePermissionSet($id);
Error Code | Error Description |
---|---|
404 | If the User ID has no assignments, then it will return NotFound |
The list of assignments for a Permission Set
function listPermissionSetAssignments($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the permission set |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$id = 69;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 69;
$collect['limit'] = $limit;
$result = $permissionSets->listPermissionSetAssignments($collect);
Error Code | Error Description |
---|---|
404 | If the User ID has no assignments, then it will return NotFound |
The singleton instance of the PersonFieldsController
class can be accessed from the API Client.
$personFields = $client->getPersonFields();
Marks multiple fields as deleted.
function deleteMultiplePersonFieldsInBulk($ids)
Parameter | Tags | Description |
---|---|---|
ids | Required |
Comma-separated field IDs to delete |
$ids = 'ids';
$personFields->deleteMultiplePersonFieldsInBulk($ids);
Returns data about all person fields
function getAllPersonFields()
Parameter | Tags | Description |
---|---|---|
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$start = 0;
$collect['start'] = $start;
$limit = 69;
$collect['limit'] = $limit;
$personFields->getAllPersonFields($collect);
Adds a new person field. For more information on adding a new custom field, see this tutorial.
function addANewPersonField($body = null)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
$body = array('key' => 'value');
$personFields->addANewPersonField($body);
Marks a field as deleted. For more information on how to delete a custom field, see this tutorial.
function deleteAPersonField($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the field |
$id = 69;
$personFields->deleteAPersonField($id);
Returns data about a specific person field.
function getOnePersonField($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the field |
$id = 69;
$personFields->getOnePersonField($id);
Updates a person field. See an example of updating custom fields’ values in this tutorial.
function updateAPersonField($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the field |
name | Required |
Name of the field |
options | Optional |
When field_type is either set or enum, possible options must be supplied as a JSON-encoded sequential array of objects. All active items must be supplied and already existing items must have their ID supplied. New items only require a label. Example: [{"id":123,"label":"Existing Item"},{"label":"New Item"}] |
$id = 69;
$collect['id'] = $id;
$name = 'name';
$collect['name'] = $name;
$options = 'options';
$collect['options'] = $options;
$personFields->updateAPersonField($collect);
The singleton instance of the PersonsController
class can be accessed from the API Client.
$persons = $client->getPersons();
Marks multiple persons as deleted.
function deleteMultiplePersonsInBulk($ids = null)
Parameter | Tags | Description |
---|---|---|
ids | Optional |
Comma-separated IDs that will be deleted |
$ids = 'ids';
$persons->deleteMultiplePersonsInBulk($ids);
Returns all persons
function getAllPersons($options)
Parameter | Tags | Description |
---|---|---|
userId | Optional |
If supplied, only persons owned by the given user will be returned. |
filterId | Optional |
ID of the filter to use. |
firstChar | Optional |
If supplied, only persons whose name starts with the specified letter will be returned (case insensitive). |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
sort | Optional |
Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). |
$userId = 233;
$collect['userId'] = $userId;
$filterId = 233;
$collect['filterId'] = $filterId;
$firstChar = 'first_char';
$collect['firstChar'] = $firstChar;
$start = 0;
$collect['start'] = $start;
$limit = 233;
$collect['limit'] = $limit;
$sort = 'sort';
$collect['sort'] = $sort;
$persons->getAllPersons($collect);
Searches all Persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope. Found Persons can be filtered by Organization ID.
function searchPersons($options)
Parameter | Tags | Description |
---|---|---|
term | Required |
The search term to look for. Minimum 2 characters (or 1 if using exact_match). |
fields | Optional |
A comma-separated string array. The fields to perform the search from. Defaults to all of them. |
exactMatch | Optional |
When enabled, only full exact matches against the given term are returned. It is not case sensitive. |
organizationId | Optional |
Will filter Deals by the provided Organization ID. The upper limit of found Deals associated with the Organization is 2000. |
includeFields | Optional |
Supports including optional fields in the results which are not provided by default. |
start | Optional |
Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. |
limit | Optional |
Items shown per page |
$term = 'term';
$collect['term'] = $term;
$results = $persons->searchPersons($collect);
Adds a new person. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the personFields and look for 'key' values.
function addAPerson($body = null)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
$body = array('key' => 'value');
$persons->addAPerson($body);
Marks a person as deleted.
function deleteAPerson($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of a person |
$id = 233;
$persons->deleteAPerson($id);
Returns details of a person. Note that this also returns some additional fields which are not present when asking for all persons. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the 'key' value of personFields.
function getDetailsOfAPerson($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of a person |
$id = 233;
$persons->getDetailsOfAPerson($id);
Updates the properties of a person. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the personFields and look for 'key' values. For more information on how to update a person, see this tutorial.
function updateAPerson($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of a person |
name | Optional |
Person name |
ownerId | Optional |
ID of the user who will be marked as the owner of this person. When omitted, the authorized user ID will be used. |
orgId | Optional |
ID of the organization this person will belong to. |
Optional Collection |
Email addresses (one or more) associated with the person, presented in the same manner as received by GET request of a person. | |
phone | Optional Collection |
Phone numbers (one or more) associated with the person, presented in the same manner as received by GET request of a person. |
visibleTo | Optional |
Visibility of the person. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.
|
$id = 233;
$collect['id'] = $id;
$name = 'name';
$collect['name'] = $name;
$ownerId = 233;
$collect['ownerId'] = $ownerId;
$orgId = 233;
$collect['orgId'] = $orgId;
$email = array('email');
$collect['email'] = $email;
$phone = array('phone');
$collect['phone'] = $phone;
$visibleTo = int::ENUM_1;
$collect['visibleTo'] = $visibleTo;
$persons->updateAPerson($collect);
Lists activities associated with a person.
function listActivitiesAssociatedWithAPerson($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of a person |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
done | Optional |
Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. |
exclude | Optional |
A comma-separated string of activity IDs to exclude from result |
$id = 233;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 233;
$collect['limit'] = $limit;
$done = int::ENUM_0;
$collect['done'] = $done;
$exclude = 'exclude';
$collect['exclude'] = $exclude;
$persons->listActivitiesAssociatedWithAPerson($collect);
Lists deals associated with a person.
function listDealsAssociatedWithAPerson($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of a person |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
status | Optional DefaultValue |
Only fetch deals with specific status. If omitted, all not deleted deals are fetched. |
sort | Optional |
Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). |
$id = 233;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 233;
$collect['limit'] = $limit;
$status = string::ALL_NOT_DELETED;
$collect['status'] = $status;
$sort = 'sort';
$collect['sort'] = $sort;
$persons->listDealsAssociatedWithAPerson($collect);
Lists files associated with a person.
function listFilesAttachedToAPerson($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of a person |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
includeDeletedFiles | Optional |
When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work. |
sort | Optional |
Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment. |
$id = 233;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 233;
$collect['limit'] = $limit;
$includeDeletedFiles = int::ENUM_0;
$collect['includeDeletedFiles'] = $includeDeletedFiles;
$sort = 'sort';
$collect['sort'] = $sort;
$persons->listFilesAttachedToAPerson($collect);
Lists updates about a person.
function listUpdatesAboutAPerson($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of a person |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$id = 233;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 233;
$collect['limit'] = $limit;
$persons->listUpdatesAboutAPerson($collect);
Lists the followers of a person.
function listFollowersOfAPerson($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of a person |
$id = 233;
$persons->listFollowersOfAPerson($id);
Adds a follower to a person.
function addAFollowerToAPerson($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of a person |
userId | Required |
ID of the user |
$id = 19;
$collect['id'] = $id;
$userId = 19;
$collect['userId'] = $userId;
$persons->addAFollowerToAPerson($collect);
Delete a follower from a person
function deletesAFollowerFromAPerson($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of a person |
followerId | Required |
ID of the follower |
$id = 19;
$collect['id'] = $id;
$followerId = 19;
$collect['followerId'] = $followerId;
$persons->deletesAFollowerFromAPerson($collect);
Lists mail messages associated with a person.
function listMailMessagesAssociatedWithAPerson($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of a person |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$id = 19;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 19;
$collect['limit'] = $limit;
$persons->listMailMessagesAssociatedWithAPerson($collect);
Merges a person with another person. For more information on how to merge two persons, see this tutorial.
function updateMergeTwoPersons($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of a person |
mergeWithId | Required |
ID of the person that the person will be merged with |
$id = 19;
$collect['id'] = $id;
$mergeWithId = 19;
$collect['mergeWithId'] = $mergeWithId;
$persons->updateMergeTwoPersons($collect);
List users permitted to access a person
function listPermittedUsers($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of a person |
$id = 19;
$persons->listPermittedUsers($id);
Delete person picture
function deletePersonPicture($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of a person |
$id = 19;
$persons->deletePersonPicture($id);
Add a picture to a person. If a picture is already set, the old picture will be replaced. Added image (or the cropping parameters supplied with the request) should have an equal width and height and should be at least 128 pixels. GIF, JPG and PNG are accepted. All added images will be resized to 128 and 512 pixel wide squares.
function addPersonPicture($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of a person |
file | Required |
One image supplied in the multipart/form-data encoding. |
cropX | Optional |
X coordinate to where start cropping form (in pixels) |
cropY | Optional |
Y coordinate to where start cropping form (in pixels) |
cropWidth | Optional |
Width of cropping area (in pixels) |
cropHeight | Optional |
Height of cropping area (in pixels) |
$id = 19;
$collect['id'] = $id;
$file = "PathToFile";
$collect['file'] = $file;
$cropX = 19;
$collect['cropX'] = $cropX;
$cropY = 19;
$collect['cropY'] = $cropY;
$cropWidth = 19;
$collect['cropWidth'] = $cropWidth;
$cropHeight = 19;
$collect['cropHeight'] = $cropHeight;
$persons->addPersonPicture($collect);
Lists products associated with a person.
function listProductsAssociatedWithAPerson($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of a person |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$id = 19;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 19;
$collect['limit'] = $limit;
$persons->listProductsAssociatedWithAPerson($collect);
The singleton instance of the PipelinesController
class can be accessed from the API Client.
$pipelines = $client->getPipelines();
Returns data about all pipelines
function getAllPipelines()
$pipelines->getAllPipelines();
Adds a new pipeline
function addANewPipeline($options)
Parameter | Tags | Description |
---|---|---|
name | Optional |
Name of the pipeline |
dealProbability | Optional |
TODO: Add a parameter description |
orderNr | Optional |
Defines pipelines order. First order(order_nr=0) is the default pipeline. |
active | Optional |
TODO: Add a parameter description |
$name = 'name';
$collect['name'] = $name;
$dealProbability = int::ENUM_0;
$collect['dealProbability'] = $dealProbability;
$orderNr = 19;
$collect['orderNr'] = $orderNr;
$active = int::ENUM_0;
$collect['active'] = $active;
$pipelines->addANewPipeline($collect);
Marks a pipeline as deleted.
function deleteAPipeline($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the pipeline |
$id = 19;
$pipelines->deleteAPipeline($id);
Returns data about a specific pipeline. Also returns the summary of the deals in this pipeline across its stages.
function getOnePipeline($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the pipeline |
totalsConvertCurrency | Optional |
3-letter currency code of any of the supported currencies. When supplied, per_stages_converted is returned in deals_summary which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to 'default_currency' in which case users default currency is used. |
$id = 19;
$collect['id'] = $id;
$totalsConvertCurrency = 'totals_convert_currency';
$collect['totalsConvertCurrency'] = $totalsConvertCurrency;
$pipelines->getOnePipeline($collect);
Updates pipeline properties
function updateEditAPipeline($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the pipeline |
name | Optional |
Name of the pipeline |
dealProbability | Optional |
TODO: Add a parameter description |
orderNr | Optional |
Defines pipelines order. First order(order_nr=0) is the default pipeline. |
active | Optional |
TODO: Add a parameter description |
$id = 19;
$collect['id'] = $id;
$name = 'name';
$collect['name'] = $name;
$dealProbability = int::ENUM_0;
$collect['dealProbability'] = $dealProbability;
$orderNr = 19;
$collect['orderNr'] = $orderNr;
$active = int::ENUM_0;
$collect['active'] = $active;
$pipelines->updateEditAPipeline($collect);
Returns all stage-to-stage conversion and pipeline-to-close rates for given time period.
function getDealsConversionRatesInPipeline($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the pipeline |
startDate | Required |
Start of the period. Date in format of YYYY-MM-DD. |
endDate | Required |
End of the period. Date in format of YYYY-MM-DD. |
userId | Optional |
ID of the user who's pipeline metrics statistics to fetch. If omitted, the authorized user will be used. |
$id = 19;
$collect['id'] = $id;
$startDate = date("D M d, Y G:i");
$collect['startDate'] = $startDate;
$endDate = date("D M d, Y G:i");
$collect['endDate'] = $endDate;
$userId = 19;
$collect['userId'] = $userId;
$pipelines->getDealsConversionRatesInPipeline($collect);
Lists deals in a specific pipeline across all its stages
function getDealsInAPipeline($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the pipeline |
filterId | Optional |
If supplied, only deals matching the given filter will be returned. |
userId | Optional |
If supplied, filter_id will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. |
everyone | Optional |
If supplied, filter_id and user_id will not be considered – instead, deals owned by everyone will be returned. |
stageId | Optional |
If supplied, only deals within the given stage will be returned. |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
getSummary | Optional |
Whether to include summary of the pipeline in the additional_data or not. |
totalsConvertCurrency | Optional |
3-letter currency code of any of the supported currencies. When supplied, per_stages_converted is returned inside deals_summary inside additional_data which contains the currency-converted total amounts in the given currency per each stage. You may also set this parameter to 'default_currency' in which case users default currency is used. Only works when get_summary parameter flag is enabled. |
$id = 19;
$collect['id'] = $id;
$filterId = 19;
$collect['filterId'] = $filterId;
$userId = 19;
$collect['userId'] = $userId;
$everyone = int::ENUM_0;
$collect['everyone'] = $everyone;
$stageId = 19;
$collect['stageId'] = $stageId;
$start = 0;
$collect['start'] = $start;
$limit = 19;
$collect['limit'] = $limit;
$getSummary = int::ENUM_0;
$collect['getSummary'] = $getSummary;
$totalsConvertCurrency = 'totals_convert_currency';
$collect['totalsConvertCurrency'] = $totalsConvertCurrency;
$pipelines->getDealsInAPipeline($collect);
Returns statistics for deals movements for given time period.
function getDealsMovementsInPipeline($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the pipeline |
startDate | Required |
Start of the period. Date in format of YYYY-MM-DD. |
endDate | Required |
End of the period. Date in format of YYYY-MM-DD. |
userId | Optional |
ID of the user who's pipeline statistics to fetch. If omitted, the authorized user will be used. |
$id = 19;
$collect['id'] = $id;
$startDate = date("D M d, Y G:i");
$collect['startDate'] = $startDate;
$endDate = date("D M d, Y G:i");
$collect['endDate'] = $endDate;
$userId = 19;
$collect['userId'] = $userId;
$pipelines->getDealsMovementsInPipeline($collect);
The singleton instance of the ProductFieldsController
class can be accessed from the API Client.
$productFields = $client->getProductFields();
Marks multiple fields as deleted.
function deleteMultipleProductFieldsInBulk($ids)
Parameter | Tags | Description |
---|---|---|
ids | Required |
Comma-separated field IDs to delete |
$ids = 'ids';
$result = $productFields->deleteMultipleProductFieldsInBulk($ids);
Returns data about all product fields
function getAllProductFields()
$result = $productFields->getAllProductFields();
Adds a new product field. For more information on adding a new custom field, see this tutorial.
function addANewProductField($body = null)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
$body = array('key' => 'value');
$result = $productFields->addANewProductField($body);
Marks a field as deleted. For more information on how to delete a custom field, see this tutorial.
function deleteAProductField($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the Product Field |
$id = 19;
$result = $productFields->deleteAProductField($id);
Error Code | Error Description |
---|---|
410 | The Product Field with the specified ID does not exist or is inaccessible |
Returns data about a specific product field.
function getOneProductField($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the Product Field |
$id = 19;
$result = $productFields->getOneProductField($id);
Error Code | Error Description |
---|---|
410 | The Product Field with the specified ID does not exist or is inaccessible |
Updates a product field. See an example of updating custom fields’ values in this tutorial.
function updateAProductField($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the Product Field |
name | Required |
Name of the field |
options | Optional |
When field_type is either set or enum, possible options must be supplied as a JSON-encoded sequential array, for example: ["red","blue","lilac"] |
$id = 19;
$collect['id'] = $id;
$name = 'name';
$collect['name'] = $name;
$options = 'options';
$collect['options'] = $options;
$result = $productFields->updateAProductField($collect);
The singleton instance of the ProductsController
class can be accessed from the API Client.
$products = $client->getProducts();
Returns data about all products.
function getAllProducts($options)
Parameter | Tags | Description |
---|---|---|
userId | Optional |
If supplied, only products owned by the given user will be returned. |
filterId | Optional |
ID of the filter to use |
firstChar | Optional |
If supplied, only products whose name starts with the specified letter will be returned (case insensitive). |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$userId = 19;
$collect['userId'] = $userId;
$filterId = 19;
$collect['filterId'] = $filterId;
$firstChar = 'first_char';
$collect['firstChar'] = $firstChar;
$start = 0;
$collect['start'] = $start;
$limit = 19;
$collect['limit'] = $limit;
$result = $products->getAllProducts($collect);
Searches all Products by name, code and/or custom fields. This endpoint is a wrapper of /v1/itemSearch with a narrower OAuth scope.
function searchProducts($options)
Parameter | Tags | Description |
---|---|---|
term | Required |
The search term to look for. Minimum 2 characters (or 1 if using exact_match). |
fields | Optional |
A comma-separated string array. The fields to perform the search from. Defaults to all of them. |
exactMatch | Optional |
When enabled, only full exact matches against the given term are returned. It is not case sensitive. |
includeFields | Optional |
Supports including optional fields in the results which are not provided by default. |
start | Optional |
Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. |
limit | Optional |
Items shown per page |
$term = 'term';
$collect['term'] = $term;
$results = $products->searchProducts($collect);
Adds a new product to the products inventory. For more information on how to add a product, see this tutorial. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the productFields and look for 'key' values.
function addAProduct($body = null)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
$body = array('key' => 'value');
$products->addAProduct($body);
Marks a product as deleted.
function deleteAProduct($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the product |
$id = 19;
$products->deleteAProduct($id);
Returns data about a specific product.
function getOneProduct($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the product |
$id = 19;
$products->getOneProduct($id);
Updates product data. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the productFields and look for 'key' values.
function updateAProduct($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the product |
name | Optional |
Name of the product. |
code | Optional |
Product code. |
unit | Optional |
Unit in which this product is sold |
tax | Optional |
Tax percentage |
activeFlag | Optional |
Whether this product will be made active or not. |
visibleTo | Optional |
Visibility of the product. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.
|
ownerId | Optional |
ID of the user who will be marked as the owner of this product. When omitted, the authorized user ID will be used. |
prices | Optional |
Array of objects, each containing: currency (string), price (number), cost (number, optional), overhead_cost (number, optional). Note that there can only be one price per product per currency. When 'prices' is omitted altogether, no prices will be set up for the product. |
$id = 19;
$collect['id'] = $id;
$name = 'name';
$collect['name'] = $name;
$code = 'code';
$collect['code'] = $code;
$unit = 'unit';
$collect['unit'] = $unit;
$tax = 19.9144447454784;
$collect['tax'] = $tax;
$activeFlag = int::ENUM_0;
$collect['activeFlag'] = $activeFlag;
$visibleTo = int::ENUM_1;
$collect['visibleTo'] = $visibleTo;
$ownerId = 19;
$collect['ownerId'] = $ownerId;
$prices = 'prices';
$collect['prices'] = $prices;
$result = $products->updateAProduct($collect);
Returns data about deals that have a product attached to.
function getDealsWhereAProductIsAttachedTo($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the product |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
status | Optional DefaultValue |
Only fetch deals with specific status. If omitted, all not deleted deals are fetched. |
$id = 19;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 19;
$collect['limit'] = $limit;
$status = string::ALL_NOT_DELETED;
$collect['status'] = $status;
$result = $products->getDealsWhereAProductIsAttachedTo($collect);
Lists files associated with a product.
function listFilesAttachedToAProduct($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the product |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
includeDeletedFiles | Optional |
When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work. |
sort | Optional |
Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment. |
$id = 19;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 19;
$collect['limit'] = $limit;
$includeDeletedFiles = int::ENUM_0;
$collect['includeDeletedFiles'] = $includeDeletedFiles;
$sort = 'sort';
$collect['sort'] = $sort;
$products->listFilesAttachedToAProduct($collect);
Lists the followers of a Product
function listFollowersOfAProduct($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the product |
$id = 19;
$result = $products->listFollowersOfAProduct($id);
Adds a follower to a product.
function addAFollowerToAProduct($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the product |
userId | Required |
ID of the user |
$id = 19;
$collect['id'] = $id;
$userId = 19;
$collect['userId'] = $userId;
$result = $products->addAFollowerToAProduct($collect);
Deletes a follower from a product.
function deleteAFollowerFromAProduct($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the product |
followerId | Required |
ID of the follower |
$id = 19;
$collect['id'] = $id;
$followerId = 19;
$collect['followerId'] = $followerId;
$result = $products->deleteAFollowerFromAProduct($collect);
Lists users permitted to access a product.
function listPermittedUsers($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the product |
$id = 19;
$result = $products->listPermittedUsers($id);
The singleton instance of the RecentsController
class can be accessed from the API Client.
$recents = $client->getRecents();
Returns data about all recent changes occured after given timestamp.
function getRecents($options)
Parameter | Tags | Description |
---|---|---|
sinceTimestamp | Required |
Timestamp in UTC. Format: YYYY-MM-DD HH:MM:SS |
items | Optional |
Multiple selection of item types to include in query (optional) |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$sinceTimestamp = 'since_timestamp';
$collect['sinceTimestamp'] = $sinceTimestamp;
$items = string::ACTIVITY;
$collect['items'] = $items;
$start = 0;
$collect['start'] = $start;
$limit = 19;
$collect['limit'] = $limit;
$recents->getRecents($collect);
The singleton instance of the RolesController
class can be accessed from the API Client.
$roles = $client->getRoles();
Get all roles
function getAllRoles($options)
Parameter | Tags | Description |
---|---|---|
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$start = 0;
$collect['start'] = $start;
$limit = 19;
$collect['limit'] = $limit;
$result = $roles->getAllRoles($collect);
Add a role
function addARole($body = null)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
$body = array('key' => 'value');
$result = $roles->addARole($body);
Delete a role
function deleteARole($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the role |
$id = 19;
$result = $roles->deleteARole($id);
Get one role
function getOneRole($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the role |
$id = 19;
$result = $roles->getOneRole($id);
Update role details
function updateRoleDetails($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the role |
parentRoleId | Optional |
The ID of the parent Role |
name | Optional |
The name of the Role |
$id = 19;
$collect['id'] = $id;
$parentRoleId = 19;
$collect['parentRoleId'] = $parentRoleId;
$name = 'name';
$collect['name'] = $name;
$result = $roles->updateRoleDetails($collect);
Delete assignment from a role
function deleteARoleAssignment($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the role |
userId | Required |
ID of the user |
$id = 19;
$collect['id'] = $id;
$userId = 19;
$collect['userId'] = $userId;
$result = $roles->deleteARoleAssignment($collect);
List assignments for a role
function listRoleAssignments($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the role |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$id = 19;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 19;
$collect['limit'] = $limit;
$result = $roles->listRoleAssignments($collect);
Add assignment for a role
function addRoleAssignment($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the role |
userId | Required |
ID of the user |
$id = 19;
$collect['id'] = $id;
$userId = 19;
$collect['userId'] = $userId;
$result = $roles->addRoleAssignment($collect);
List role sub-roles
function listRoleSubRoles($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the role |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$id = 19;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 19;
$collect['limit'] = $limit;
$result = $roles->listRoleSubRoles($collect);
List role settings
function listRoleSettings($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the role |
$id = 19;
$result = $roles->listRoleSettings($id);
Add or update role setting
function addOrUpdateRoleSetting($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the role |
settingKey | Required |
TODO: Add a parameter description |
value | Required |
Possible values for default_visibility settings: 0...1. |
$id = 19;
$collect['id'] = $id;
$settingKey = string::DEAL_DEFAULT_VISIBILITY;
$collect['settingKey'] = $settingKey;
$value = int::ENUM_0;
$collect['value'] = $value;
$result = $roles->addOrUpdateRoleSetting($collect);
The singleton instance of the StagesController
class can be accessed from the API Client.
$stages = $client->getStages();
Marks multiple stages as deleted.
function deleteMultipleStagesInBulk($ids)
Parameter | Tags | Description |
---|---|---|
ids | Required |
Comma-separated stage IDs to delete |
$ids = 'ids';
$stages->deleteMultipleStagesInBulk($ids);
Returns data about all stages
function getAllStages($pipelineId = null)
Parameter | Tags | Description |
---|---|---|
pipelineId | Optional |
ID of the pipeline to fetch stages for. If omitted, stages for all pipelines will be fetched. |
$pipelineId = 19;
$stages->getAllStages($pipelineId);
Adds a new stage, returns the ID upon success.
function addANewStage($body = null)
Parameter | Tags | Description |
---|---|---|
body | Optional |
TODO: Add a parameter description |
$body = array('key' => 'value');
$stages->addANewStage($body);
Marks a stage as deleted.
function deleteAStage($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the stage |
$id = 19;
$stages->deleteAStage($id);
Returns data about a specific stage
function getOneStage($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the stage |
$id = 19;
$stages->getOneStage($id);
Updates the properties of a stage.
function updateStageDetails($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the stage |
body | Optional |
TODO: Add a parameter description |
$id = 19;
$collect['id'] = $id;
$body = array('key' => 'value');
$collect['body'] = $body;
$stages->updateStageDetails($collect);
Lists deals in a specific stage
function getDealsInAStage($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the stage |
filterId | Optional |
If supplied, only deals matching the given filter will be returned. |
userId | Optional |
If supplied, filter_id will not be considered and only deals owned by the given user will be returned. If omitted, deals owned by the authorized user will be returned. |
everyone | Optional |
If supplied, filter_id and user_id will not be considered – instead, deals owned by everyone will be returned. |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$id = 19;
$collect['id'] = $id;
$filterId = 19;
$collect['filterId'] = $filterId;
$userId = 19;
$collect['userId'] = $userId;
$everyone = int::ENUM_0;
$collect['everyone'] = $everyone;
$start = 0;
$collect['start'] = $start;
$limit = 19;
$collect['limit'] = $limit;
$stages->getDealsInAStage($collect);
The singleton instance of the TeamsController
class can be accessed from the API Client.
$teams = $client->getTeams();
Returns data about teams within the company
function getAllTeams($options)
Parameter | Tags | Description |
---|---|---|
orderBy | Optional DefaultValue |
Field name to sort returned teams by |
skipUsers | Optional |
When enabled, the teams will not include IDs of member users |
$orderBy = string::ID;
$collect['orderBy'] = $orderBy;
$skipUsers = int::ENUM_0;
$collect['skipUsers'] = $skipUsers;
$result = $teams->getAllTeams($collect);
Adds a new team to the company and returns the created object
function addANewTeam($options)
Parameter | Tags | Description |
---|---|---|
name | Required |
The Team name |
managerId | Required |
The Team manager ID |
description | Optional |
The Team description |
users | Optional Collection |
IDs of the Users that belong to the Team |
$name = 'name';
$collect['name'] = $name;
$managerId = 183;
$collect['managerId'] = $managerId;
$description = 'description';
$collect['description'] = $description;
$users = array(183);
$collect['users'] = $users;
$result = $teams->addANewTeam($collect);
Error Code | Error Description |
---|---|
403 | Forbidden response |
Returns data about a specific team
function getASingleTeam($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the team |
skipUsers | Optional |
When enabled, the teams will not include IDs of member users |
$id = 183;
$collect['id'] = $id;
$skipUsers = int::ENUM_0;
$collect['skipUsers'] = $skipUsers;
$result = $teams->getASingleTeam($collect);
Error Code | Error Description |
---|---|
404 | Team with specified ID does not exist or is inaccessible |
Updates an existing team and returns the updated object
function updateATeam($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the team |
body | Optional |
TODO: Add a parameter description |
$id = 183;
$collect['id'] = $id;
$body = array('key' => 'value');
$collect['body'] = $body;
$result = $teams->updateATeam($collect);
Error Code | Error Description |
---|---|
403 | Forbidden response |
404 | Team with specified ID does not exist or is inaccessible |
Returns list of all user IDs within a team
function getAllUsersInATeam($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the team |
$id = 183;
$result = $teams->getAllUsersInATeam($id);
Error Code | Error Description |
---|---|
404 | Team with specified ID does not exist or is inaccessible |
Adds users to an existing team
function addUsersToATeam($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the team |
users | Required Collection |
List of User IDs |
$id = 183;
$collect['id'] = $id;
$users = array(183);
$collect['users'] = $users;
$result = $teams->addUsersToATeam($collect);
Error Code | Error Description |
---|---|
403 | Forbidden response |
404 | Team with specified ID does not exist or is inaccessible |
Deletes users from an existing team
function deleteUsersFromATeam($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the team |
users | Required Collection |
List of User IDs |
$id = 183;
$collect['id'] = $id;
$users = array(183);
$collect['users'] = $users;
$result = $teams->deleteUsersFromATeam($collect);
Error Code | Error Description |
---|---|
403 | Forbidden response |
404 | Team with specified ID does not exist or is inaccessible |
Returns data about all teams which have specified user as a member
function getAllTeamsOfAUser($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the user |
orderBy | Optional DefaultValue |
Field name to sort returned teams by |
skipUsers | Optional |
When enabled, the teams will not include IDs of member users |
$id = 183;
$collect['id'] = $id;
$orderBy = string::ID;
$collect['orderBy'] = $orderBy;
$skipUsers = int::ENUM_0;
$collect['skipUsers'] = $skipUsers;
$result = $teams->getAllTeamsOfAUser($collect);
The singleton instance of the UserConnectionsController
class can be accessed from the API Client.
$userConnections = $client->getUserConnections();
Returns data about all connections for authorized user.
function getAllUserConnections()
$result = $userConnections->getAllUserConnections();
Error Code | Error Description |
---|---|
401 | Unauthorized response |
The singleton instance of the UserSettingsController
class can be accessed from the API Client.
$userSettings = $client->getUserSettings();
Lists settings of authorized user.
function listSettingsOfAuthorizedUser()
$userSettings->listSettingsOfAuthorizedUser();
The singleton instance of the UsersController
class can be accessed from the API Client.
$users = $client->getUsers();
Returns data about all users within the company
function getAllUsers()
$result = $users->getAllUsers();
Adds a new user to the company, returns the ID upon success.
function addANewUser($options)
Parameter | Tags | Description |
---|---|---|
name | Required |
Name of the user |
Required |
Email of the user | |
activeFlag | Required |
Whether the user is active or not. false = Not activated, true = Activated |
$name = 'name';
$collect['name'] = $name;
$email = 'email';
$collect['email'] = $email;
$activeFlag = true;
$collect['activeFlag'] = $activeFlag;
$result = $users->addANewUser($collect);
Error Code | Error Description |
---|---|
403 | Forbidden response |
Finds users by their name.
function findUsersByName($options)
Parameter | Tags | Description |
---|---|---|
term | Required |
Search term to look for |
searchByEmail | Optional |
When enabled, term will only be matched against email addresses of users. Default: false |
$term = 'term';
$collect['term'] = $term;
$searchByEmail = int::ENUM_0;
$collect['searchByEmail'] = $searchByEmail;
$result = $users->findUsersByName($collect);
Returns data about an authorized user within the company with bound company data: company ID, company name, and domain. Note that the 'locale' property means 'Date and number format' in the Pipedrive settings, not the chosen language.
function getCurrentUserData()
$result = $users->getCurrentUserData();
Error Code | Error Description |
---|---|
401 | Unauthorized response |
Returns data about a specific user within the company
function getOneUser($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the user |
$id = 183;
$result = $users->getOneUser($id);
Error Code | Error Description |
---|---|
404 | User with specified ID does not exist or is inaccessible |
Updates the properties of a user. Currently, only active_flag can be updated.
function updateUserDetails($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the user |
activeFlag | Required |
Whether the user is active or not. false = Not activated, true = Activated |
$id = 183;
$collect['id'] = $id;
$activeFlag = true;
$collect['activeFlag'] = $activeFlag;
$result = $users->updateUserDetails($collect);
Error Code | Error Description |
---|---|
403 | Forbidden response |
404 | User with specified ID does not exist or is inaccessible |
Lists blacklisted email addresses of a specific user. Blacklisted emails are such that will not get synced in to Pipedrive when using the built-in Mailbox.
function listBlacklistedEmailAddressesOfAUser($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the user |
$id = 183;
$users->listBlacklistedEmailAddressesOfAUser($id);
Add blacklisted email address for a specific user.
function addBlacklistedEmailAddressForAUser($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the user |
address | Required |
Email address to blacklist (can contain \* for wildcards, e.g. \@example.com, or john\@ex\*.com) |
$id = 183;
$collect['id'] = $id;
$address = 'address';
$collect['address'] = $address;
$users->addBlacklistedEmailAddressForAUser($collect);
Lists followers of a specific user.
function listFollowersOfAUser($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the user |
$id = 183;
$result = $users->listFollowersOfAUser($id);
Error Code | Error Description |
---|---|
403 | Forbidden response |
List aggregated permissions over all assigned permission sets for a user
function listUserPermissions($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the user |
$id = 183;
$users->listUserPermissions($id);
Delete a role assignment for a user
function deleteARoleAssignment($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the user |
roleId | Required |
ID of the role |
$id = 183;
$collect['id'] = $id;
$roleId = 183;
$collect['roleId'] = $roleId;
$users->deleteARoleAssignment($collect);
List role assignments for a user
function listRoleAssignments($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the user |
start | Optional DefaultValue |
Pagination start |
limit | Optional |
Items shown per page |
$id = 183;
$collect['id'] = $id;
$start = 0;
$collect['start'] = $start;
$limit = 183;
$collect['limit'] = $limit;
$users->listRoleAssignments($collect);
Add role assignment for a user
function addRoleAssignment($options)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the user |
roleId | Required |
ID of the role |
$id = 183;
$collect['id'] = $id;
$roleId = 183;
$collect['roleId'] = $roleId;
$users->addRoleAssignment($collect);
List settings of user's assigned role
function listUserRoleSettings($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
ID of the user |
$id = 183;
$users->listUserRoleSettings($id);
The singleton instance of the WebhooksController
class can be accessed from the API Client.
$webhooks = $client->getWebhooks();
Returns data about all webhooks of a company.
function getAllWebhooks()
$result = $webhooks->getAllWebhooks();
Error Code | Error Description |
---|---|
401 | Unauthorized response |
Creates a new webhook and returns its details. Note that specifying an event which triggers the webhook combines 2 parameters - 'event_action' and 'event_object'. E.g., use '*.*' for getting notifications about all events, 'added.deal' for any newly added deals, 'deleted.persons' for any deleted persons, etc. See https://pipedrive.readme.io/docs/guide-for-webhooks for more details.
function createANewWebhook($options)
Parameter | Tags | Description |
---|---|---|
subscriptionUrl | Required |
A full, valid, publicly accessible URL. Determines where to send the notifications. Please note that you cannot use Pipedrive API endpoints as the subscription_url. |
eventAction | Required |
Type of action to receive notifications about. Wildcard will match all supported actions. |
eventObject | Required |
Type of object to receive notifications about. Wildcard will match all supported objects. |
userId | Optional |
The ID of the user this webhook will be authorized with. If not set, current authorized user will be used. Note that this does not filter only certain user's events — rather, this specifies the user's permissions under which each event is checked. Events about objects the selected user is not entitled to access are not sent. If you want to receive notifications for all events, a top-level admin user should be used. |
httpAuthUser | Optional |
HTTP basic auth username of the subscription URL endpoint (if required). |
httpAuthPassword | Optional |
HTTP basic auth password of the subscription URL endpoint (if required). |
$subscriptionUrl = 'subscription_url';
$collect['subscriptionUrl'] = $subscriptionUrl;
$eventAction = string::ENUM_0;
$collect['eventAction'] = $eventAction;
$eventObject = string::ENUM_0;
$collect['eventObject'] = $eventObject;
$userId = 183;
$collect['userId'] = $userId;
$httpAuthUser = 'http_auth_user';
$collect['httpAuthUser'] = $httpAuthUser;
$httpAuthPassword = 'http_auth_password';
$collect['httpAuthPassword'] = $httpAuthPassword;
$result = $webhooks->createANewWebhook($collect);
Error Code | Error Description |
---|---|
400 | The bad response on webhook creation |
401 | Unauthorized response |
Deletes the specified webhook.
function deleteExistingWebhook($id)
Parameter | Tags | Description |
---|---|---|
id | Required |
The ID of the webhook to delete |
$id = 183;
$result = $webhooks->deleteExistingWebhook($id);
Error Code | Error Description |
---|---|
401 | Unauthorized response |
403 | The webhook deletion forbidden response |
404 | The webhook deletion not found response |