Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0a555a1
Added method getById to Activities.
atomasevic Jul 2, 2015
ab3a251
Added method getById to Activities.
atomasevic Jul 2, 2015
3f3db6d
Reverted gitignore file for pull request
atomasevic Jul 2, 2015
3c553ab
Reverted gitignore file for pull request
atomasevic Jul 2, 2015
cd6692e
included persons:getByEmail
atomasevic Jul 17, 2015
25835e5
activities getByUser
atomasevic Jul 17, 2015
7cf7333
activities
atomasevic Jul 17, 2015
3798524
Deals.php
atomasevic Jul 27, 2015
f0eee55
Organizations.php
atomasevic Jul 29, 2015
456c5bb
Organizations.php
atomasevic Jul 29, 2015
5590c22
Deals.php
atomasevic Oct 20, 2015
fe2f973
Deals.php
atomasevic Nov 20, 2015
dd3c14d
gitignore .idea
atomasevic Feb 16, 2016
b916482
updated deal products to include product details in response
atomasevic Feb 16, 2016
3b3c62a
pipedrive-api
atomasevic Feb 25, 2016
e982fbd
pipedrive-api
atomasevic Feb 26, 2016
28aa485
pipedrive-api
atomasevic Mar 1, 2016
68e160a
Pipedrive-Api
atomasevic Jun 6, 2016
4e7f21e
Pipedrive-Api
atomasevic Jun 6, 2016
38933d6
Pipedrive-Api
atomasevic Jul 20, 2016
8015653
Pipedrive-Api
atomasevic Jul 20, 2016
a3090fc
CURL timeout to 8000ms
atomasevic Aug 30, 2016
5981794
- ORGANIZATION/DEAL: add/delete followers
atomasevic Jul 4, 2017
399cdc7
ACTIVITIES:
atomasevic Oct 3, 2017
dcf1d8d
PERSONS:
atomasevic Nov 10, 2017
0823255
- list followers methods
atomasevic Nov 10, 2017
efa2d67
- delete product from deal
atomasevic Nov 28, 2017
903fa01
- stages support
atomasevic Jan 9, 2018
690ecb2
- deal flow method
atomasevic Jan 24, 2018
bc25383
- increased curl timeout from 8kms to 14kms
atomasevic Jan 26, 2018
dd778eb
- deals summary
atomasevic Jan 26, 2018
d036644
- notes methods
atomasevic Feb 26, 2018
7771788
- summary methods
atomasevic May 4, 2018
f6d3d6d
- persons/id/activities
atomasevic May 30, 2018
8a39e86
- organizations/id/activities
atomasevic Sep 5, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ composer.phar
composer.lock
.DS_Store
Thumbs.db
sftp-config.json
sftp-config.json
.idea
55 changes: 53 additions & 2 deletions src/Benhawker/Pipedrive/Library/Activities.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ public function __construct(\Benhawker\Pipedrive\Pipedrive $master)
/**
* Adds a activity
*
* @param array $data activity detials
* @return array returns detials of the activity
* @param array $data activity details
* @return array returns details of the activity
* @throws PipedriveMissingFieldError
*/
public function add(array $data)
{
Expand All @@ -45,4 +46,54 @@ public function add(array $data)

return $this->curl->post('activities', $data);
}

/**
* @param $id
* @return array returns deleted id
*/
public function delete($id){
return $this->curl->delete('activities/'.$id);
}

/**
* Update activity
* @param $id
* @param $data
* @return array
*/
public function update($id, $data)
{
return $this->curl->put('activities/' . $id, $data);
}

/**
* Return activity
*
* @param int $id pipedrive activity id
* @return array returns details of activity
*/
public function getById($id)
{
return $this->curl->get('activities/' . $id);
}

/**
* @param array $data
* @return array returns all activities by data fields
*/
public function getByUser(array $data)
{
return $this->curl->get('activities', $data);
}

/**
* List activities by condition
*
* @param array $data
* @return array return all activities by data fields
*/
public function getList(array $data)
{
return $this->curl->get('activities/list', $data);
}
}
23 changes: 22 additions & 1 deletion src/Benhawker/Pipedrive/Library/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function __construct($url, $apiKey)
$this->setOpt(CURLOPT_USERAGENT, self::USER_AGENT)
->setOpt(CURLOPT_HEADER, false)
->setOpt(CURLOPT_RETURNTRANSFER, true)
->setOpt(CURLOPT_TIMEOUT_MS, 15000)
->setOpt(CURLOPT_HTTPHEADER, array("Accept: application/json"));
}

Expand Down Expand Up @@ -122,6 +123,26 @@ public function delete($method)
->exec();
}


/**
* Bulk delete request
*
* @param $method
* @param array $data
* @return array
* @throws PipedriveApiError
* @throws PipedriveHttpError
*/
public function bulkDelete($method, array $data)
{

return $this->createEndPoint($method)
->setOpt(CURLOPT_CUSTOMREQUEST, 'DELETE')
->setOpt(CURLOPT_POSTFIELDS, http_build_query($data))
->exec();

}

/**
* Execute current cURL session
*
Expand Down Expand Up @@ -232,7 +253,7 @@ protected function postfields($data)
}

/**
* Build multidimenianl query
* Build multidimensional query
* from: https://github.com/php-curl-class/php-curl-class
*
* @param array $data post data
Expand Down
3 changes: 2 additions & 1 deletion src/Benhawker/Pipedrive/Library/DealFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ public function getById($id)
/**
* Adds a dealField
*
* @param array $data deal field detials
* @param array $data deal field details
* @return array returns details of the deal field
* @throws PipedriveMissingFieldError
*/
public function add(array $data)
{
Expand Down
Loading