On the last line 1,10 indicates start at the first record and retrieve 10 more right? How do I establish how many Inventory Items I have so that I can retrieve them all, setting a higher figure than the amount of records available displays an error.
require_once('Inventory.php'); require_once('Factory.php'); $authorization = json_decode(Factory::GetResponse("Auth/AuthorizeByApplication", "applicationId=0000&applicationSecret=0000&token=0000", "", "https://api.linnworks.net/")); $views = Inventory::GetInventoryViews($authorization->Token, "https://api.linnworks.net/"); $locations = Inventory::GetStockLocations($authorization->Token, "https://api.linnworks.net/"); $locationIds = array(); $inventoryItems = Inventory::GetInventoryItems($views,$locationIds,1,10,$authorization->Token,"https://api.linnworks.net/");If I try (which is how I interpret the documentation), then I receive an error, so I am obviously missing something fundamental
$InventoryItemsCount = Inventory::GetInventoryItemsCount(true,true,$authorization->Token,"https://api.linnworks.net/"); echo $InventoryItemsCount;
Thanks in advance for the direction and assistance
If you want to pull all of your inventory items, you can run http://apps.linnworks.net//Api/Method/Stock-GetStockItems call with empty keyword.
Here is the raw request for GetInventoryItemsCount:
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36
Authorization: YOUR TOKEN
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept-Encoding: gzip, deflate, br
Worked like a charm.