antoinelemaire/aircall-php

基于 Guzzle 6 构建的 Aircall API 客户端

2.0.0 2020-06-30 07:58 UTC

This package is auto-updated.

Last update: 2024-09-19 02:31:07 UTC


README

这是一个非官方的 Aircall PHP 库,它提供从 PHP 编写的应用程序访问 Aircall API 的功能。

API 参考: https://developer.aircall.io/api-references/

API 版本

最后更新: 1.11.2

安装

推荐通过 Composer 安装 aircall-php

composer require antoinelemaire/aircall-php

使用方法

客户端

use Aircall\AircallClient;

$client = new AircallClient(appId, apiKey);

// Test purpose
$client->ping();

公司

// Get generic data about the account
$client->company->get();

用户

// Get a user by ID
$client->users->get(155468);

// List all users
$client->users->list();

通话

// Get a call by ID
$client->calls->get(155468);

// List all calls
$client->calls->list();

// Search calls
$client->calls->search([
  'tags' => 'myTag',
]);

// Display a link in-app to the User who answered a specific Call.
$client->calls->link(155468, [
    'link' => 'http://something.io/mypage'
]);

// Transfer the Call to another user.
$client->calls->transfert(1644658, [
    'user_id' => 8945487
]);

// Delete the recording of a specific Call.
$client->calls->deleteRecording(795312);

// Delete the voicemail of a specific Call.
$client->calls->deleteVoicemail(13877988);

联系人

// List all contacts
$client->contacts->list();

// Get a contact by ID
$client->contacts->get(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->search([
    '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);

标签

待办事项

Webhooks

待办事项

团队

待办事项