Skip to content

Commit d887a1e

Browse files
authored
Merge pull request #40 from pipedrive/GRAL-1902
GRAL-1902 Removed deprecated endpoints
2 parents f961d5f + e44ce2d commit d887a1e

8 files changed

+3
-797
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# System, IDE, misc
22
.DS_Store
33
.idea
4-
.vscode
4+
.vscode
5+
composer.*
6+
vendor

README.md

Lines changed: 0 additions & 275 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,43 +1192,6 @@ $result = $deals->addADeal($body);
11921192
```
11931193

11941194

1195-
### <a name="find_deals_by_name"></a>![Method: ](https://apidocs.io/img/method.png ".DealsController.findDealsByName") findDealsByName
1196-
1197-
> Searches all deals by their title.
1198-
1199-
1200-
```php
1201-
function findDealsByName($options)
1202-
```
1203-
1204-
#### Parameters
1205-
1206-
| Parameter | Tags | Description |
1207-
|-----------|------|-------------|
1208-
| term | ``` Required ``` | Search term to look for |
1209-
| personId | ``` Optional ``` | ID of the person the Deal is associated with. |
1210-
| orgId | ``` Optional ``` | ID of the organization the Deal is associated with. |
1211-
1212-
1213-
1214-
#### Example Usage
1215-
1216-
```php
1217-
$term = 'term';
1218-
$collect['term'] = $term;
1219-
1220-
$personId = 119;
1221-
$collect['personId'] = $personId;
1222-
1223-
$orgId = 119;
1224-
$collect['orgId'] = $orgId;
1225-
1226-
1227-
$result = $deals->findDealsByName($collect);
1228-
1229-
```
1230-
1231-
12321195
### <a name="get_deals_summary"></a>![Method: ](https://apidocs.io/img/method.png ".DealsController.getDealsSummary") getDealsSummary
12331196

12341197
> Returns summary of all the deals.
@@ -4016,44 +3979,6 @@ $organizations->addAnOrganization($body);
40163979

40173980
```
40183981

4019-
4020-
### <a name="find_organizations_by_name"></a>![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.findOrganizationsByName") findOrganizationsByName
4021-
4022-
> Searches all organizations by their name.
4023-
4024-
4025-
```php
4026-
function findOrganizationsByName($options)
4027-
```
4028-
4029-
#### Parameters
4030-
4031-
| Parameter | Tags | Description |
4032-
|-----------|------|-------------|
4033-
| term | ``` Required ``` | Search term to look for |
4034-
| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start |
4035-
| limit | ``` Optional ``` | Items shown per page |
4036-
4037-
4038-
4039-
#### Example Usage
4040-
4041-
```php
4042-
$term = 'term';
4043-
$collect['term'] = $term;
4044-
4045-
$start = 0;
4046-
$collect['start'] = $start;
4047-
4048-
$limit = 69;
4049-
$collect['limit'] = $limit;
4050-
4051-
4052-
$organizations->findOrganizationsByName($collect);
4053-
4054-
```
4055-
4056-
40573982
### <a name="delete_an_organization"></a>![Method: ](https://apidocs.io/img/method.png ".OrganizationsController.deleteAnOrganization") deleteAnOrganization
40583983

40593984
> Marks an organization as deleted.
@@ -4989,51 +4914,6 @@ $persons->addAPerson($body);
49894914
```
49904915

49914916

4992-
### <a name="find_persons_by_name"></a>![Method: ](https://apidocs.io/img/method.png ".PersonsController.findPersonsByName") findPersonsByName
4993-
4994-
> Searches all persons by their name.
4995-
4996-
4997-
```php
4998-
function findPersonsByName($options)
4999-
```
5000-
5001-
#### Parameters
5002-
5003-
| Parameter | Tags | Description |
5004-
|-----------|------|-------------|
5005-
| term | ``` Required ``` | Search term to look for |
5006-
| orgId | ``` Optional ``` | ID of the organization person is associated with. |
5007-
| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start |
5008-
| limit | ``` Optional ``` | Items shown per page |
5009-
| searchByEmail | ``` Optional ``` | When enabled, term will only be matched against email addresses of people. Default: false |
5010-
5011-
5012-
5013-
#### Example Usage
5014-
5015-
```php
5016-
$term = 'term';
5017-
$collect['term'] = $term;
5018-
5019-
$orgId = 233;
5020-
$collect['orgId'] = $orgId;
5021-
5022-
$start = 0;
5023-
$collect['start'] = $start;
5024-
5025-
$limit = 233;
5026-
$collect['limit'] = $limit;
5027-
5028-
$searchByEmail = int::ENUM_0;
5029-
$collect['searchByEmail'] = $searchByEmail;
5030-
5031-
5032-
$persons->findPersonsByName($collect);
5033-
5034-
```
5035-
5036-
50374917
### <a name="delete_a_person"></a>![Method: ](https://apidocs.io/img/method.png ".PersonsController.deleteAPerson") deleteAPerson
50384918

50394919
> Marks a person as deleted.
@@ -6239,47 +6119,6 @@ $products->addAProduct($body);
62396119
```
62406120

62416121

6242-
### <a name="find_products_by_name"></a>![Method: ](https://apidocs.io/img/method.png ".ProductsController.findProductsByName") findProductsByName
6243-
6244-
> Returns data about the products that were found. If currency was set in request, prices in that currency are served back.
6245-
6246-
6247-
```php
6248-
function findProductsByName($options)
6249-
```
6250-
6251-
#### Parameters
6252-
6253-
| Parameter | Tags | Description |
6254-
|-----------|------|-------------|
6255-
| term | ``` Required ``` | Search term to look for, minimum 3 characters. |
6256-
| currency | ``` Optional ``` | Currency code in which prices should be returned in. If omitted, prices in user's default currency will be returned. |
6257-
| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start |
6258-
| limit | ``` Optional ``` | Items shown per page |
6259-
6260-
6261-
6262-
#### Example Usage
6263-
6264-
```php
6265-
$term = 'term';
6266-
$collect['term'] = $term;
6267-
6268-
$currency = 'currency';
6269-
$collect['currency'] = $currency;
6270-
6271-
$start = 0;
6272-
$collect['start'] = $start;
6273-
6274-
$limit = 19;
6275-
$collect['limit'] = $limit;
6276-
6277-
6278-
$result = $products->findProductsByName($collect);
6279-
6280-
```
6281-
6282-
62836122
### <a name="delete_a_product"></a>![Method: ](https://apidocs.io/img/method.png ".ProductsController.deleteAProduct") deleteAProduct
62846123

62856124
> Marks a product as deleted.
@@ -7021,120 +6860,6 @@ $result = $roles->addOrUpdateRoleSetting($collect);
70216860
```
70226861

70236862

7024-
[Back to List of Controllers](#list_of_controllers)
7025-
7026-
## <a name="search_results_controller"></a>![Class: ](https://apidocs.io/img/class.png ".SearchResultsController") SearchResultsController
7027-
7028-
### Get singleton instance
7029-
7030-
The singleton instance of the ``` SearchResultsController ``` class can be accessed from the API Client.
7031-
7032-
```php
7033-
$searchResults = $client->getSearchResults();
7034-
```
7035-
7036-
### <a name="get_perform_a_search"></a>![Method: ](https://apidocs.io/img/method.png ".SearchResultsController.getPerformASearch") getPerformASearch
7037-
7038-
> Performs a search across the account and returns SearchResults.
7039-
7040-
7041-
```php
7042-
function getPerformASearch($options)
7043-
```
7044-
7045-
#### Parameters
7046-
7047-
| Parameter | Tags | Description |
7048-
|-----------|------|-------------|
7049-
| term | ``` Required ``` | Search term to look for, minimum 2 characters. |
7050-
| itemType | ``` Optional ``` | Search for items of exact type. If omitted, all types of items are searched. |
7051-
| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start |
7052-
| limit | ``` Optional ``` | Items shown per page |
7053-
| exactMatch | ``` Optional ``` | When enabled, only full exact matches against the given term are returned. The minimum 2 character limit for the term is discarded when exact_match is enabled. It will only work if search term is 30 characters or less. |
7054-
7055-
7056-
7057-
#### Example Usage
7058-
7059-
```php
7060-
$term = 'term';
7061-
$collect['term'] = $term;
7062-
7063-
$itemType = string::DEAL;
7064-
$collect['itemType'] = $itemType;
7065-
7066-
$start = 0;
7067-
$collect['start'] = $start;
7068-
7069-
$limit = 19;
7070-
$collect['limit'] = $limit;
7071-
7072-
$exactMatch = int::ENUM_0;
7073-
$collect['exactMatch'] = $exactMatch;
7074-
7075-
7076-
$searchResults->getPerformASearch($collect);
7077-
7078-
```
7079-
7080-
7081-
### <a name="get_perform_a_search_using_a_specific_field_value"></a>![Method: ](https://apidocs.io/img/method.png ".SearchResultsController.getPerformASearchUsingASpecificFieldValue") getPerformASearchUsingASpecificFieldValue
7082-
7083-
> Performs a search from a specific field's values. Results can be either the distinct values of the field (useful for searching autocomplete field values), or actual items IDs (deals, persons, organizations or products). Works only with the following field types: varchar, varchar_auto, double, address, text, phone, date.
7084-
7085-
7086-
```php
7087-
function getPerformASearchUsingASpecificFieldValue($options)
7088-
```
7089-
7090-
#### Parameters
7091-
7092-
| Parameter | Tags | Description |
7093-
|-----------|------|-------------|
7094-
| term | ``` Required ``` | Search term to look for, minimum 2 characters. |
7095-
| fieldType | ``` Required ``` | Type of the field to perform the search from. |
7096-
| fieldKey | ``` Required ``` | Key of the field to search from. Field key can be obtained by fetching the list of fields using any of fields API GET methods (dealFields, personFields, ..). |
7097-
| exactMatch | ``` Optional ``` | When enabled, only full exact matches against the given term are returned. By default, term can be present anywhere in the resulting field values to be considered a match. The minimum 2 character limit for the term is discarded when exact_match is enabled. |
7098-
| returnFieldKey | ``` Optional ``` | Name of the field in search results from which the search was performed. When omitted, 'value' will be used. You may want to set this parameter to match the field_key. |
7099-
| returnItemIds | ``` Optional ``` | Whether to return matching items IDs in search results. When omitted or set to 0, only distinct values of the searched field are returned. When enabled, the return_field_key parameter is ignored and the results include the searched field as its own key. |
7100-
| start | ``` Optional ``` ``` DefaultValue ``` | Pagination start |
7101-
| limit | ``` Optional ``` | Items shown per page |
7102-
7103-
7104-
7105-
#### Example Usage
7106-
7107-
```php
7108-
$term = 'term';
7109-
$collect['term'] = $term;
7110-
7111-
$fieldType = string::DEALFIELD;
7112-
$collect['fieldType'] = $fieldType;
7113-
7114-
$fieldKey = 'field_key';
7115-
$collect['fieldKey'] = $fieldKey;
7116-
7117-
$exactMatch = int::ENUM_0;
7118-
$collect['exactMatch'] = $exactMatch;
7119-
7120-
$returnFieldKey = 'return_field_key';
7121-
$collect['returnFieldKey'] = $returnFieldKey;
7122-
7123-
$returnItemIds = int::ENUM_0;
7124-
$collect['returnItemIds'] = $returnItemIds;
7125-
7126-
$start = 0;
7127-
$collect['start'] = $start;
7128-
7129-
$limit = 19;
7130-
$collect['limit'] = $limit;
7131-
7132-
7133-
$searchResults->getPerformASearchUsingASpecificFieldValue($collect);
7134-
7135-
```
7136-
7137-
71386863
[Back to List of Controllers](#list_of_controllers)
71396864

71406865
## <a name="stages_controller"></a>![Class: ](https://apidocs.io/img/class.png ".StagesController") StagesController

src/Controllers/DealsController.php

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -238,67 +238,6 @@ public function addADeal(
238238
return $mapper->mapClass($response->body, 'Pipedrive\\Models\\GetAddedDeal');
239239
}
240240

241-
/**
242-
* Searches all deals by their title.
243-
*
244-
* @param array $options Array with all options for search
245-
* @param string $options['term'] Search term to look for
246-
* @param integer $options['personId'] (optional) ID of the person the Deal is associated with.
247-
* @param integer $options['orgId'] (optional) ID of the organization the Deal is associated with.
248-
* @return mixed response from the API call
249-
* @throws APIException Thrown if API call fails
250-
*/
251-
public function findDealsByName(
252-
$options
253-
) {
254-
//check or get oauth token
255-
OAuthManager::getInstance()->checkAuthorization();
256-
257-
//prepare query string for API call
258-
$_queryBuilder = '/deals/find';
259-
260-
//process optional query parameters
261-
APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (
262-
'term' => $this->val($options, 'term'),
263-
'person_id' => $this->val($options, 'personId'),
264-
'org_id' => $this->val($options, 'orgId'),
265-
));
266-
267-
//validate and preprocess url
268-
$_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder);
269-
270-
//prepare headers
271-
$_headers = array (
272-
'user-agent' => BaseController::USER_AGENT,
273-
'Accept' => 'application/json',
274-
'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)
275-
);
276-
277-
//call on-before Http callback
278-
$_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);
279-
if ($this->getHttpCallBack() != null) {
280-
$this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);
281-
}
282-
283-
//and invoke the API call request to fetch the response
284-
$response = Request::get($_queryUrl, $_headers);
285-
286-
$_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);
287-
$_httpContext = new HttpContext($_httpRequest, $_httpResponse);
288-
289-
//call on-after Http callback
290-
if ($this->getHttpCallBack() != null) {
291-
$this->getHttpCallBack()->callOnAfterRequest($_httpContext);
292-
}
293-
294-
//handle errors defined at the API level
295-
$this->validateResponse($_httpResponse, $_httpContext);
296-
297-
$mapper = $this->getJsonMapper();
298-
299-
return $mapper->mapClass($response->body, 'Pipedrive\\Models\\GetDealsByName');
300-
}
301-
302241
/**
303242
* Returns summary of all the deals.
304243
*

0 commit comments

Comments
 (0)