1. Go to this page and download the library: Download vdhicts/hihaho-api-client 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/ */
vdhicts / hihaho-api-client example snippets
// Initialize the configuration
$configuration = new \Vdhicts\HiHaHo\Configuration(
..
);
// Initialize the API
$api = new \Vdhicts\HiHaHo\HiHaHo($configuration);
// Get all videos
$response = $api->allVideos();
if ($response->ok()) {
$response->json('data');
}
class Video extends HiHaHo
{
public function updateVideo(int $videoId): Response
{
return $this
->withToken($this->getAccessToken())
->put(sprintf('v2/video/%d', $videoId), [
'status' => 0,
]);
}
}
if ($response->failed()) {
var_dump($response->serverError());
}