Access Endpoint of "Get Data by Barcode" which was created on example "Manage Item by Barcode by using Camera on Web Browser" by PHP.
Create based on a sample code on Endpoint page
<?php $ch = curl_init(); <From here, copy from Template>
curl_setopt_array($ch, array(
CURLOPT_URL => "https://dbaassandbox.matsuesoft.co.jp/matsue_yeivxx5azxpurhwb2bvbspss1yk3bm2j/proxyserver-AssetInfo-GetSpecificAssetByBarcode.php",
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
CURLOPT_POSTFIELDS => json_encode(array(
"TOKEN"=> "AvJJNtJWRvzhqFGB5FLcIQQga6JOzOV6",
"param_AssetInfo_Barcode_where"=> "9784845623556" ← Specify Barcode to get data
)),
CURLOPT_RETURNTRANSFER => true
));
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($http_code != 200) {
// Error Occured
} else {
// Success
$json_response = json_decode($response);
if ($json_response->_status == "OK") { <Until here, copy from Template>
↓Add from here if ($json_response->Result) {
print "Result - Item Name: " . $json_response->Result->ItemName . "\n"; ← Display Result
print "Result - Description: " . $json_response->Result->Description . "\n"; ← Display Result
print "Result - Barcode: " . $json_response->Result->Barcode . "\n"; ← Display Result
} else {
print "No Item matched\n";
}
↑Add until here } else { <From here, copy from Template>
print "Error! Result: " . $json_response->_status . " : " . $json_response->Message . "\n";
}
} <Until here, copy from Template> ?>
After execute, result will be displayed as below:
Result - Item Name: DEF Travel Book
Result - Description: This is DEF...
Result - Barcode: 9784845623556
※Need CURL module of php to execute sample. In case of Windows, you may need to setup regarding to SSL to execute curl function.
This is our Development Framework and Cloud Database
© 2016-2023 Matsuesoft Corporation