PHP code example of local-spark / reviewqueue-v1

1. Go to this page and download the library: Download local-spark/reviewqueue-v1 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/ */

    

local-spark / reviewqueue-v1 example snippets




$reviewQueueApi = new ReviewQueueV1('<YOUR_API_KEY>');

// Send a review request
try {

    $reviewRequestAPI = $reviewQueueApi->reviewRequest();
    $response = $reviewRequestAPI->create('+18888888888');
    print_r($response);

} catch (Exception $e) {
    die($e->getMessage());
}




try {
    
    // Retrieve 200 reviews per request
    $firstPageOfReviews = $reviewsAPI->getAll(200);

    // Page meta
    $currentPage = $reviewsAPI->meta->currentPage;
    $totalCount = $reviewsAPI->meta->totalCount;
    $itemsPerPage = $reviewsAPI->meta->perPage;
    $pageCount = $reviewsAPI->meta->pageCount;

    // Get next 20 results
    if($pageCount > 1){
        $secondPageOfReviews = $reviewsAPI->getAll(2);
    }

} catch (Exception $e) {
    die($e->getMessage());
}