bladeaweb/gotowebinar

PHP的GoToWebinar API包装器

1.0.2 2019-09-17 09:20 UTC

This package is auto-updated.

Last update: 2024-09-17 20:14:54 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();