Your IP : 216.73.217.13


Current Path : /var/www/magento.test.indacotrentino.com/www/scripts/import/OLD/test/
Upload File :
Current File : /var/www/magento.test.indacotrentino.com/www/scripts/import/OLD/test/test.ExternalSearch.php

<?php
$username = 'admin';
$password = 'admin123'; //'Inda_987';
$host = 'http://indaco.38121.it';

$username = 'admin';
$password = 'Inda_987';
$host = 'http://indaco2.38121.it';

$username = 'admin';
$password = 'Inda_987';
$host = 'http://magento.test.indaco.store';

$userData = ["username" => $username, "password" => $password];
$ch = curl_init($host . "/rest/V1/integration/admin/token");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($userData));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Content-Lenght: " . strlen(json_encode($userData))));

$token = curl_exec($ch);
$token = str_ireplace('"', '', $token);

var_dump($token);

$ch = curl_init($host . "/rest/V1/orders?searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bfield%5D=status&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bvalue%5D=new%2Cprocessing%2Cpending_payment%2Cfraud%2Cpayment_review%2Cpending%2Cholded%2Cclosed%2Ccanceled%2Cpaypal_canceled_reversal%2Cpending_paypal%2Cpaypal_reversed&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bcondition_type%5D=in&searchCriteria%5Bfilter_groups%5D%5B1%5D%5Bfilters%5D%5B0%5D%5Bfield%5D=state&searchCriteria%5Bfilter_groups%5D%5B1%5D%5Bfilters%5D%5B0%5D%5Bvalue%5D=new%2Cprocessing%2Cpending_payment&searchCriteria%5Bfilter_groups%5D%5B1%5D%5Bfilters%5D%5B0%5D%5Bcondition_type%5D=in");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); // Request method
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Bearer " . $token ));

$result = curl_exec($ch);

$result = json_decode($result, 1);
echo '<pre>';print_r($result);