var getLinnOrders = function(TOKEN, ods, ds){ return new Promise(function(resolve){ var LinnServer = sessionStorage.getItem("LinnServer"); var url = LinnServer+"//api/ProcessedOrders/SearchProcessedOrdersPaged"; var method = "POST"; var postData = "from="+ods+"&to="+ds+"&dateType=2&exactMatch=false&&pageNum=1&numEntriesPerPage=200"; var async = true; var request = new XMLHttpRequest(); request.onload = function () { var items = JSON.parse(request.response); var data = items.Data resolve(data); } } request.open(method, url, async); request.setRequestHeader("Authorization", TOKEN); request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); request.setRequestHeader("Accept", "application/json, text/javascript, */*; q=0.01"); request.send(postData); }) }
variable wise, ods and ds are date stamps, TOKEN is the Linnworks auth token and Linnserver is the variable i use for the cached server address you get when you auth.
As per the post data, this will return a maximum of 200 results, if you have more orders per day you'll need to create a loop to grab the extra pages.
Mark Potter
Just a quick question, is there anyway to pull manifest information through the API into an application.
Working with the API documentation I've managed to pull in and work with processed orders but i wanted to know if there was a way to query the time at which a manifest was filed the previous day (that or a way to pull in the whole manifest).