<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;">
I don't know much about API, in fact, almost nothing. I used Google POSTMAN to make a POST request to extract some data from Adaptive Insights. What I would like to do is execute the call from Excel VBA and update an Excel sheet when I need by pressing a button.
Here is the snippet from POSTMAN:
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;"> POST /api/v13 HTTP/1.1
Host: api.adaptiveinsights.com
Authorization: Basic ZmlubWdyX3NhbGVzQHN0ZW1jZWxsLmNvbTpBZGFwdGl2ZTE=
Content-Type: application/xml
cache -Control: no -cache
Postman-Token:650bd3ad-82e9-aa33-ae77-ee4d89ff0fd8
<!--?</font-->xml version='1.0' encoding='UTF-8'?>
<call method="exportData" callerName="Export.xlsx">
<credentials login="******@****.com" password="*****"/>
<version name="FY2017-November V2" isDefault="false"/>
<format useInternalCodes="true" includeUnmappedItems="false"/>
<filters>
<timeSpan start="Jan-2017"end="Feb-2017"/><!--</font-->filters>
<rules includeZeroRows="false" includeRollups="true" markInvalidValues="false" markBlanks="false"
timeRollups="single">
<!--</font-->rules>
<!--</font-->call>
</code>
Here is the output from POSTMAN
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;"><!--?</font-->xml version="1.0" encoding="UTF-8"?>
<response success="true">
<output><!--[</font-->CDATA[Account Name,Account Code,Level Name,Rollup
.......................................................
</code>I did a fair bit of googling and this is what I have so far for my macro:
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;"> myURL ="https://api.adaptiveinsights.com/api/v13"
xmlHTTP.Open "POST", myURL,False
xmlHTTP.SetCredentials "****@****.com","*****", HTTPREQUEST_SETCREDENTIALS_FOR_SERVER
xmlHTTP.SetRequestHeader "Content-Type","application/xml"
xmlHTTP.Send
Set xmlResult =New MSXML2.DOMDocument
xmlResult.LoadXML xmlHTTP.ResponseText
</code>What I'm struggling is how to extract that specific set of data - "FY2017-November V2" for timeSpan start ="Jan-2017" end="Feb-2017". How do I load the data into Excel, in essence, do in VBA what I did in POSTMAN?
Would really appreciate any help.
Thank you
Valglad
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;">
</code></code>
I don't know much about API, in fact, almost nothing. I used Google POSTMAN to make a POST request to extract some data from Adaptive Insights. What I would like to do is execute the call from Excel VBA and update an Excel sheet when I need by pressing a button.
Here is the snippet from POSTMAN:
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;"> POST /api/v13 HTTP/1.1
Host: api.adaptiveinsights.com
Authorization: Basic ZmlubWdyX3NhbGVzQHN0ZW1jZWxsLmNvbTpBZGFwdGl2ZTE=
Content-Type: application/xml
cache -Control: no -cache
Postman-Token:650bd3ad-82e9-aa33-ae77-ee4d89ff0fd8
<!--?</font-->xml version='1.0' encoding='UTF-8'?>
<call method="exportData" callerName="Export.xlsx">
<credentials login="******@****.com" password="*****"/>
<version name="FY2017-November V2" isDefault="false"/>
<format useInternalCodes="true" includeUnmappedItems="false"/>
<filters>
<timeSpan start="Jan-2017"end="Feb-2017"/><!--</font-->filters>
<rules includeZeroRows="false" includeRollups="true" markInvalidValues="false" markBlanks="false"
timeRollups="single">
<!--</font-->rules>
<!--</font-->call>
</code>
Here is the output from POSTMAN
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;"><!--?</font-->xml version="1.0" encoding="UTF-8"?>
<response success="true">
<output><!--[</font-->CDATA[Account Name,Account Code,Level Name,Rollup
.......................................................
</code>I did a fair bit of googling and this is what I have so far for my macro:
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;"> myURL ="https://api.adaptiveinsights.com/api/v13"
xmlHTTP.Open "POST", myURL,False
xmlHTTP.SetCredentials "****@****.com","*****", HTTPREQUEST_SETCREDENTIALS_FOR_SERVER
xmlHTTP.SetRequestHeader "Content-Type","application/xml"
xmlHTTP.Send
Set xmlResult =New MSXML2.DOMDocument
xmlResult.LoadXML xmlHTTP.ResponseText
</code>What I'm struggling is how to extract that specific set of data - "FY2017-November V2" for timeSpan start ="Jan-2017" end="Feb-2017". How do I load the data into Excel, in essence, do in VBA what I did in POSTMAN?
Would really appreciate any help.
Thank you
Valglad
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;">
</code></code>