Skip to content

Commit

Permalink
v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-volga committed Oct 9, 2024
1 parent 98229ce commit 972eb1e
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 8 deletions.
28 changes: 28 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# CHANGELOG

## [2.2.0](https://github.com/alex-volga/aircall-php/compare/v2.1.2...v2.2.0) (2024-09-24)
### Features
* Add [Integration](https://developer.aircall.io/api-references/#integration)
* Add [AircallNumbers::registrationStatus](https://developer.aircall.io/api-references/#registration-status)
* Add [AircallCalls::transcription](https://developer.aircall.io/api-references/#retrieve-a-transcription)
* Add [AircallCalls::sentiments](https://developer.aircall.io/api-references/#retrieve-sentiments)
* Add [AircallCalls::topics](https://developer.aircall.io/api-references/#retrieve-topics)
* Add [AircallCalls::summary](https://developer.aircall.io/api-references/#retrieve-a-summary)

### Breaking Changes
* Rename Aircall::transfert to Aircall::transfers

## [2.1.2](https://github.com/alex-volga/aircall-php/compare/v2.1.1...v2.1.2) (2024-09-24)
### Bug Fixes
* Fix delete a tag in AircallTags::delete

## [2.1.1](https://github.com/alex-volga/aircall-php/compare/v2.1.0...v2.1.1) (2024-01-03)
### Bug Fixes
* Hotfix

## [2.1.0](https://github.com/alex-volga/aircall-php/compare/v2.0.1...v2.1.0) (2024-01-03)
### Features
* The ability to [archive](https://developer.aircall.io/api-references/#archive-a-call)/[unarchive](https://developer.aircall.io/api-references/#unarchive-a-call) calls has been added

## [2.0.1](https://github.com/alex-volga/aircall-php/compare/v2.0.0...v2.0.1) (2023-09-07)
### Bug Fixes
* Fix api requests

## 2.0.0 (2020-06-30)
* Upgrade minimum PHP version to 7.1
* BC BREAK: review naming of all functions in all endpoint to simplify them:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This is a non-official Aircall PHP library which provides access to the Aircall
Api references: https://developer.aircall.io/api-references/

## API version
Last update: 1.11.2
Last update: [1.42.0](https://developer.aircall.io/api-references/#changelog)


## Installation
Expand All @@ -12,7 +12,7 @@ The recommended way to install aircall-php is through [Composer](https://getcomp


```
composer require antoinelemaire/aircall-php
composer require alex-volga/aircall-php
```

## Usage
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "antoinelemaire/aircall-php",
"description": "Aircall API client built on top of Guzzle 6",
"name": "alex-volga/aircall-php",
"description": "Aircall API client built on top of Guzzle",
"keywords": ["aircall", "aircall.io", "api", "guzzle"],
"license": "Apache-2.0",
"authors": [
{
"name": "AntoineLemaire",
"homepage": "https://github.com/AntoineLemaire"
"name": "Alex Volga",
"homepage": "https://github.com/alex-volga"
}
],
"autoload": {
Expand All @@ -15,7 +15,7 @@
}
},
"require": {
"php": ">= 7.1",
"php": ">= 8.0",
"ext-json": "*",
"guzzlehttp/guzzle": "~6.0|~7.0"
},
Expand Down
54 changes: 53 additions & 1 deletion src/AircallCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function link(int $id, array $options = [])
*
* @return mixed
*/
public function transfert(int $id, array $options = [])
public function transfers(int $id, array $options = [])
{
$path = $this->callPath($id);

Expand Down Expand Up @@ -233,6 +233,58 @@ public function unarchive(int $id)
return $this->client->put($path.'/unarchive');
}

/**
* Retrieve a transcription
*
* @param int|string $callId
* @return mixed
*/
public function transcription(int|string $callId)
{
$path = $this->callPath($callId);

return $this->client->get($path.'/transcription');
}

/**
* Retrieve sentiments
*
* @param int|string $callId
* @return mixed
*/
public function sentiments(int|string $callId)
{
$path = $this->callPath($callId);

return $this->client->get($path.'/sentiments');
}

/**
* Retrieve topics
*
* @param int|string $callId
* @return mixed
*/
public function topics(int|string $callId)
{
$path = $this->callPath($callId);

return $this->client->get($path.'/topics');
}

/**
* Retrieve a summary
*
* @param int|string $callId
* @return mixed
*/
public function summary(int|string $callId)
{
$path = $this->callPath($callId);

return $this->client->get($path.'/summary');
}


public function callPath(int $id): string
{
Expand Down
4 changes: 4 additions & 0 deletions src/AircallClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class AircallClient
/** @var AircallTeams */
public $teams;

/** @var AircallIntegrations */
public $integrations;

/**
* @param string $apiID app ID
* @param string $apiToken api Token
Expand All @@ -57,6 +60,7 @@ public function __construct(string $apiID, string $apiToken)
$this->contacts = new AircallContacts($this);
$this->tags = new AircallTags($this);
$this->teams = new AircallTeams($this);
$this->integrations = new AircallIntegrations($this);

$this->apiID = $apiID;
$this->apiToken = $apiToken;
Expand Down
57 changes: 57 additions & 0 deletions src/AircallIntegrations.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

namespace Aircall;

use GuzzleHttp\Exception\GuzzleException;

/**
* Class AircallIntegrations.
*/
class AircallIntegrations
{
const BASE_ENDPOINT = 'integrations';

/** @var AircallClient */
private $client;

public function __construct(AircallClient $client)
{
$this->client = $client;
}

/**
* Retrieve Integration information
*
* @return mixed
* @throws GuzzleException
*
*/
public function get()
{
return $this->client->get(self::BASE_ENDPOINT . '/me');
}

/**
* Enable Integration
*
* @return mixed
* @throws GuzzleException
*
*/
public function enable(bool $install = false)
{
return $this->client->post(self::BASE_ENDPOINT . '/enable', ['install' => $install]);
}

/**
* Disable Integration
*
* @return mixed
* @throws GuzzleException
*
*/
public function disable()
{
return $this->client->post(self::BASE_ENDPOINT . '/disable');
}
}
14 changes: 14 additions & 0 deletions src/AircallNumbers.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ public function update(int $id, array $options = [])
return $this->client->put($path, $options);
}

/**
* Update a single Number.
*
* @throws GuzzleException
*
* @return mixed
*/
public function registrationStatus(int $id)
{
$path = $this->numberPath($id);

return $this->client->get($path.'/registration_status');
}

public function numberPath(int $id): string
{
return self::BASE_ENDPOINT.'/'.$id;
Expand Down

0 comments on commit 972eb1e

Please sign in to comment.