PHP code example of eosvn / a2reviews-client-api
1. Go to this page and download the library: Download eosvn/a2reviews-client-api 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/ */
eosvn / a2reviews-client-api example snippets
view = new EOSVN\A2ReviewsClient\A2ReviewsClient([
'api_key' => '{A2Review_API_Key}',
'api_secret' => '{A2Review_API_Secret}',
]);
$response = $a2Review->review->getProductReviews([
'handle' => '{product_handle}',
'limit' => 2 // Number record per page
]);
$response = $a2Review->review->getFeatureReviews([
'limit' => 2
]);
$response = $a2Review->review->getBlockListReviews([
'limit' => 2
]);
$response = $a2Review->review->getBlockReviews([
'limit' => 2
]);
$response = $a2Review->review->addReviewToProduct([
'handle' => '{product_handle}',
'review' => [
'rating' => 4,
'title' => 'Package title review.',
'author' => 'Author name',
'email' => '[email protected] ',
'content' => 'Package content review.'
]
]);
$response = $a2Review->review->updateReview([
'id' => '{review_id}',
'handle' => '{product_handle}',
'review' => [
'rating' => 2,
'title' => 'Package title review (update).',
'author' => 'Author name',
'email' => '[email protected] ',
'content' => 'Package content review.'
]
]);
$response = $a2Review->review->updateImageReview([
'id' => '{review_id}',
'handle' => '{product_handle}',
'image' => [
'attachment' => '{image data base64}',
'filename' => '{filename}'
]
]);
$response = $a2Review->setting->getGlobalSettings();
$response = $a2Review->setting->getReviewLanguages();
$response = $a2Review->setting->getQuestionAnswerLanguages();
$response = $a2Review->setting->getCommonLanguages();
$response->getData();