paravibe/gotowebinar

PHP的GoToWebinar API包装器

1.2.2 2023-03-14 12:27 UTC

This package is auto-updated.

Last update: 2024-09-14 15:27:17 UTC


README

Latest Version Build Status Total Downloads

安装

composer require paravibe/gotowebinar

如何使用

初始化客户端

$client = new \LogMeIn\GoToWebinar\Client($access_token, $values);

其中 $access_token 是在授权过程中获取的令牌 - https://goto-developer.logmeininc.com/how-get-access-token-and-organizer-key
$values 包含以下数据:

  • account_key
  • account_type
  • email
  • firstName
  • lastName
  • organizer_key

通过在此处描述的任何方法 https://goto-developer.logmeininc.com/content/gotowebinar-api-reference-v2 使用适当的HTTP方法和端点传递给 createRequest() 方法。

GET/DELETE 方法

$get = $client->createRequest('GET', "organizers/{$organizer_key}/webinars")->execute();
$data = $get->getDecodedBody();

POST/PUT 方法

$post_data = array(
  'subject' => 'TEST',
  'description' => 'Test API integration',
  'times' => array(
    array(
      'startTime' => '2018-05-12T15:00:00Z',
      'endTime' => '2018-05-12T16:00:00Z',
    )
  ),
  'timeZone' => 'Europe/Kiev',
);

$new = $client->createRequest('POST', "organizers/{$organizer_key}/webinars")
  ->attachBody($post_data)
  ->execute();