Skip to content

Commit e9e2833

Browse files
authored
Merge pull request #46 from pipedrive/GRAL-2095
GRAL-2095 Add /callLogs endpoints
2 parents b5fe565 + dc50505 commit e9e2833

File tree

3 files changed

+559
-0
lines changed

3 files changed

+559
-0
lines changed

README.md

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ You can change the PHPUnit test configuration in the `phpunit.xml` file.
281281
* [ActivitiesController](#activities_controller)
282282
* [ActivityFieldsController](#activity_fields_controller)
283283
* [ActivityTypesController](#activity_types_controller)
284+
* [CallLogsController](#call_logs_controller)
284285
* [CurrenciesController](#currencies_controller)
285286
* [DealFieldsController](#deal_fields_controller)
286287
* [DealsController](#deals_controller)
@@ -806,6 +807,192 @@ $activityTypes->updateEditActivityType($collect);
806807
```
807808

808809

810+
[Back to List of Controllers](#list_of_controllers)
811+
812+
## <a name="call_logs_controller"></a>![Class: ](https://apidocs.io/img/class.png ".CallLogsController") CallLogsController
813+
814+
### Get singleton instance
815+
816+
The singleton instance of the ``` CallLogsController ``` class can be accessed from the API Client.
817+
818+
```php
819+
$callLogs = $client->getCallLogs();
820+
```
821+
822+
### <a name="get_all_call_logs_assigned_to_a_particular_user"></a>![Method: ](https://apidocs.io/img/method.png ".CallLogsController.getAllCallLogsAssignedToAParticularUser") getAllCallLogsAssignedToAParticularUser
823+
824+
> Returns all call logs assigned to a particular user
825+
826+
827+
```php
828+
function getAllCallLogsAssignedToAParticularUser($options)
829+
```
830+
831+
#### Parameters
832+
833+
| Parameter | Tags | Description |
834+
|-----------|------|-------------|
835+
| start | ``` Optional ``` | For pagination, the position that represents the first result for the page |
836+
| limit | ``` Optional ``` | For pagination, the limit of entries to be returned |
837+
838+
#### Example Usage
839+
840+
```php
841+
$start = 0;
842+
$options['start'] = $start;
843+
844+
$limit = 119;
845+
$options['limit'] = $limit;
846+
847+
$callLogs->getAllCallLogsAssignedToAParticularUser($options);
848+
849+
```
850+
851+
### <a name="get_details_of_a_call_log"></a>![Method: ](https://apidocs.io/img/method.png ".CallLogsController.getDetailsOfACallLog") getDetailsOfACallLog
852+
853+
> Returns details of a specific call log
854+
855+
856+
```php
857+
function getDetailsOfACallLog($id)
858+
```
859+
860+
#### Parameters
861+
862+
| Parameter | Tags | Description |
863+
|-----------|------|-------------|
864+
| id | ``` Required ``` | ID of the field |
865+
866+
#### Example Usage
867+
868+
```php
869+
$id = 1;
870+
871+
$callLogs->getDetailsOfACallLog($id);
872+
873+
```
874+
875+
### <a name="add_a_call_log"></a>![Method: ](https://apidocs.io/img/method.png ".CallLogsController.addACallLog") addACallLog
876+
877+
> Adds a new call log
878+
879+
880+
```php
881+
function addACallLog($collect)
882+
```
883+
884+
#### Parameters
885+
886+
| Parameter | Tags | Description |
887+
|-----------|------|-------------|
888+
| user_id | ```optional``` | The ID of the owner of the call log |
889+
| 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. |
890+
| subject| ```optional``` | Name of the activity this call is attached to |
891+
| duration| ```optional``` | Call duration in seconds |
892+
| outcome| ```required``` | Describes the outcome of the call |
893+
| from_phone_number| ```optional``` | The number that made the call |
894+
| to_phone_number| ```required``` | The number called |
895+
| start_time| ```required``` | The date and time of the start of the call in UTC. Format: YYYY-MM-DD HH:MM:SS. |
896+
| end_time | ```required``` | The date and time of the end of the call in UTC. Format: YYYY-MM-DD HH:MM:SS. |
897+
| person_id | ```optional``` | The ID of the Person this call is associated with |
898+
| org_id | ```optional``` | The ID of the Organization this call is associated with |
899+
| deal_id | ```optional``` | The ID of the Deal this call is associated with |
900+
901+
#### Example Usage
902+
903+
```php
904+
905+
$subject = 'subject';
906+
$collect['subject'] = $subject;
907+
908+
$duration = 60;
909+
$collect['duration'] = $duration;
910+
911+
$outcome = 'connected'
912+
$collect['outcome'] = $connected;
913+
914+
$fromPhoneNumber = '+55 555 5555';
915+
$collect['from_phone_number'] = $fromPhoneNumber;
916+
917+
$fromPhoneNumber = '+55 555 5556';
918+
$collect['to_phone_number'] = $fromPhoneNumber;
919+
920+
$startTime = '2021-01-30 22:30:00';
921+
$collect['start_time'] = $startTime;
922+
923+
$endTime = '2021-01-30 22:31:00';
924+
$collect['end_time'] = $endTime;
925+
926+
$personId = 1;
927+
$collect['person_id'] = $personId;
928+
929+
$orgId = 1;
930+
$collect['org_id'] = $orgId;
931+
932+
$dealId = 1;
933+
$collect['deal_id'] = $dealId;
934+
935+
$note = 'note';
936+
$collect['note'] = $note;
937+
938+
$callLogs->addACallLog($collect);
939+
940+
```
941+
942+
### <a name="attach_an_audio_file_to_the_call_log"></a>![Method: ](https://apidocs.io/img/method.png ".CallLogsController.attachAnAudioFileToTheCallLog") attachAnAudioFileToTheCallLog
943+
944+
> Adds an audio recording to the call log. That audio can be played by those who have access to the call log object.
945+
946+
947+
```php
948+
function attachAnAudioFileToTheCallLog($id, $collect)
949+
```
950+
951+
#### Parameters
952+
953+
| Parameter | Tags | Description |
954+
|-----------|------|-------------|
955+
| id | ```required``` | The ID received when you create the call log |
956+
| file | ```required``` | Audio file supported by the HTML5 specification |
957+
958+
#### Example Usage
959+
960+
```php
961+
962+
$id = 'id';
963+
964+
$file = "PathToFile";
965+
$collect['file'] = $file;
966+
967+
$callLogs->attachAnAudioFileToTheCallLog($id, $collect);
968+
969+
```
970+
971+
### <a name="delete_a_call_log"></a>![Method: ](https://apidocs.io/img/method.png ".CallLogsController.deleteACallLog") deleteACallLog
972+
973+
> 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.
974+
975+
976+
```php
977+
function deleteACallLog($id)
978+
```
979+
980+
#### Parameters
981+
982+
| Parameter | Tags | Description |
983+
|-----------|------|-------------|
984+
| id | ```required``` | ID of the callLog |
985+
986+
#### Example Usage
987+
988+
```php
989+
990+
$id = 'id';
991+
992+
$callLogs->deleteACallLog($id);
993+
994+
```
995+
809996
[Back to List of Controllers](#list_of_controllers)
810997

811998
## <a name="currencies_controller"></a>![Class: ](https://apidocs.io/img/class.png ".CurrenciesController") CurrenciesController

src/Client.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ public function getActivityTypes()
5353
{
5454
return Controllers\ActivityTypesController::getInstance();
5555
}
56+
/**
57+
* Singleton access to CallLogs controller
58+
* @return Controllers\CallLogsController The *Singleton* instance
59+
*/
60+
public function getCallLogs()
61+
{
62+
return Controllers\CallLogsController::getInstance();
63+
}
5664
/**
5765
* Singleton access to Currencies controller
5866
* @return Controllers\CurrenciesController The *Singleton* instance

0 commit comments

Comments
 (0)