agyson/interakt-php-sdk

Interakt PHP SDK

1.0.9 2023-06-28 14:28 UTC

This package is auto-updated.

Last update: 2024-09-28 17:07:27 UTC


README

Interakt PHP SDK。阅读他们的 文档 获取更多信息。

安装

运行 composer

composer require agyson/interakt-php-sdk

使用

获取 API 密钥(认证)

在您的应用程序中,您需要在发起任何跟踪调用之前设置您的 api_key

要找到您的 API 密钥,

  • 请转到您的 interakt 账户设置 -> 开发者设置

  • 复制 Secret Key。

  • 使用此密钥

独立使用

确保您已经有了 Interakt 账户和 API 密钥

require 'vendor/autoload.php';

use Agyson\InteraktPhpSdk\Interakt;

$sms = new Interakt(env('api_key'));

// Get All Users
$interakt->get_users(
      $offset = 0,
      $limit = 100,
      $filter_start_date = "2010-01-01",
      $filter_end_date = "2023-01-01"
);

// Creating & Updating Users
$interakt->track_user(
      $userId = null,
      $fullPhoneNumber = null,
      $phoneNumber = null,
      $countryCode = null,
      $traits = [],
      $tags = []
);

// Assign Events to Specific Users
$interakt->track_event(
     $userId = null,
     $fullPhoneNumber = null,
     $phoneNumber = null,
     $countryCode = null,
     $event = null,
     $traits = []
);

// Send Message Templates
$interakt->send_template(
    $fullPhoneNumber = null,
    $phoneNumber = null, 
    $countryCode = null,
    $callbackData = null,
    $templateName = null,
    $templateLanguageCode = null
    $headerValues = [],
    $bodyValues = [],
    $buttonValues = [],
);

阅读他们的 Postman API 文档 获取使用 API 的更详细信息。

许可证

MIT © Agy Nurwicaksono