Please would someone be able to help point me in the right direction with this?
I am using NAV 2009 SP1 but need to GET data from an API using 'Microsoft XML, v6.0'.XMLHTTP60
The API also needs an API Key to be used and this key has been made available to me.
So far I have a codeunit which has the following global variables.
Name DataType Subtype Length
xmlHttpReq Automation 'Microsoft XML, v6.0'.XMLHTTP60
locautXmlDoc Automation 'Microsoft XML, v6.0'.DOMDocument60
XMLNode Automation 'Microsoft XML, v6.0'.IXMLDOMNode
In the codeunit I have the following code which is supposed to get the data from the API and collect the data as an XML file to be saved in a folder. It is difficult to tell whether or not any of it is working. I have used the Postman application to check the URL and it does reach the customer's API, but it cannot get through security. The codeunit runs but there is no data in the file which gets created. Also it is not clear to me whether or not the username and password parameters of the GET Action can be the inserted as I have done it, using the shop ID and the API Key. I suspect that these have to be passed through in another way?
IF ISCLEAR(locautXmlDoc) THEN
IF ISCLEAR(xmlHttpReq) THEN
, FALSE, [Shop-ID], [APIKey]);
Any feedback on this would be very welcome indeed.