1. Go to this page and download the library: Download georgo/mojio library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// ...
// Set the redirect URI to point to this exact same script.
$redirectUri = 'https://' . $_SERVER['HTTP_HOST']
. strtok($_SERVER['REQUEST_URI'], '?');
if(!isset($_GET['code'])) {
// Initiate an OAuth request
header('Location: '.$client->getAuthorizationUrl($redirectUri));
exit;
} else {
// Handle the OAuth response
$client->authorize($redirectUri, $_GET['code']);
}
// ...
// Logout user.
$client->logout();
// ...
// Fetch first page of 15 users
$results = $client->getTrips([
'pageSize' => 15,
'page' => 1
]);
foreach( $results as $trip )
{
// Do something with each trip
// ...
}
// ...
$mojioId = "0a5123a0-7e70-12d1-a5k6-28db18c10200";
// Fetch mojio from API
$mojio = $client->getMojio([
"id" => $mojioId
]);
// Do something with the mojio data
// ...
// ...
$appId = "0a5123a0-7e70-12d1-a5k6-28db18c10200";
// Fetch app from API
$app = $client->getApp([
'id' => $appId
]);
// Make a change
$app->Name = "New Application Name";
// Save the changes
$client->saveEntity([
'entity' => $app
]);