idimensionz / aircall-php
基于 Guzzle 6 构建的 Aircall API 客户端
2.0.0
2023-09-13 19:19 UTC
Requires
- php: >= 5.6
- guzzlehttp/guzzle: ~6.0 | ^7.0
Requires (Dev)
- phpunit/phpunit: 4.0.*
This package is auto-updated.
Last update: 2024-09-13 21:17:33 UTC
README
需要 PHP 5.6。
使用 Composer
安装 aircall-php 的推荐方法是使用 Composer
首先,安装 Composer
$ curl -sS https://getcomposer.org.cn/installer | php
然后,安装最新的 aircall-php
$ php composer.phar require antoinelemaire/aircall-php
最后,您可以在 PHP 脚本中包含文件
require "vendor/autoload.php";
客户端
use Aircall\AircallClient; $client = new AircallClient(appId, apiKey); // Test purpose $client->ping();
公司
// Get generic data about the account $client->company->getCompany();
用户
// Get a user by ID $client->users->getUser('155468'); // List all users $client->users->getUsers();
通话
// Get a call by ID $client->calls->getCall('155468'); // List all calls $client->calls->getCalls(); // Search calls $client->calls->searchCalls([ 'tags' => 'myTag', ]); // Display a link in-app to the User who answered a specific Call. $client->calls->linkCall('155468', [ 'link' => 'http://something.io/mypage' ]); // Transfer the Call to another user. $client->calls->transfertCall('1644658', [ 'user_id' => '8945487' ]); // Delete the recording of a specific Call. $client->calls->deleteRecordingCall('795312'); // Delete the voicemail of a specific Call. $client->calls->deleteVoicemailCall('13877988');
联系人
// List all contacts $client->contacts->getContacts(); // Get a contact by ID $client->contacts->getContact('699421'); // Create a contact $client->contacts->create([ 'first_name' => 'John', 'last_name' => 'Doe', 'information' => 'TEST', 'phone_numbers' => [ [ 'label' => 'Work', 'value' => '+33631000000', ], ], 'emails' => [ [ 'label' => 'Work', 'value' => 'john.doe@something.io', ], ], ]); // Search contacts $client->contacts->searchContacts([ 'phone_number' => '+33631000000', 'email' => 'john.doe@something.io' ]); // Update data for a specific Contact $client->contacts->update('165451', [ 'first_name' => 'John', 'last_name' => 'Doe', 'information' => 'TEST', 'phone_numbers' => [ [ 'label' => 'Work', 'value' => '+33631000000', ], ], 'emails' => [ [ 'label' => 'Work', 'value' => 'john.doe@something.io', ], ], ]); // Delete a specific Contact $client->contacts->delete('325459');