crashingberries / pipedrive
Pipedrive REST 客户端用于 PHP
Requires
- php: >=5.4.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- apimatic/jsonmapper: *
- mashape/unirest-php: ~3.0.1
Requires (Dev)
- phpunit/phpunit: 4.8.*
- squizlabs/php_codesniffer: ^2.7
This package is not auto-updated.
Last update: 2024-09-12 02:27:56 UTC
README
Pipedrive 是一款销售流程软件,帮助您组织有序。它是一款功能强大的销售 CRM,可以轻松管理销售流程。详情请见 www.pipedrive.com。
这是 Pipedrive Inc. 免费提供的官方 PHP 应用程序 Pipedrive API 包装客户端,基于 MIT 许可证分发。它提供了对 Pipedrive API 的方便访问,允许您操作诸如交易、人员、组织、产品等对象。
⚠️ 版本 1 是我们官方 PHP 客户端的初始版本。它通过使用 API 令牌或 OAuth2 以方便的方式为其用户提供对 API 的访问。
安装
您可以通过 composer require
命令安装此包
composer require pipedrive/pipedrive
或者简单地将它添加到 composer.json 的依赖中并运行 composer update
"require": { "pipedrive/pipedrive": "^3.0" }
API 文档
Pipedrive REST API 文档可在 https://developers.pipedrive.com/v1 找到
许可证
此 Pipedrive API 客户端采用 MIT 许可证分发。
如何使用
使用预置的 API 令牌
<?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; }
使用 OAuth 2
为了在 API 客户端中设置身份验证,您需要以下信息。
API 客户端可以按照以下方式初始化
$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);
现在您必须授权客户端。
授权您的客户端
在执行端点调用之前,您的应用程序必须先获得用户授权。SDK 使用 OAuth 2.0 授权 来获取用户的同意,代表用户执行 API 请求。
1. 获得用户同意
为了获得用户的同意,您必须将用户重定向到授权页面。buildAuthorizationUrl()
方法创建到授权页面的 URL。
$authUrl = $client->auth()->buildAuthorizationUrl(); header('Location: ' . filter_var($authUrl, FILTER_SANITIZE_URL));
2. 处理 OAuth 服务器响应
一旦用户对同意请求作出回应,OAuth 2.0 服务器将通过将用户重定向到在 Configuration
中指定的重定向 URI 来响应您的应用程序的访问请求。
如果用户批准请求,则授权代码将以 code
查询字符串的形式发送
https://example.com/oauth/callback?code=XXXXXXXXXXXXXXXXXXXXXXXXX
如果用户未批准请求,则响应包含一个 error
查询字符串
https://example.com/oauth/callback?error=access_denied
3. 使用代码授权客户端
服务器收到代码后,可以使用它交换一个 访问令牌。访问令牌是一个包含用于授权客户端请求和刷新令牌本身的信息的对象。
try { $client->auth()->authorize($_GET['code']); } catch (Pipedrive\Exceptions\OAuthProviderException $ex) { // handle exception }
刷新令牌
访问令牌可能在一段时间后过期。为了延长其有效期,您必须刷新令牌。
if ($client->auth()->isTokenExpired()) { try { $client->auth()->refreshToken(); } catch (Pipedrive\Exceptions\OAuthProviderException $ex) { // handle exception } }
如果令牌过期,SDK 将尝试在执行需要身份验证的下一个端点调用之前自动刷新令牌。
存储访问令牌以供重用
建议您存储访问令牌以供重用。
您可以将访问令牌存储在 $_SESSION
全局变量中
// store token $_SESSION['access_token'] = Pipedrive\Configuration::$oAuthToken;
然而,由于 SDK 将尝试在令牌过期时自动刷新令牌,建议您注册一个 令牌更新回调 以检测访问令牌的任何更改。
Pipedrive\Configuration::$oAuthTokenUpdateCallback = function($token) { // use session or some other way to persist the $token $_SESSION['access_token'] = $token; };
在授权和令牌刷新时都会触发令牌更新回调。
从存储的令牌创建客户端
要从存储的访问令牌授权客户端,只需在创建客户端之前在 Configuration
中设置访问令牌以及其他配置参数。
// load token later... Pipedrive\Configuration::$oAuthToken = $_SESSION['access_token']; // Set other configuration, then instantiate client $client = new Pipedrive\Client();
带有 OAuth2 的完整示例
在这个例子中,index.php
首先检查用户是否有一个访问令牌可用。如果没有设置,它将用户重定向到 authcallback.php
,该页面将获取访问令牌并将用户重定向回 index.php
页面。现在已设置访问令牌,index.php
可以使用客户端向服务器发出授权调用。
index.php
<?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)); }
authcallback.php
<?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 } }
贡献
- 运行测试
- 打开拉取请求
请注意,大多数代码都是自动生成的。您欢迎提出更改和报告错误。但是,任何更新都必须在底层生成器中实现。
如何测试
可以使用 PHPUnit 运行此 SDK 中的单元测试。
- 首先使用 composer 安装依赖项,包括
require-dev
依赖项。 - 从命令行运行
vendor\bin\phpunit --verbose
以执行测试。如果您已全局安装 PHPUnit,请使用phpunit --verbose
运行测试。
您可以在 phpunit.xml
文件中更改 PHPUnit 测试配置。
类参考
控制器列表
- 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
ActivitiesController
获取单例实例
可以从 API 客户端访问 ActivitiesController
类的单例实例。
$activities = $client->getActivities();
deleteMultipleActivitiesInBulk
将多个活动标记为已删除。
function deleteMultipleActivitiesInBulk($ids)
参数
示例用法
$ids = 'ids'; $activities->deleteMultipleActivitiesInBulk($ids);
getAllActivitiesAssignedToAParticularUser
返回分配给特定用户的所有活动。
function getAllActivitiesAssignedToAParticularUser($options)
参数
示例用法
$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);
addAnActivity
添加一个新活动。在响应的额外数据中包含 more_activities_scheduled_in_context 属性,该属性指示是否还有更多未完成的活动与同一交易、人员或组织(根据提供的数据)相关联。有关如何添加活动的更多信息,请参阅本教程。
function addAnActivity($options)
参数
示例用法
$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->addAnActivity($collect);
deleteAnActivity
删除一个活动。
function deleteAnActivity($id)
参数
示例用法
$id = 119; $activities->deleteAnActivity($id);
getDetailsOfAnActivity
返回特定活动的详细信息。
function getDetailsOfAnActivity($id)
参数
示例用法
$id = 119; $activities->getDetailsOfAnActivity($id);
updateEditAnActivity
修改活动。在响应的额外数据中包含 more_activities_scheduled_in_context 属性,该属性指示是否还有更多未完成的活动与同一交易、人员或组织(根据提供的数据)相关联。
function updateEditAnActivity($options)
参数
示例用法
$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);
ActivityFieldsController
获取单例实例
可以通过 API 客户端访问 ActivityFieldsController
类的单例实例。
$activityFields = $client->getActivityFields();
getAllFieldsForAnActivity
返回活动所有字段的列表
function getAllFieldsForAnActivity()
示例用法
$activityFields->getAllFieldsForAnActivity();
ActivityTypesController
获取单例实例
可以通过 API 客户端访问 ActivityTypesController
类的单例实例。
$activityTypes = $client->getActivityTypes();
deleteMultipleActivityTypesInBulk
标记多个活动类型为已删除。
function deleteMultipleActivityTypesInBulk($ids)
参数
示例用法
$ids = 'ids'; $activityTypes->deleteMultipleActivityTypesInBulk($ids);
getAllActivityTypes
返回所有活动类型
function getAllActivityTypes()
示例用法
$activityTypes->getAllActivityTypes();
addNewActivityType
添加新的活动类型,成功后返回新添加的活动类型的ID、key_string和顺序号。
function addNewActivityType($options)
参数
示例用法
$name = 'name'; $collect['name'] = $name; $iconKey = string::TASK; $collect['iconKey'] = $iconKey; $color = 'color'; $collect['color'] = $color; $activityTypes->addNewActivityType($collect);
deleteAnActivityType
将活动类型标记为已删除。
function deleteAnActivityType($id)
参数
示例用法
$id = 119; $activityTypes->deleteAnActivityType($id);
updateEditActivityType
更新活动类型。
function updateEditActivityType($options)
参数
示例用法
$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);
CallLogsController
获取单例实例
可以通过API客户端访问CallLogsController
类的单例实例。
$callLogs = $client->getCallLogs();
getAllCallLogsAssignedToAParticularUser
返回分配给特定用户的所有通话记录
function getAllCallLogsAssignedToAParticularUser($options)
参数
示例用法
$start = 0; $options['start'] = $start; $limit = 119; $options['limit'] = $limit; $callLogs->getAllCallLogsAssignedToAParticularUser($options);
getDetailsOfACallLog
返回特定通话记录的详细信息
function getDetailsOfACallLog($id)
参数
示例用法
$id = 1; $callLogs->getDetailsOfACallLog($id);
addACallLog
添加新的通话记录
function addACallLog($collect)
参数
示例用法
$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);
attachAnAudioFileToTheCallLog
将音频录音添加到通话记录中。拥有通话记录对象访问权限的人可以播放该音频。
function attachAnAudioFileToTheCallLog($id, $collect)
参数
示例用法
$id = 'id'; $file = "PathToFile"; $collect['file'] = $file; $callLogs->attachAnAudioFileToTheCallLog($id, $collect);
deleteACallLog
删除通话记录。如果与之关联的音频录音存在,它也将被删除。相关活动不会被此请求删除。如需删除相关活动,请使用特定于活动的端点。
function deleteACallLog($id)
参数
示例用法
$id = 'id'; $callLogs->deleteACallLog($id);
CurrenciesController
获取单例实例
可以从API客户端访问 CurrenciesController
类的单例实例。
$currencies = $client->getCurrencies();
getAllSupportedCurrencies
返回给定账户中所有受支持货币,这些货币应在保存与其他对象一起的货币价值时使用。返回对象的 'code' 参数是所有非自定义货币的ISO 4217货币代码。
function getAllSupportedCurrencies($term = null)
参数
示例用法
$term = 'term'; $result = $currencies->getAllSupportedCurrencies($term);
DealFieldsController
获取单例实例
可以从API客户端访问 DealFieldsController
类的单例实例。
$dealFields = $client->getDealFields();
deleteMultipleDealFieldsInBulk
将多个字段标记为已删除。
function deleteMultipleDealFieldsInBulk($ids)
参数
示例用法
$ids = 'ids'; $dealFields->deleteMultipleDealFieldsInBulk($ids);
getAllDealFields
返回所有交易字段的数据
function getAllDealFields($options)
参数
示例用法
$start = 0; $collect['start'] = $start; $limit = 119; $collect['limit'] = $limit; $dealFields->getAllDealFields($collect);
addANewDealField
添加新的交易字段。有关添加新自定义字段的更多信息,请参阅本教程。
function addANewDealField($body = null)
参数
示例用法
$body = array('key' => 'value'); $dealFields->addANewDealField($body);
deleteADealField
将字段标记为已删除。有关如何删除自定义字段的更多信息,请参阅本教程。
function deleteADealField($id)
参数
示例用法
$id = 119; $dealFields->deleteADealField($id);
getOneDealField
返回特定交易字段的详细信息。
function getOneDealField($id)
参数
示例用法
$id = 119; $dealFields->getOneDealField($id);
updateADealField
更新交易字段。请参阅本教程中更新自定义字段值的示例。
function updateADealField($options)
参数
示例用法
$id = 119; $collect['id'] = $id; $name = 'name'; $collect['name'] = $name; $options = 'options'; $collect['options'] = $options; $dealFields->updateADealField($collect);
DealsController
获取单例实例
可以通过API客户端访问DealsController
类的单例实例。
$deals = $client->getDeals();
deleteMultipleDealsInBulk
将多个交易标记为已删除。
function deleteMultipleDealsInBulk($ids)
参数
示例用法
$ids = 'ids'; $result = $deals->deleteMultipleDealsInBulk($ids);
getAllDeals
返回所有交易。有关如何获取所有交易的更多信息,请参阅本教程。
function getAllDeals($options)
参数
示例用法
$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);
searchDeals
通过标题、备注和/或自定义字段搜索所有交易。此端点是/v1/itemSearch的一个包装器,具有更窄的OAuth作用域。找到的交易可以根据人员ID和组织ID进行筛选。
function searchDeals($options)
参数
示例用法
$term = 'term'; $collect['term'] = $term; $results = $deals->searchDeals($collect);
addADeal
添加新的交易。请注意,您可以在请求中提供一些附加的自定义字段,这些字段在此处未描述。这些自定义字段对于每个Pipedrive账户都是不同的,可以通过长哈希作为键来识别。要确定哪些自定义字段存在,请获取dealFields并查找'key'值。有关如何添加交易的更多信息,请参阅本教程。
function addADeal($body = null)
参数
示例用法
$body = array('key' => 'value'); $result = $deals->addADeal($body);
getDealsSummary
返回所有交易的摘要。
function getDealsSummary($options)
参数
示例用法
$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);
getDealsTimeline
返回开放和已赢得的商机,按在日期类型的商机字段(field_key)中设置的指定时间间隔分组——例如,当选择月份为间隔时,从2012年1月1日开始请求3个月,则商机将按field_key的值分组返回为3组——1月、2月和3月。
function getDealsTimeline($options)
参数
示例用法
$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);
deleteADeal
标记商机为已删除。
function deleteADeal($id)
参数
示例用法
$id = 119; $result = $deals->deleteADeal($id);
getDetailsOfADeal
返回特定商机的详细信息。请注意,此操作还会返回一些在请求所有商机时不存在的信息,例如商机年龄和管道阶段停留时间。另外,请注意,自定义字段在结果数据中表现为长哈希值。这些哈希值可以与dealFields的'key'值对应。有关获取商机所有详细信息的更多信息,请参阅本教程。
function getDetailsOfADeal($id)
参数
示例用法
$id = 119; $result = $deals->getDetailsOfADeal($id);
updateADeal
更新商机的属性。请注意,您可以在请求中提供一些未在本处描述的自定义字段。这些自定义字段对于每个Pipedrive账户而言都是不同的,并且可以通过长哈希值作为键来识别。要确定哪些自定义字段存在,请获取dealFields并查找'key'值。有关如何更新商机的更多信息,请参阅本教程。
function updateADeal($options)
参数
示例用法
$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);
listActivitiesAssociatedWithADeal
列出与商机关联的活动。
function listActivitiesAssociatedWithADeal($options)
参数
示例用法
$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);
createDuplicateDeal
复制商机。
function createDuplicateDeal($id)
参数
示例用法
$id = 27; $result = $deals->createDuplicateDeal($id);
listFilesAttachedToADeal
列出与商机关联的文件。
function listFilesAttachedToADeal($options)
参数
示例用法
$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);
listUpdatesAboutADeal
列出关于一项交易的更新。
function listUpdatesAboutADeal($options)
参数
示例用法
$id = 27; $collect['id'] = $id; $start = 0; $collect['start'] = $start; $limit = 27; $collect['limit'] = $limit; $deals->listUpdatesAboutADeal($collect);
listFollowersOfADeal
列出交易的关注者。
function listFollowersOfADeal($id)
参数
示例用法
$id = 27; $deals->listFollowersOfADeal($id);
addAFollowerToADeal
将关注者添加到交易中。
function addAFollowerToADeal($options)
参数
示例用法
$id = 27; $collect['id'] = $id; $userId = 27; $collect['userId'] = $userId; $result = $deals->addAFollowerToADeal($collect);
deleteAFollowerFromADeal
从交易中删除关注者。
function deleteAFollowerFromADeal($options)
参数
示例用法
$id = 27; $collect['id'] = $id; $followerId = 27; $collect['followerId'] = $followerId; $result = $deals->deleteAFollowerFromADeal($collect);
listMailMessagesAssociatedWithADeal
列出与交易相关的邮件消息。
function listMailMessagesAssociatedWithADeal($options)
参数
示例用法
$id = 27; $collect['id'] = $id; $start = 0; $collect['start'] = $start; $limit = 27; $collect['limit'] = $limit; $deals->listMailMessagesAssociatedWithADeal($collect);
updateMergeTwoDeals
将一项交易与另一项交易合并。有关如何合并两项交易的更多信息,请参阅本教程。
function updateMergeTwoDeals($options)
参数
示例用法
$id = 27; $collect['id'] = $id; $mergeWithId = 27; $collect['mergeWithId'] = $mergeWithId; $result = $deals->updateMergeTwoDeals($collect);
listParticipantsOfADeal
列出与交易关联的参与者。
function listParticipantsOfADeal($options)
参数
示例用法
$id = 27; $collect['id'] = $id; $start = 0; $collect['start'] = $start; $limit = 27; $collect['limit'] = $limit; $deals->listParticipantsOfADeal($collect);
addAParticipantToADeal
将参与者添加到交易中。
function addAParticipantToADeal($options)
参数
示例用法
$id = 27; $collect['id'] = $id; $personId = 27; $collect['personId'] = $personId; $deals->addAParticipantToADeal($collect);
deleteAParticipantFromADeal
从交易中删除参与者。
function deleteAParticipantFromADeal($options)
参数
示例用法
$id = 27; $collect['id'] = $id; $dealParticipantId = 27; $collect['dealParticipantId'] = $dealParticipantId; $result = $deals->deleteAParticipantFromADeal($collect);
listPermittedUsers
列出允许访问交易的用户
function listPermittedUsers($id)
参数
示例用法
$id = 27; $deals->listPermittedUsers($id);
listAllPersonsAssociatedWithADeal
列出与交易关联的所有人员,无论该人员是否是交易的主要联系人,或作为参与者添加。
function listAllPersonsAssociatedWithADeal($options)
参数
示例用法
$id = 27; $collect['id'] = $id; $start = 0; $collect['start'] = $start; $limit = 27; $collect['limit'] = $limit; $deals->listAllPersonsAssociatedWithADeal($collect);
listProductsAttachedToADeal
列出与交易关联的产品。
function listProductsAttachedToADeal($options)
参数
示例用法
$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);
addAProductToTheDealEventuallyCreatingANewItemCalledADealProduct
将产品添加到交易中。
function addAProductToTheDealEventuallyCreatingANewItemCalledADealProduct($options)
参数
示例用法
$id = 27; $collect['id'] = $id; $body = array('key' => 'value'); $collect['body'] = $body; $result = $deals->addAProductToTheDealEventuallyCreatingANewItemCalledADealProduct($collect);
updateProductAttachmentDetailsOfTheDealProductAProductAlreadyAttachedToADeal
更新产品附件详情。
function updateProductAttachmentDetailsOfTheDealProductAProductAlreadyAttachedToADeal($options)
参数
示例用法
$id = 27; $collect['id'] = $id; $productAttachmentId = 27; $collect['productAttachmentId'] = $productAttachmentId; $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->updateProductAttachmentDetailsOfTheDealProductAProductAlreadyAttachedToADeal($collect);
deleteAnAttachedProductFromADeal
使用 product_attachment_id 从交易中删除产品附件。
function deleteAnAttachedProductFromADeal($options)
参数
示例用法
$id = 27; $collect['id'] = $id; $productAttachmentId = 27; $collect['productAttachmentId'] = $productAttachmentId; $result = $deals->deleteAnAttachedProductFromADeal($collect);
FilesController
获取单例实例
可以从 API 客户端访问 FilesController
类的单例实例。
$files = $client->getFiles();
getAllFiles
返回所有文件的数据。
function getAllFiles($options)
参数
示例用法
$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);
addFile
允许您上传文件并将其与交易、人员、组织、活动或产品关联。有关如何添加文件的更多信息,请参阅本教程。
function addFile($options)
参数
示例用法
$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);
createARemoteFileAndLinkItToAnItem
在远程位置(googledrive)创建一个新的空文件,该文件将与您提供的项目相关联。有关如何添加远程文件的更多信息,请参阅本教程。
function createARemoteFileAndLinkItToAnItem($options)
参数
示例用法
$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);
createLinkARemoteFileToAnItem
将现有的远程文件(googledrive)链接到您提供的项目。有关如何链接远程文件的更多信息,请参阅本教程。
function createLinkARemoteFileToAnItem($options)
参数
示例用法
$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);
deleteAFile
标记文件为已删除。
function deleteAFile($id)
参数
示例用法
$id = 27; $files->deleteAFile($id);
getOneFile
返回有关特定文件的数据。
function getOneFile($id)
参数
示例用法
$id = 27; $files->getOneFile($id);
updateFileDetails
更新文件的属性。
function updateFileDetails($options)
参数
示例用法
$id = 27; $collect['id'] = $id; $name = 'name'; $collect['name'] = $name; $description = 'description'; $collect['description'] = $description; $files->updateFileDetails($collect);
getDownloadOneFile
初始化文件下载。
function getDownloadOneFile($id)
参数
示例用法
$id = 27; $files->getDownloadOneFile($id);
FiltersController
获取单例实例
可以通过API客户端访问FiltersController
类的单例实例。
$filters = $client->getFilters();
deleteMultipleFiltersInBulk
标记多个过滤器为已删除。
function deleteMultipleFiltersInBulk($ids)
参数
示例用法
$ids = 'ids'; $filters->deleteMultipleFiltersInBulk($ids);
getAllFilters
返回所有过滤器的数据
function getAllFilters($type = null)
参数
示例用法
$type = string::DEALS; $filters->getAllFilters($type);
addANewFilter
添加一个新的过滤器,成功时返回ID。注意,在json对象的条件中,只支持一个一级条件组,并且必须用'AND'连接,只支持两个二级条件组,其中一个必须用'AND'连接,另一个用'OR'连接。其他组合(目前)无法工作,但语法支持将来引入它们。有关如何添加新过滤器的更多信息,请参阅本教程。
function addANewFilter($options)
参数
示例用法
$name = 'name'; $collect['name'] = $name; $conditions = 'conditions'; $collect['conditions'] = $conditions; $type = string::DEALS; $collect['type'] = $type; $filters->addANewFilter($collect);
getAllFilterHelpers
返回所有支持的过滤器助手。当你想要添加或更新过滤器时,这将有助于了解可用的条件和助手。有关如何使用过滤器助手的信息,请参阅本教程。
function getAllFilterHelpers()
示例用法
$filters->getAllFilterHelpers();
deleteAFilter
将过滤器标记为已删除。
function deleteAFilter($id)
参数
示例用法
$id = 27; $filters->deleteAFilter($id);
getOneFilter
返回特定过滤器的数据。请注意,这也会返回过滤器的条件行。
function getOneFilter($id)
参数
示例用法
$id = 27; $filters->getOneFilter($id);
updateFilter
更新现有过滤器。
function updateFilter($options)
参数
示例用法
$id = 27; $collect['id'] = $id; $conditions = 'conditions'; $collect['conditions'] = $conditions; $name = 'name'; $collect['name'] = $name; $filters->updateFilter($collect);
GlobalMessagesController
获取单例实例
可以从API客户端访问GlobalMessagesController
类的单例实例。
$globalMessages = $client->getGlobalMessages();
getGlobalMessages
返回显示给授权用户的全局消息数据。
function getGlobalMessages($limit = 1)
参数
示例用法
$limit = 1; $result = $globalMessages->getGlobalMessages($limit);
deleteDismissAGlobalMessage
如果消息可以关闭,则从显示中移除全局消息。
function deleteDismissAGlobalMessage($id)
参数
示例用法
$id = 27; $result = $globalMessages->deleteDismissAGlobalMessage($id);
GoalsController
获取单例实例
API客户端可以访问GoalsController
类的单例实例。
$goals = $client->getGoals();
addANewGoal
添加新目标。
function addANewGoal($body = null)
参数
示例用法
$body = array('key' => 'value'); $goals->addANewGoal($body);
findGoals
基于标准返回关于目标的数据。对于搜索,将
{searchField}={searchValue}
附加到URL上,其中searchField
可以是点符号表示的最低级别的字段之一(例如type.params.pipeline_id
;title
)。searchValue
应该是该字段上要查找的值。此外,可以提供is_active=<true|false>
以仅搜索活动/非活动目标。当提供period.start
时,必须也提供period.end
,反之亦然。
function findGoals($options)
参数
示例用法
$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);
updateExistingGoal
更新现有目标。
function updateExistingGoal($options)
参数
示例用法
$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);
deleteExistingGoal
将目标标记为已删除。
function deleteExistingGoal($id)
参数
示例用法
$id = 'id'; $goals->deleteExistingGoal($id);
getResultOfAGoal
获取指定期间目标的进度。
function getResultOfAGoal($options)
参数
示例用法
$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);
ItemSearchController
获取单例实例
可以通过API客户端访问ItemSearchController
类的单例实例。
$itemSearch = $client->getItemSearch();
performASearchFromMultipleItemTypes
从多个项目类型进行搜索
function performASearchFromMultipleItemTypes($options)
参数
示例用法
$term = 'term'; $collect['term'] = $term; $results = $itemSearch->performASearchFromMultipleItemTypes($collect);
performASearchUsingASpecificFieldFromAnItemType
使用项目类型中的特定字段进行搜索
function performASearchUsingASpecificFieldFromAnItemType($options)
参数
示例用法
$collect['term'] = 'term'; $collect['fieldType'] = 'dealField'; $collect['fieldKey'] = 'title'; $results = $itemSearch->performASearchUsingASpecificFieldFromAnItemType($collect);
MailMessagesController
获取单例实例
可以通过API客户端访问MailMessagesController
类的单例实例。
$mailMessages = $client->getMailMessages();
getOneMailMessage
返回特定邮件信息的数据。
function getOneMailMessage($options)
参数
示例用法
$id = 27; $collect['id'] = $id; $includeBody = int::ENUM_0; $collect['includeBody'] = $includeBody; $result = $mailMessages->getOneMailMessage($collect);
MailThreadsController
获取单例实例
可以通过API客户端访问MailThreadsController
类的单例实例。
$mailThreads = $client->getMailThreads();
getMailThreads
按指定文件夹内最新消息的顺序返回邮件线程。
function getMailThreads($options)
参数
示例用法
$folder = string::INBOX; $collect['folder'] = $folder; $start = 0; $collect['start'] = $start; $limit = 27; $collect['limit'] = $limit; $result = $mailThreads->getMailThreads($collect);
deleteMailThread
将邮件线程标记为已删除。
function deleteMailThread($id)
参数
示例用法
$id = 27; $result = $mailThreads->deleteMailThread($id);
getOneMailThread
返回特定的邮件线程。
function getOneMailThread($id)
参数
示例用法
$id = 27; $result = $mailThreads->getOneMailThread($id);
updateMailThreadDetails
更新邮件线程的属性。
function updateMailThreadDetails($options)
参数
示例用法
$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);
getAllMailMessagesOfMailThread
获取指定邮件线程内的邮件消息。
function getAllMailMessagesOfMailThread($id)
参数
示例用法
$id = 27; $result = $mailThreads->getAllMailMessagesOfMailThread($id);
NoteFieldsController
获取单例实例
可以通过API客户端访问NoteFieldsController
类的单例实例。
$noteFields = $client->getNoteFields();
getAllFieldsForANote
返回关于笔记的所有字段列表。
function getAllFieldsForANote()
示例用法
$noteFields->getAllFieldsForANote();
NotesController
获取单例实例
可以通过API客户端访问NotesController
类的单例实例。
$notes = $client->getNotes();
getAllNotes
返回所有笔记。
function getAllNotes($options)
参数
示例用法
$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);
addANote
添加一个新的笔记。
function addANote($options)
参数
示例用法
$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);
deleteANote
删除指定的笔记。
function deleteANote($id)
参数
示例用法
$id = 69; $result = $notes->deleteANote($id);
getOneNote
返回关于指定笔记的详细信息。
function getOneNote($id)
参数
示例用法
$id = 69; $result = $notes->getOneNote($id);
updateANote
更新笔记。
function updateANote($options)
参数
示例用法
$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);
OrganizationFieldsController
获取单例实例
可以通过API客户端访问OrganizationFieldsController
类的单例实例。
$organizationFields = $client->getOrganizationFields();
deleteMultipleOrganizationFieldsInBulk
将多个字段标记为已删除。
function deleteMultipleOrganizationFieldsInBulk($ids)
参数
示例用法
$ids = 'ids'; $organizationFields->deleteMultipleOrganizationFieldsInBulk($ids);
getAllOrganizationFields
返回所有组织字段的有关数据
function getAllOrganizationFields()
示例用法
$organizationFields->getAllOrganizationFields();
addANewOrganizationField
添加新的组织字段。有关添加新自定义字段的更多信息,请参阅本教程。
function addANewOrganizationField($body = null)
参数
示例用法
$body = array('key' => 'value'); $organizationFields->addANewOrganizationField($body);
deleteAnOrganizationField
将字段标记为已删除。有关如何删除自定义字段的更多信息,请参阅本教程。
function deleteAnOrganizationField($id)
参数
示例用法
$id = 69; $organizationFields->deleteAnOrganizationField($id);
getOneOrganizationField
返回特定组织字段的有关数据。
function getOneOrganizationField($id)
参数
示例用法
$id = 69; $organizationFields->getOneOrganizationField($id);
updateAnOrganizationField
更新组织字段。请参阅本教程中更新自定义字段值的示例。
function updateAnOrganizationField($options)
参数
示例用法
$id = 69; $collect['id'] = $id; $name = 'name'; $collect['name'] = $name; $options = 'options'; $collect['options'] = $options; $organizationFields->updateAnOrganizationField($collect);
OrganizationRelationshipsController
获取单例实例
可以从API客户端访问OrganizationRelationshipsController
类的单例实例。
$organizationRelationships = $client->getOrganizationRelationships();
getAllRelationshipsForOrganization
获取指定组织ID的所有关系。
function getAllRelationshipsForOrganization($orgId)
参数
示例用法
$orgId = 69; $organizationRelationships->getAllRelationshipsForOrganization($orgId);
createAnOrganizationRelationship
创建并返回组织关系。
function createAnOrganizationRelationship($body = null)
参数
示例用法
$body = array('key' => 'value'); $organizationRelationships->createAnOrganizationRelationship($body);
deleteAnOrganizationRelationship
删除一个组织关系,并返回已删除的ID。
function deleteAnOrganizationRelationship($id)
参数
示例用法
$id = 69; $organizationRelationships->deleteAnOrganizationRelationship($id);
getOneOrganizationRelationship
根据其ID查找并返回一个组织关系。
function getOneOrganizationRelationship($options)
参数
示例用法
$id = 69; $collect['id'] = $id; $orgId = 69; $collect['orgId'] = $orgId; $organizationRelationships->getOneOrganizationRelationship($collect);
updateAnOrganizationRelationship
更新并返回一个组织关系。
function updateAnOrganizationRelationship($options)
参数
示例用法
$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);
OrganizationsController
获取单例实例
可以通过API客户端访问OrganizationsController
类的单例实例。
$organizations = $client->getOrganizations();
deleteMultipleOrganizationsInBulk
将多个组织标记为已删除。
function deleteMultipleOrganizationsInBulk($ids)
参数
示例用法
$ids = 'ids'; $organizations->deleteMultipleOrganizationsInBulk($ids);
getAllOrganizations
返回所有组织
function getAllOrganizations($options)
参数
示例用法
$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);
searchOrganizations
通过名称、地址、备注和/或自定义字段搜索所有组织。此端点是/v1/itemSearch的一个包装,具有更窄的OAuth作用域。
function searchOrganizations($options)
参数
示例用法
$term = 'term'; $collect['term'] = $term; $results = $organizations->searchOrganizations($collect);
addAnOrganization
添加一个新的组织。注意,您可以在请求中提供此处未描述的其他自定义字段。这些自定义字段对于每个Pipedrive账户是不同的,可以通过长哈希作为键来识别。要确定哪些自定义字段存在,请获取organizationFields并查找'key'值。有关如何添加组织的更多信息,请参阅本教程。
function addAnOrganization($body = null)
参数
示例用法
$body = array('key' => 'value'); $organizations->addAnOrganization($body);
deleteAnOrganization
将组织标记为已删除。
function deleteAnOrganization($id)
参数
示例用法
$id = 69; $organizations->deleteAnOrganization($id);
getDetailsOfAnOrganization
返回组织的详细信息。请注意,这还会返回一些在请求所有组织时不存在的一些附加字段。另外请注意,自定义字段在结果数据中显示为长哈希值。这些哈希值可以与 organizationFields 的 'key' 值进行映射。
function getDetailsOfAnOrganization($id)
参数
示例用法
$id = 69; $organizations->getDetailsOfAnOrganization($id);
updateAnOrganization
更新组织的属性。请注意,您可以提供一些附加的自定义字段,这些字段在本文中没有描述。这些自定义字段对于每个 Pipedrive 帐户都是不同的,并且可以通过作为键的长哈希值来识别。要确定哪些自定义字段存在,请获取 organizationFields 并查找 'key' 值。
function updateAnOrganization($options)
参数
示例用法
$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);
listActivitiesAssociatedWithAnOrganization
列出与组织关联的活动。
function listActivitiesAssociatedWithAnOrganization($options)
参数
示例用法
$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);
listDealsAssociatedWithAnOrganization
列出与组织关联的商机。
function listDealsAssociatedWithAnOrganization($options)
参数
示例用法
$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);
listFilesAttachedToAnOrganization
列出与组织关联的文件。
function listFilesAttachedToAnOrganization($options)
参数
示例用法
$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);
listUpdatesAboutAnOrganization
列出有关组织的更新。
function listUpdatesAboutAnOrganization($options)
参数
示例用法
$id = 69; $collect['id'] = $id; $start = 0; $collect['start'] = $start; $limit = 69; $collect['limit'] = $limit; $organizations->listUpdatesAboutAnOrganization($collect);
listFollowersOfAnOrganization
列出组织的关注者。
function listFollowersOfAnOrganization($id)
参数
示例用法
$id = 69; $organizations->listFollowersOfAnOrganization($id);
addAFollowerToAnOrganization
向组织添加关注者。
function addAFollowerToAnOrganization($options)
参数
示例用法
$id = 69; $collect['id'] = $id; $userId = 69; $collect['userId'] = $userId; $organizations->addAFollowerToAnOrganization($collect);
deleteAFollowerFromAnOrganization
从组织中删除一个关注者。您可以从列出组织的关注者端点中检索follower_id。
function deleteAFollowerFromAnOrganization($options)
参数
示例用法
$id = 69; $collect['id'] = $id; $followerId = 69; $collect['followerId'] = $followerId; $organizations->deleteAFollowerFromAnOrganization($collect);
listMailMessagesAssociatedWithAnOrganization
列出与组织相关的邮件消息。
function listMailMessagesAssociatedWithAnOrganization($options)
参数
示例用法
$id = 69; $collect['id'] = $id; $start = 0; $collect['start'] = $start; $limit = 69; $collect['limit'] = $limit; $organizations->listMailMessagesAssociatedWithAnOrganization($collect);
updateMergeTwoOrganizations
将一个组织与另一个组织合并。有关如何合并两个组织的更多信息,请参阅这篇教程。
function updateMergeTwoOrganizations($options)
参数
示例用法
$id = 69; $collect['id'] = $id; $mergeWithId = 69; $collect['mergeWithId'] = $mergeWithId; $organizations->updateMergeTwoOrganizations($collect);
listPermittedUsers
列出有权访问组织的用户。
function listPermittedUsers($id)
参数
示例用法
$id = 69; $organizations->listPermittedUsers($id);
listPersonsOfAnOrganization
列出与组织相关的人员。
function listPersonsOfAnOrganization($options)
参数
示例用法
$id = 69; $collect['id'] = $id; $start = 0; $collect['start'] = $start; $limit = 69; $collect['limit'] = $limit; $organizations->listPersonsOfAnOrganization($collect);
PermissionSetsController
获取单例实例
API客户端可以访问PermissionSetsController
类的单例实例。
$permissionSets = $client->getPermissionSets();
getAllPermissionSets
获取所有权限集
function getAllPermissionSets()
示例用法
$result = $permissionSets->getAllPermissionSets();
错误
getOnePermissionSet
获取一个权限集
function getOnePermissionSet($id)
参数
示例用法
$id = 69; $result = $permissionSets->getOnePermissionSet($id);
错误
listPermissionSetAssignments
权限集的分配列表
function listPermissionSetAssignments($options)
参数
示例用法
$id = 69; $collect['id'] = $id; $start = 0; $collect['start'] = $start; $limit = 69; $collect['limit'] = $limit; $result = $permissionSets->listPermissionSetAssignments($collect);
错误
PersonFieldsController
获取单例实例
可以从API客户端访问 PersonFieldsController
类的单例实例。
$personFields = $client->getPersonFields();
deleteMultiplePersonFieldsInBulk
将多个字段标记为已删除。
function deleteMultiplePersonFieldsInBulk($ids)
参数
示例用法
$ids = 'ids'; $personFields->deleteMultiplePersonFieldsInBulk($ids);
getAllPersonFields
返回所有人员字段的数据
function getAllPersonFields()
示例用法
$personFields->getAllPersonFields();
addANewPersonField
添加新的人员字段。有关添加新自定义字段的更多信息,请参阅此教程。
function addANewPersonField($body = null)
参数
示例用法
$body = array('key' => 'value'); $personFields->addANewPersonField($body);
deleteAPersonField
将字段标记为已删除。有关如何删除自定义字段的更多信息,请参阅本教程。
function deleteAPersonField($id)
参数
示例用法
$id = 69; $personFields->deleteAPersonField($id);
getOnePersonField
返回特定人员字段的数据。
function getOnePersonField($id)
参数
示例用法
$id = 69; $personFields->getOnePersonField($id);
updateAPersonField
更新人员字段。请参阅此教程中更新自定义字段值的一个示例。
function updateAPersonField($options)
参数
示例用法
$id = 69; $collect['id'] = $id; $name = 'name'; $collect['name'] = $name; $options = 'options'; $collect['options'] = $options; $personFields->updateAPersonField($collect);
PersonsController
获取单例实例
可以从API客户端访问 PersonsController
类的单例实例。
$persons = $client->getPersons();
deleteMultiplePersonsInBulk
将多个人员标记为已删除。
function deleteMultiplePersonsInBulk($ids = null)
参数
示例用法
$ids = 'ids'; $persons->deleteMultiplePersonsInBulk($ids);
getAllPersons
返回所有人员
function getAllPersons($options)
参数
示例用法
$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);
searchPersons
通过名称、电子邮件、电话、备注和/或自定义字段搜索所有人员。此端点是/v1/itemSearch的包装,具有更窄的OAuth作用域。可以通过组织ID筛选找到的人员。
function searchPersons($options)
参数
示例用法
$term = 'term'; $collect['term'] = $term; $results = $persons->searchPersons($collect);
addAPerson
添加新人员。注意,您可以在请求中提供一些额外的自定义字段,这些字段在此未描述。这些自定义字段对于每个Pipedrive账户都不同,可以通过长哈希作为键识别。要确定哪些自定义字段存在,请获取personFields并查找'key'值。
function addAPerson($body = null)
参数
示例用法
$body = array('key' => 'value'); $persons->addAPerson($body);
deleteAPerson
将人员标记为已删除。
function deleteAPerson($id)
参数
示例用法
$id = 233; $persons->deleteAPerson($id);
getDetailsOfAPerson
返回人员的详细信息。请注意,此操作也会返回一些不在请求所有人员时存在的额外字段。此外,请注意,自定义字段在结果数据中作为长哈希出现。这些哈希可以与personFields的'key'值进行映射。
function getDetailsOfAPerson($id)
参数
示例用法
$id = 233; $persons->getDetailsOfAPerson($id);
updateAPerson
更新人员的属性。请注意,您可以在请求中提供一些额外的自定义字段,这些字段在此未描述。这些自定义字段对于每个Pipedrive账户都不同,可以通过长哈希作为键识别。要确定哪些自定义字段存在,请获取personFields并查找'key'值。有关如何更新人员的更多信息,请参阅此教程。
function updateAPerson($options)
参数
示例用法
$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);
listActivitiesAssociatedWithAPerson
列出与人员相关联的活动。
function listActivitiesAssociatedWithAPerson($options)
参数
示例用法
$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);
listDealsAssociatedWithAPerson
列出与某个人相关联的交易。
function listDealsAssociatedWithAPerson($options)
参数
示例用法
$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);
listFilesAttachedToAPerson
列出与某个人相关联的文件。
function listFilesAttachedToAPerson($options)
参数
示例用法
$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);
listUpdatesAboutAPerson
列出关于某个人的更新。
function listUpdatesAboutAPerson($options)
参数
示例用法
$id = 233; $collect['id'] = $id; $start = 0; $collect['start'] = $start; $limit = 233; $collect['limit'] = $limit; $persons->listUpdatesAboutAPerson($collect);
listFollowersOfAPerson
列出某人的关注者。
function listFollowersOfAPerson($id)
参数
示例用法
$id = 233; $persons->listFollowersOfAPerson($id);
addAFollowerToAPerson
向某个人添加关注者。
function addAFollowerToAPerson($options)
参数
示例用法
$id = 19; $collect['id'] = $id; $userId = 19; $collect['userId'] = $userId; $persons->addAFollowerToAPerson($collect);
deletesAFollowerFromAPerson
从某个人中删除关注者
function deletesAFollowerFromAPerson($options)
参数
示例用法
$id = 19; $collect['id'] = $id; $followerId = 19; $collect['followerId'] = $followerId; $persons->deletesAFollowerFromAPerson($collect);
listMailMessagesAssociatedWithAPerson
列出与某个人相关联的邮件消息。
function listMailMessagesAssociatedWithAPerson($options)
参数
示例用法
$id = 19; $collect['id'] = $id; $start = 0; $collect['start'] = $start; $limit = 19; $collect['limit'] = $limit; $persons->listMailMessagesAssociatedWithAPerson($collect);
updateMergeTwoPersons
合并某人与另一个人。有关如何合并两个人的更多信息,请参阅本教程。
function updateMergeTwoPersons($options)
参数
示例用法
$id = 19; $collect['id'] = $id; $mergeWithId = 19; $collect['mergeWithId'] = $mergeWithId; $persons->updateMergeTwoPersons($collect);
listPermittedUsers
列出被允许访问某个人的人员
function listPermittedUsers($id)
参数
示例用法
$id = 19; $persons->listPermittedUsers($id);
deletePersonPicture
删除人物图片
function deletePersonPicture($id)
参数
示例用法
$id = 19; $persons->deletePersonPicture($id);
addPersonPicture
向人员添加图片。如果已设置图片,则旧图片将被替换。添加的图片(或请求中提供的裁剪参数)应具有相同的宽度和高度,且至少为128像素。接受的格式有GIF、JPG和PNG。所有添加的图片都将被调整到128像素和512像素宽的正方形。
function addPersonPicture($options)
参数
示例用法
$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);
listProductsAssociatedWithAPerson
列出与人员相关联的产品。
function listProductsAssociatedWithAPerson($options)
参数
示例用法
$id = 19; $collect['id'] = $id; $start = 0; $collect['start'] = $start; $limit = 19; $collect['limit'] = $limit; $persons->listProductsAssociatedWithAPerson($collect);
PipelinesController
获取单例实例
可以从API客户端访问PipelinesController
类的单例实例。
$pipelines = $client->getPipelines();
getAllPipelines
返回有关所有管道的数据
function getAllPipelines()
示例用法
$pipelines->getAllPipelines();
addANewPipeline
添加新的管道
function addANewPipeline($options)
参数
示例用法
$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);
deleteAPipeline
标记管道为已删除。
function deleteAPipeline($id)
参数
示例用法
$id = 19; $pipelines->deleteAPipeline($id);
getOnePipeline
返回有关特定管道的数据。还返回该管道各阶段交易摘要。
function getOnePipeline($options)
参数
示例用法
$id = 19; $collect['id'] = $id; $totalsConvertCurrency = 'totals_convert_currency'; $collect['totalsConvertCurrency'] = $totalsConvertCurrency; $pipelines->getOnePipeline($collect);
updateEditAPipeline
更新管道属性
function updateEditAPipeline($options)
参数
示例用法
$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);
getDealsConversionRatesInPipeline
返回给定时间段内所有阶段到阶段转换和管道到关闭率的所有数据。
function getDealsConversionRatesInPipeline($options)
参数
示例用法
$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);
getDealsInAPipeline
列出特定管道在其所有阶段中的交易。
function getDealsInAPipeline($options)
参数
示例用法
$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);
getDealsMovementsInPipeline
返回给定时间段的交易流动统计数据。
function getDealsMovementsInPipeline($options)
参数
示例用法
$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);
ProductFieldsController
获取单例实例
可以通过API客户端访问ProductFieldsController
类的单例实例。
$productFields = $client->getProductFields();
deleteMultipleProductFieldsInBulk
将多个字段标记为已删除。
function deleteMultipleProductFieldsInBulk($ids)
参数
示例用法
$ids = 'ids'; $result = $productFields->deleteMultipleProductFieldsInBulk($ids);
getAllProductFields
返回有关所有产品字段的数据。
function getAllProductFields()
示例用法
$result = $productFields->getAllProductFields();
addANewProductField
添加新的产品字段。有关添加新自定义字段的更多信息,请参阅本教程。
function addANewProductField($body = null)
参数
示例用法
$body = array('key' => 'value'); $result = $productFields->addANewProductField($body);
deleteAProductField
将字段标记为已删除。有关如何删除自定义字段的更多信息,请参阅本教程。
function deleteAProductField($id)
参数
示例用法
$id = 19; $result = $productFields->deleteAProductField($id);
错误
getOneProductField
返回有关特定产品字段的数据。
function getOneProductField($id)
参数
示例用法
$id = 19; $result = $productFields->getOneProductField($id);
错误
updateAProductField
更新产品字段。请参阅本教程中自定义字段值更新的示例。
function updateAProductField($options)
参数
示例用法
$id = 19; $collect['id'] = $id; $name = 'name'; $collect['name'] = $name; $options = 'options'; $collect['options'] = $options; $result = $productFields->updateAProductField($collect);
ProductsController
获取单例实例
ProductsController
类的单例实例可以通过 API 客户端访问。
$products = $client->getProducts();
getAllProducts
返回所有产品的数据。
function getAllProducts($options)
参数
示例用法
$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);
searchProducts
按名称、代码和/或自定义字段搜索所有产品。此端点是 /v1/itemSearch 的包装器,具有更窄的 OAuth 范围。
function searchProducts($options)
参数
示例用法
$term = 'term'; $collect['term'] = $term; $results = $products->searchProducts($collect);
addAProduct
将新产品添加到产品库存中。有关添加产品的更多信息,请参阅本教程。请注意,您可以在请求中提供此处未描述的附加自定义字段。这些自定义字段对于每个 Pipedrive 帐户不同,可以通过长哈希值作为键识别。要确定哪些自定义字段存在,请获取 productFields 并查找 'key' 值。
function addAProduct($body = null)
参数
示例用法
$body = array('key' => 'value'); $products->addAProduct($body);
deleteAProduct
将产品标记为已删除。
function deleteAProduct($id)
参数
示例用法
$id = 19; $products->deleteAProduct($id);
getOneProduct
返回有关特定产品的数据。
function getOneProduct($id)
参数
示例用法
$id = 19; $products->getOneProduct($id);
updateAProduct
更新产品数据。请注意,您可以在请求中提供此处未描述的附加自定义字段。这些自定义字段对于每个 Pipedrive 帐户不同,可以通过长哈希值作为键识别。要确定哪些自定义字段存在,请获取 productFields 并查找 'key' 值。
function updateAProduct($options)
参数
示例用法
$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);
getDealsWhereAProductIsAttachedTo
返回有关附加了产品的交易的数据。
function getDealsWhereAProductIsAttachedTo($options)
参数
示例用法
$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);
listFilesAttachedToAProduct
列出与产品关联的文件。
function listFilesAttachedToAProduct($options)
参数
示例用法
$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);
listFollowersOfAProduct
列出产品的关注者。
function listFollowersOfAProduct($id)
参数
示例用法
$id = 19; $result = $products->listFollowersOfAProduct($id);
addAFollowerToAProduct
向产品添加关注者。
function addAFollowerToAProduct($options)
参数
示例用法
$id = 19; $collect['id'] = $id; $userId = 19; $collect['userId'] = $userId; $result = $products->addAFollowerToAProduct($collect);
deleteAFollowerFromAProduct
从产品中删除关注者。
function deleteAFollowerFromAProduct($options)
参数
示例用法
$id = 19; $collect['id'] = $id; $followerId = 19; $collect['followerId'] = $followerId; $result = $products->deleteAFollowerFromAProduct($collect);
listPermittedUsers
列出有权访问产品的用户。
function listPermittedUsers($id)
参数
示例用法
$id = 19; $result = $products->listPermittedUsers($id);
RecentsController
获取单例实例
可以通过API客户端访问RecentsController
类的单例实例。
$recents = $client->getRecents();
getRecents
返回自给定时间戳后发生的所有最近更改的数据。
function getRecents($options)
参数
示例用法
$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);
RolesController
获取单例实例
可以通过API客户端访问RolesController
类的单例实例。
$roles = $client->getRoles();
getAllRoles
获取所有角色。
function getAllRoles($options)
参数
示例用法
$start = 0; $collect['start'] = $start; $limit = 19; $collect['limit'] = $limit; $result = $roles->getAllRoles($collect);
addARole
添加角色。
function addARole($body = null)
参数
示例用法
$body = array('key' => 'value'); $result = $roles->addARole($body);
deleteARole
删除角色
function deleteARole($id)
参数
示例用法
$id = 19; $result = $roles->deleteARole($id);
getOneRole
获取一个角色
function getOneRole($id)
参数
示例用法
$id = 19; $result = $roles->getOneRole($id);
updateRoleDetails
更新角色详情
function updateRoleDetails($options)
参数
示例用法
$id = 19; $collect['id'] = $id; $parentRoleId = 19; $collect['parentRoleId'] = $parentRoleId; $name = 'name'; $collect['name'] = $name; $result = $roles->updateRoleDetails($collect);
deleteARoleAssignment
从角色中删除分配
function deleteARoleAssignment($options)
参数
示例用法
$id = 19; $collect['id'] = $id; $userId = 19; $collect['userId'] = $userId; $result = $roles->deleteARoleAssignment($collect);
listRoleAssignments
列出角色的分配
function listRoleAssignments($options)
参数
示例用法
$id = 19; $collect['id'] = $id; $start = 0; $collect['start'] = $start; $limit = 19; $collect['limit'] = $limit; $result = $roles->listRoleAssignments($collect);
addRoleAssignment
为角色添加分配
function addRoleAssignment($options)
参数
示例用法
$id = 19; $collect['id'] = $id; $userId = 19; $collect['userId'] = $userId; $result = $roles->addRoleAssignment($collect);
listRoleSubRoles
列出角色子角色
function listRoleSubRoles($options)
参数
示例用法
$id = 19; $collect['id'] = $id; $start = 0; $collect['start'] = $start; $limit = 19; $collect['limit'] = $limit; $result = $roles->listRoleSubRoles($collect);
listRoleSettings
列出角色设置
function listRoleSettings($id)
参数
示例用法
$id = 19; $result = $roles->listRoleSettings($id);
addOrUpdateRoleSetting
添加或更新角色设置
function addOrUpdateRoleSetting($options)
参数
示例用法
$id = 19; $collect['id'] = $id; $settingKey = string::DEAL_DEFAULT_VISIBILITY; $collect['settingKey'] = $settingKey; $value = int::ENUM_0; $collect['value'] = $value; $result = $roles->addOrUpdateRoleSetting($collect);
StagesController
获取单例实例
可以从API客户端访问单例的StagesController
类实例。
$stages = $client->getStages();
deleteMultipleStagesInBulk
将多个阶段标记为已删除。
function deleteMultipleStagesInBulk($ids)
参数
示例用法
$ids = 'ids'; $stages->deleteMultipleStagesInBulk($ids);
getAllStages
返回所有阶段的数据。
function getAllStages($pipelineId = null)
参数
示例用法
$pipelineId = 19; $stages->getAllStages($pipelineId);
addANewStage
添加一个新的阶段,成功时返回ID。
function addANewStage($body = null)
参数
示例用法
$body = array('key' => 'value'); $stages->addANewStage($body);
deleteAStage
将一个阶段标记为已删除。
function deleteAStage($id)
参数
示例用法
$id = 19; $stages->deleteAStage($id);
getOneStage
返回特定阶段的数据。
function getOneStage($id)
参数
示例用法
$id = 19; $stages->getOneStage($id);
updateStageDetails
更新阶段属性。
function updateStageDetails($options)
参数
示例用法
$id = 19; $collect['id'] = $id; $body = array('key' => 'value'); $collect['body'] = $body; $stages->updateStageDetails($collect);
getDealsInAStage
列出特定阶段中的交易。
function getDealsInAStage($options)
参数
示例用法
$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);
TeamsController
获取单例实例
可以从API客户端访问的TeamsController
类的单例实例。
$teams = $client->getTeams();
getAllTeams
返回公司内部团队的数据。
function getAllTeams($options)
参数
示例用法
$orderBy = string::ID; $collect['orderBy'] = $orderBy; $skipUsers = int::ENUM_0; $collect['skipUsers'] = $skipUsers; $result = $teams->getAllTeams($collect);
addANewTeam
向公司添加一个新团队并返回创建的对象。
function addANewTeam($options)
参数
示例用法
$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);
错误
getASingleTeam
返回特定团队的数据
function getASingleTeam($options)
参数
示例用法
$id = 183; $collect['id'] = $id; $skipUsers = int::ENUM_0; $collect['skipUsers'] = $skipUsers; $result = $teams->getASingleTeam($collect);
错误
updateATeam
更新现有的团队并返回更新后的对象
function updateATeam($options)
参数
示例用法
$id = 183; $collect['id'] = $id; $body = array('key' => 'value'); $collect['body'] = $body; $result = $teams->updateATeam($collect);
错误
getAllUsersInATeam
返回团队中所有用户ID的列表
function getAllUsersInATeam($id)
参数
示例用法
$id = 183; $result = $teams->getAllUsersInATeam($id);
错误
addUsersToATeam
向现有团队添加用户
function addUsersToATeam($options)
参数
示例用法
$id = 183; $collect['id'] = $id; $users = array(183); $collect['users'] = $users; $result = $teams->addUsersToATeam($collect);
错误
deleteUsersFromATeam
从现有团队中删除用户
function deleteUsersFromATeam($options)
参数
示例用法
$id = 183; $collect['id'] = $id; $users = array(183); $collect['users'] = $users; $result = $teams->deleteUsersFromATeam($collect);
错误
getAllTeamsOfAUser
返回指定用户是成员的所有团队的数据
function getAllTeamsOfAUser($options)
参数
示例用法
$id = 183; $collect['id'] = $id; $orderBy = string::ID; $collect['orderBy'] = $orderBy; $skipUsers = int::ENUM_0; $collect['skipUsers'] = $skipUsers; $result = $teams->getAllTeamsOfAUser($collect);
UserConnectionsController
获取单例实例
可以通过API客户端访问UserConnectionsController
类的单例实例。
$userConnections = $client->getUserConnections();
getAllUserConnections
返回授权用户的全部连接数据。
function getAllUserConnections()
示例用法
$result = $userConnections->getAllUserConnections();
错误
UserSettingsController
获取单例实例
可以通过API客户端访问UserSettingsController
类的单例实例。
$userSettings = $client->getUserSettings();
listSettingsOfAuthorizedUser
列出授权用户的设置。
function listSettingsOfAuthorizedUser()
示例用法
$userSettings->listSettingsOfAuthorizedUser();
UsersController
获取单例实例
可以从API客户端访问UsersController
类的单例实例。
$users = $client->getUsers();
getAllUsers
返回公司内所有用户的数据。
function getAllUsers()
示例用法
$result = $users->getAllUsers();
addANewUser
向公司添加新用户,成功时返回ID。
function addANewUser($options)
参数
示例用法
$name = 'name'; $collect['name'] = $name; $email = 'email'; $collect['email'] = $email; $activeFlag = true; $collect['activeFlag'] = $activeFlag; $result = $users->addANewUser($collect);
错误
findUsersByName
按用户名查找用户。
function findUsersByName($options)
参数
示例用法
$term = 'term'; $collect['term'] = $term; $searchByEmail = int::ENUM_0; $collect['searchByEmail'] = $searchByEmail; $result = $users->findUsersByName($collect);
getCurrentUserData
返回公司内绑定公司数据的授权用户的数据:公司ID、公司名称和域名。注意,'locale'属性在Pipedrive设置中指的是“日期和数字格式”,而不是所选语言。
function getCurrentUserData()
示例用法
$result = $users->getCurrentUserData();
错误
getOneUser
返回公司内特定用户的数据。
function getOneUser($id)
参数
示例用法
$id = 183; $result = $users->getOneUser($id);
错误
updateUserDetails
更新用户属性。目前,只能更新active_flag属性。
function updateUserDetails($options)
参数
示例用法
$id = 183; $collect['id'] = $id; $activeFlag = true; $collect['activeFlag'] = $activeFlag; $result = $users->updateUserDetails($collect);
错误
listBlacklistedEmailAddressesOfAUser
列出特定用户的黑名单电子邮件地址。黑名单电子邮件是指在使用内置邮箱时不会同步到Pipedrive的电子邮件。
function listBlacklistedEmailAddressesOfAUser($id)
参数
示例用法
$id = 183; $users->listBlacklistedEmailAddressesOfAUser($id);
addBlacklistedEmailAddressForAUser
为特定用户添加黑名单电子邮件地址。
function addBlacklistedEmailAddressForAUser($options)
参数
示例用法
$id = 183; $collect['id'] = $id; $address = 'address'; $collect['address'] = $address; $users->addBlacklistedEmailAddressForAUser($collect);
listFollowersOfAUser
列出特定用户的关注者。
function listFollowersOfAUser($id)
参数
示例用法
$id = 183; $result = $users->listFollowersOfAUser($id);
错误
listUserPermissions
列出用户所有分配的权限集合的聚合权限。
function listUserPermissions($id)
参数
示例用法
$id = 183; $users->listUserPermissions($id);
deleteARoleAssignment
删除用户的角色分配。
function deleteARoleAssignment($options)
参数
示例用法
$id = 183; $collect['id'] = $id; $roleId = 183; $collect['roleId'] = $roleId; $users->deleteARoleAssignment($collect);
listRoleAssignments
列出用户的角色分配。
function listRoleAssignments($options)
参数
示例用法
$id = 183; $collect['id'] = $id; $start = 0; $collect['start'] = $start; $limit = 183; $collect['limit'] = $limit; $users->listRoleAssignments($collect);
addRoleAssignment
为用户添加角色分配。
function addRoleAssignment($options)
参数
示例用法
$id = 183; $collect['id'] = $id; $roleId = 183; $collect['roleId'] = $roleId; $users->addRoleAssignment($collect);
listUserRoleSettings
列出用户分配角色的设置。
function listUserRoleSettings($id)
参数
示例用法
$id = 183; $users->listUserRoleSettings($id);
WebhooksController
获取单例实例
可以从API客户端访问WebhooksController
类的单例实例。
$webhooks = $client->getWebhooks();
getAllWebhooks
返回公司所有webhook的数据。
function getAllWebhooks()
示例用法
$result = $webhooks->getAllWebhooks();
错误
createANewWebhook
创建一个新的webhook并返回其详细信息。注意,指定触发webhook的事件将组合两个参数 - 'event_action' 和 'event_object'。例如,使用 '*.*' 获取有关所有事件的通知,'added.deal' 获取任何新添加的交易,'deleted.persons' 获取任何删除的人员等。有关更多详细信息,请参阅 https://pipedrive.readme.io/docs/guide-for-webhooks。
function createANewWebhook($options)
参数
示例用法
$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);
错误
deleteExistingWebhook
删除指定的webhook。
function deleteExistingWebhook($id)
参数
示例用法
$id = 183; $result = $webhooks->deleteExistingWebhook($id);