PHP code example of arianrashidi / pocketapi

1. Go to this page and download the library: Download arianrashidi/pocketapi 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/ */

    

arianrashidi / pocketapi example snippets

 php
$pocket = new ArianRashidi\PocketApi\Pocket($consumerKey);
 php
$pocket->setConsumerKey($consumerKey);
$pocket->getConsumerKey();
$pocket->setAccessToken($accessToken); // Required for addApi(), modifyApi() and retrieveApi().
$pocket->getAccessToken();
$pocket->setHttpClient(new GuzzleHttp\Client());
$pocket->getHttpClient();
 php
$pocket->authenticationApi()->obtainRequestToken($redirectUrl);
$pocket->authenticationApi()->authorizationUrl($requestToken, $redirectUrl);
$pocket->authenticationApi()->obtainAccess($requestToken);
 php
$pocket->addApi()->single($url);
 php
$pocket->modifyApi()->send($actions);
 php
$pocket->retrieveApi()->get();