This is the api: https://api.itemmaster.com/v2/api but I don't know write the curl code to get the item with UPC: 00040000006039 Where I have to add username and password ?
PHP - Search for item by UPC code in Itemmaster.com
303 Views Asked by Bogdan Bogdanov At
2
There are 2 best solutions below
2

I would suggest using Guzzle: http://guzzle.readthedocs.org/en/latest/
The code looks something like this:
$client = new Client([
// Base URI is used with relative requests
'base_uri' => 'https://api.itemmaster.com/v2/',
// Set username and password in the header here
'headers' => ['username' => 'user_name', 'password' => 'thePassword']
]);
$response = $client->get('item',
[
'query' => ['idx' => '0','upc' => '00040000006039']
]);
CURL with along with username and password and set as HTTP Header parameters as per API Documentation.
change you credentials below for XXXX