paravibe / gototraining
The GoToTraining API wrapper for PHP
Installs: 8 761
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.0 || ^7.0
- guzzlehttp/guzzle: ^7.0 || ^6.0
Requires (Dev)
- phpunit/phpunit: ^5.5
This package is auto-updated.
Last update: 2024-10-30 01:42:53 UTC
README
Installation
composer require paravibe/gototraining
How to use
Initialize client
$client = new \LogMeIn\GoToTraining\Client($access_token, $values);
Where $access_token
is a token retrived during authorization procedure - https://developer.goto.com/guides/HowTos/03_HOW_accessToken/
and $values
are response data that contain:
- account_key
- account_type
- firstName
- lastName
- organizer_key
Use any method described here https://developer.goto.com/GoToTrainingV1
by passing proper HTTP method and endpoint to createRequest()
method.
GET/DELETE methods
$get = $client->createRequest('GET', "organizers/{$organizer_key}/trainings")->execute(); $data = $get->getDecodedBody();
POST/PUT methods
$post_data = array( 'name' => 'Training', 'description' => 'Test API integration', 'times' => [ [ 'startDate' => '2021-03-02T12:00:00Z', 'endDate' => '2021-03-02T13:00:00Z', ] ], 'timeZone' => 'Europe/Kiev', ); $new = $client->createRequest('POST', "organizers/{$organizer_key}/trainings") ->attachBody($post_data) ->execute();