M
M
Michael2015-09-07 16:41:25
PHP
Michael, 2015-09-07 16:41:25

Access token vimeo and how to get exactly my feeds?

For information, I create a link that the user clicks on to get a token

require("classes/vimeo/autoload.php");
$client_id = '';
$client_secret = '';
echo "This is an unauthenticated request to /users/dashron<br />";
$lib =  new \Vimeo\Vimeo($client_id, $client_secret);
$_SESSION['state'] = base64_encode(openssl_random_pseudo_bytes(30));
echo 'To authenticate you should click <a href="'
    . $lib->buildAuthorizationEndpoint('url', 'public', $_SESSION['state'])
    . '">here</a><br />';

When processing a transition
require("classes/vimeo/autoload.php");
$client_id = '';
$client_secret = '';
$token = '';
$lib =  new \Vimeo\Vimeo($client_id, $client_secret);

$tokens = $lib->accessToken($_GET['code'], 'url');
if ($tokens['status'] == 200) {
    echo $_SESSION['access_token'] = $tokens['body']['access_token'];

}
$lib->setToken($_SESSION['access_token']);
    $response = $lib->request('/me/feed', array('per_page' => 20,'page'=>1), 'GET');
var_dump($response['body']);

How to save this token, it just turns out that in order to get $_GET['code'] you need to confirm the transition every time, and I need to put a check on cron. How can I generate code, maybe I chose the wrong approach?
Well, the question is, who knows, left advertising videos will fall out, how can they be removed from the feed, otherwise they are parsed along with the necessary information
f74fb325aa6a4a92b47a0b8482b0a6d8.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question