API/WS ressources
- • Please download the archive
- • Extract the archive and import the files as Collection and Environment
- • Now, you have to edit the environment variables to set up your own auth key and order data
<?PHP $ID_WEBSITE = "12gthd5g-erg1-hdgy-yfh5-gfdf12548vfd"; // Please fill in the ID of your website "Verified Reviews" $SECURE_KEY = "ghsyehf5-hfyd-gets-195g-hgets125dhre"; // Please fill in the Secret key of your website "Verified Reviews" $URL_AV = "http://www.avis-verifies.com/index.php"; // Use the proper URL related to your account // $URL_AV = "http://www.verified-reviews.com/index.php"; // $URL_AV = "http://www.recensioni-verificate.com/index.php"; // $URL_AV = "http://www.opinioes-verificadas.com/index.php"; // $URL_AV = "http://www.recensioni-verificate.com/index.php"; // $URL_AV = "http://www.echte-bewertungen.com/index.php"; // $URL_AV = "http://www.opiniones-verificadas.com/index.php"; /** * * Send a request * **/ echo "<br><br>== API Notification ==<br>"; $descNotification = array( 'query' => 'pushCommandeSHA1', //Required 'order_ref' => 'order-12125', //Required - Reference order 'email' => 'john@doe.com', //Required - Client email 'lastname' => 'Doe', //Required - Client lastname 'firstname' => 'John', //Required - Client firstname 'order_date' => '2015-05-17 09:39:00', //Required - Format YYYY-MM-JJ HH:MM:SS 'delay' => '0', //0=Immediately / ‘n’ days between 1 and 30 days 'PRODUCTS' => array( 0=>array( 'id_product' => 'ref001', //Required - Product Id 'name_product' => 'My Product ref001', //Required - Product Name 'url_product' => 'http://www.mywebsite.com/products/ref001.html', 'url_product_image' => 'http://www.mywebsite.com/img/products/ref001.jpg', 'GTIN_UPC' => 'GTIN_UPC', 'GTIN_EAN' => 'GTIN_EAN', 'GTIN_JAN' => 'GTIN_JAN', 'GTIN_ISBN' => 'GTIN_ISBN', 'MPN' => 'MPN', 'sku' => 'sku', 'brand_name' => 'brand_name', ), 1=>array( 'id_product' => 'ref002', //Required - Product Id 'name_product' => 'My Product ref002', //Required - Product Name ) ), 'sign' => '', ); $descNotification['sign']=SHA1($descNotification['query'].$descNotification['order_ref'].$descNotification['email'].$descNotification['lastname'].$descNotification['firstname'].$descNotification['order_date'].$descNotification['delay'].$SECURE_KEY); $encryptedNotification=http_build_query( array( 'idWebsite' => $ID_WEBSITE, 'message' => json_encode($descNotification) ) ); $postNotification = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $encryptedNotification ) ); $contextNotification = stream_context_create($postNotification); $resultNotification = file_get_contents($URL_AV.'?action=act_api_notification_sha1&type=json2', false, $contextNotification); echo $resultNotification,"<br><br>\n"; $resultNotification = json_decode($resultNotification,true); echo "==RETURN==["; echo $resultNotification['return']; echo "]<br><br>\n"; echo $resultNotification['debug']; if($resultNotification['return'] == 1) { echo "==> OK <br>"; // Success } else { echo "==> ERROR <br>"; // Error, please check the array returned } ?>
using RestSharp; using System; using System.Linq; using System.Net; using System.Security.Cryptography; using System.Text; using System.Text.Json; namespace avrequest { class Program { private const string ID_WEBSITE = "12gthd5g-erg1-hdgy-yfh5-gfdf12548vfd"; // Please fill in the ID of your website "Verified Reviews" private const string SECRET_KEY = "ghsyehf5-hfyd-gets-195g-hgets125dhre"; // Please fill in the Secret key of your website "Verified Reviews" private const string URL = "http://www.avis-verifies.com/index.php"; // Use the proper URL related to your account // $URL_AV = "http://www.verified-reviews.com/index.php"; // $URL_AV = "http://www.recensioni-verificate.com/index.php"; // $URL_AV = "http://www.opinioes-verificadas.com/index.php"; // $URL_AV = "http://www.recensioni-verificate.com/index.php"; // $URL_AV = "http://www.echte-bewertungen.com/index.php"; // $URL_AV = "http://www.opiniones-verificadas.com/index.php"; private const string QUERY = "pushCommandeSHA1"; // mark the order creation in the query public static void orderReviewQuery(string order_ref, string firstname, string lastname, string email, string order_date, string delay) { try { // Loading classes to do a query ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; var client = new RestClient(URL); var request = new RestRequest(); request.Method = Method.POST; // making the signature to authentificate the connexion string input = $"{QUERY}{order_ref}{email}{lastname}{lastname}{order_date}{delay}{SECRET_KEY}"; var hash = new SHA1Managed().ComputeHash(Encoding.UTF8.GetBytes(input)); string sign = string.Concat(hash.Select(b => b.ToString("x2"))); var product = new { id_product = "ref001", //Required - Product Id name_product = "My Product ref001", //Required - Product Name url_product = "http://www.mywebsite.com/products/ref001.html", url_product_image = "http://www.mywebsite.com/img/products/ref001.jpg", GTIN_UPC = "GTIN_UPC", GTIN_EAN = "GTIN_EAN", GTIN_JAN = "GTIN_JAN", GTIN_ISBN = "GTIN_ISBN", MPN = "MPN", sku = "sku", brand_name = "brand_name" }; var message = new { query = QUERY, //Required order_ref = order_ref, //Required - Reference order firstname = firstname, //Required - Client firstname lastname = lastname, //Required - Client lastname email = email, //Required - Client email order_date = order_date, //Required - Format YYYY-MM-JJ sign = sign, //Required delay = 0, //Required PRODUCTS = new { product } }; string jsonEncoded = JsonSerializer.Serialize(message); request.AddParameter("application/x-www-form-urlencoded", "idWebsite=" + ID_WEBSITE + "&message=" + jsonEncoded, ParameterType.RequestBody); var response = client.Execute(request); Console.WriteLine(response.Content); } catch (Exception ex) { Console.WriteLine("catch!"); Console.WriteLine(ex.ToString()); } } static void Main(string[] args) { Console.WriteLine("Hello World!"); orderReviewQuery("order-12125", "John", "Doe", "john@doe.com", "2015-05-17 09:39:00", "0"); Console.WriteLine("end!"); } } }
require "uri" require "net/http" require "json" require "digest" class AvisVerifiesService def initialize(target) @secret_key = ENV["AVIS_VERIFIES_SECURE_KEY"] @avis_verifies_url = ENV["AVIS_VERIFIES_URL"] @id_website = ENV["AVIS_VERIFIES_ID_WEBSITE"] @order_ref = target.id.to_s @first_name = target.first_name @last_name = target.last_name @email = target.email @order_date = target.created_at.strftime("%F") @query = "pushCommandeSHA1" @sign = create_sign(@query, @order_ref, @email, @last_name, @first_name, @order_date, @secret_key) end def send_message url = URI(@avis_verifies_url) http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Post.new(url) request["accept"] = "application/json" request["content-type"] = "application/x-www-form-urlencoded" request.body = URI.encode_www_form([["idWebsite", @id_website.to_s], ["message", new_message()]]) response = http.request(request) end def new_message { query: @query, order_ref: @order_ref, firstname: @first_name, lastname: @last_name, email: @email, order_date: @order_date, delay: @delay, sign: @sign, products: { "0": { id_product: "100", name_product: "My Product 100", }, }, }.to_json end private def create_sign(query, order_ref, email, last_name, first_name, order_date, secret_key) Digest::SHA1.hexdigest(query + order_ref + email + last_name + first_name + order_date + secret_key) end end
email;order_ref;order_date;delay;lastname;firstname;id_product;name_product;url_product;url_image_product;gtin_ean;sku "john@doe.com";"ABE1449293";"2016-04-11 11:39:10";"14";"DOE";"John";"KI032541449";"My Product name KI032541449";"https://www.mywebsite.com/products/KI032541449.html";"https://www.mywebsite.com/products/KI032541449.jpg";"879541565";"45155214" "john@doe.com";"ABE1449293";"2016-04-11 11:39:10";"14";"DOE";"John";"KI032541449";"My Product name PL744144";"https://www.mywebsite.com/products/PL744144.html";"https://www.mywebsite.com/products/PL744144.jpg";"478215";"965878524" "ben@carter.com";"ABE1449254";"2016-04-11 11:42:10";"14";"CARTER";"Ben";"KI032541166";"My Product name KI032541166";"https://www.mywebsite.com/products/KI032541166.html";"https://www.mywebsite.com/products/KI032541166.jpg";"546315461";"4514541"
email;order_ref;order_date;delay;lastname;firstname "john@doe.com";"ABE1449293";"2016-04-11 11:39:10";"14";"DOE";"John" "john@doe.com";"ABE1449293";"2016-04-11 11:39:10";"14";"DOE";"John" "ben@carter.com";"ABE1449254";"2016-04-11 11:42:10";"14";"CARTER";"Ben"
email;order_ref;order_date;delay;lastname;firstname;canal;id_shop;name_shop;id_product;name_product;url_product;url_image_product;gtin_ean;sku john@doe.com;ABE1449293;11/04/2016 11:39;14;DOE;John;offline;10;My Shop 10;"KI032541449""";My Product name KI032541449;https://www.mywebsite.com/products/KI032541449.html;https://www.mywebsite.com/products/KI032541449.jpg;879541565;45155214 john@doe.com;ABE1449293;11/04/2016 11:39;14;DOE;John;offline;10;My Shop 10;KI032541449;My Product name PL744144;https://www.mywebsite.com/products/PL744144.html;https://www.mywebsite.com/products/PL744144.jpg;478215;965878524 ben@carter.com;ABE1449254;11/04/2016 11:42;14;CARTER;Ben;online;;;KI032541166;My Product name KI032541166;https://www.mywebsite.com/products/KI032541166.html;https://www.mywebsite.com/products/KI032541166.jpg;546315461;4514541
email;order_ref;order_date;delay;lastname;firstname;canal;id_shop;name_shop john@doe.com;ABE1449293;11/04/2016 11:39;14;DOE;John;offline;10;My Shop 10 john@doe.com;ABE1449293;11/04/2016 11:39;14;DOE;John;offline;10;My Shop 10 ben@carter.com;ABE1449254;11/04/2016 11:42;14;CARTER;Ben;online;;
<?PHP $idWebsite = "aaa5dfqs-sdqs35f-dqsf-365f-xwvf-36543s6"; // Please fill in the ID of your website "Verified Reviews" $secretKey = "qsdf78-df8g7-54gsdf-d3sf5g4-coisdfgjpoi"; // Please fill in the Secret key of your website "Verified Reviews" $idProduct = "2ef2edab-8e40-fe74-c589-538665740278"; // Please fill the product reviews id $ip = "127.0.0.1"; // Please fill the user ip address $fingerPrint = "5q4sdf35qsd4f36"; // Please fill the user fingerPrint or user unique id $vote = 1; // Please fill the user vote (1 = yes / 0 = no) // Generating signature $sign = sha1($idWebsite.$idProduct.$ip.$secretKey); // Plateform URL $URL_AV = "http://www.avis-verifies.com/index.php"; // Use the proper URL related to your account // $URL_AV = "http://www.verified-reviews.com/index.php"; // $URL_AV = "http://www.recensioni-verificate.com/index.php"; // $URL_AV = "http://www.opinioes-verificadas.com/index.php"; // $URL_AV = "http://www.recensioni-verificate.com/index.php"; // $URL_AV = "http://www.echte-bewertungen.com/index.php"; // $URL_AV = "http://www.opiniones-verificadas.com/index.php"; /** * * Create request * **/ $parameters = array( 'method' => 'create', 'idWebsite' => $idWebsite, 'idProduct' => $idProduct, 'isHelpful' => $vote, 'ip' => $ip, 'fingerPrint' => $fingerPrint, 'sign' => $sign, ); $post = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query($parameters) ) ); $context = stream_context_create($post); $content = file_get_contents($URL_AV.'?action=act_api_product_reviews_helpful', false, $context); if (!empty($content)) { if (json_decode($content)) { $jsonContent = json_decode($content); print_r($jsonContent); // print_r result : // stdClass Object // ( // [success] => 1 // [method] => create // [idWebsite] => aaa5dfqs-sdqs35f-dqsf-365f-xwvf-36543s6 // [idProduct] => 2ef2edab-8e40-fe74-c589-538665740278 // [fingerPrint] => 5q4sdf35qsd4f36 // [isHelpful] => 1 // [isActive] => 1 // [message] => Merci, votre vote sera bientôt publié. // ) } } ?>