I am successfully done with the authorization of Walmart API. after that I am trying to updating the inventory feed using their API. I make a call and API is responding 200(OK) responses with FEED ID.
I tried with POSTMAN, and it's working pretty well but having an issue with my code.
Here is my code.
var data = {
"file": "<InventoryFeed xmlns=\"
http://walmart.com/\">\n <InventoryHeader>\n <version>1.4</version>\n </InventoryHeader>\n <inventory>\n <sku>JW00726</sku>\n <quantity>\n <unit>EACH</unit>\n <amount>25</amount>\n </quantity>\n </inventory>\n <inventory>\n <sku>JW00663</sku>\n <quantity>\n <unit>EACH</unit>\n <amount>20</amount>\n </quantity>\n </inventory>\n</InventoryFeed>\n"
};
var options = {
"method" : "POST",
"headers": {
"Authorization": "Basic "+Global_Auth,
"WM_QOS.CORRELATION_ID": Global_CORRELATION_ID,
"WM_SEC.ACCESS_TOKEN":GetAccessToken(),
"WM_CONSUMER.CHANNEL.TYPE": "#",
"Accept": "application/json",
"mimeType": "multipart/form-data",
"Content-Type": "application/x-www-form-urlencoded"
},
"payload" : data,
"muteHttpExceptions" : true
};
var response = UrlFetchApp.fetch(url, options);
var res = JSON.parse(response.getContentText());
If you guy's already done with this, please your code for reference. or if you need any more information regarding this please let me know anytime.
Thank You!
Jaimin