<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic SD-WAN API Calls from Excel VBA failing in DevNet Sandbox</title>
    <link>https://community.cisco.com/t5/devnet-sandbox/sd-wan-api-calls-from-excel-vba-failing/m-p/5256714#M10897</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am working on a tool that is built on/in an Excel Workbook - and would like to pull data directly from vManage via API.&amp;nbsp; I am able to get authenticated via Postman however when I attempt to pull from inside an Excel Workbook (using VBA) i am unable to successfully get a response (to the initial Post) so I never get a Cookie (and so I truly am not even in the game yet)......&lt;/P&gt;
&lt;P&gt;After I send the POST -- I get a run-time error -- 2146697208 (800c0008) and a description that states "The download of the specified resource has failed"&lt;/P&gt;
&lt;P&gt;I get no response from the API Call.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am curious if anyone has successfully written code to interact with the vManage API using Visual Basic or more specifically a macro-enabled workbook with VBA Code to pull data via the API.&lt;/P&gt;
&lt;P&gt;As a tangent - this working using the Meraki API but the authentication is ENTIRELY different.....&lt;/P&gt;
&lt;P&gt;Thanks in advance for any info&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Feb 2025 19:43:07 GMT</pubDate>
    <dc:creator>ROBERT STEVENS</dc:creator>
    <dc:date>2025-02-04T19:43:07Z</dc:date>
    <item>
      <title>SD-WAN API Calls from Excel VBA failing</title>
      <link>https://community.cisco.com/t5/devnet-sandbox/sd-wan-api-calls-from-excel-vba-failing/m-p/5256714#M10897</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am working on a tool that is built on/in an Excel Workbook - and would like to pull data directly from vManage via API.&amp;nbsp; I am able to get authenticated via Postman however when I attempt to pull from inside an Excel Workbook (using VBA) i am unable to successfully get a response (to the initial Post) so I never get a Cookie (and so I truly am not even in the game yet)......&lt;/P&gt;
&lt;P&gt;After I send the POST -- I get a run-time error -- 2146697208 (800c0008) and a description that states "The download of the specified resource has failed"&lt;/P&gt;
&lt;P&gt;I get no response from the API Call.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am curious if anyone has successfully written code to interact with the vManage API using Visual Basic or more specifically a macro-enabled workbook with VBA Code to pull data via the API.&lt;/P&gt;
&lt;P&gt;As a tangent - this working using the Meraki API but the authentication is ENTIRELY different.....&lt;/P&gt;
&lt;P&gt;Thanks in advance for any info&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2025 19:43:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-sandbox/sd-wan-api-calls-from-excel-vba-failing/m-p/5256714#M10897</guid>
      <dc:creator>ROBERT STEVENS</dc:creator>
      <dc:date>2025-02-04T19:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: SD-WAN API Calls from Excel VBA failing</title>
      <link>https://community.cisco.com/t5/devnet-sandbox/sd-wan-api-calls-from-excel-vba-failing/m-p/5257068#M10900</link>
      <description>&lt;P&gt;This is very interesting, this error a very strange one, normally this mean&amp;nbsp;that there was an issue with the download of the resources, which could be due to a few things such as network issues, incorrect URL, or issues with the server.&lt;/P&gt;
&lt;P&gt;What are you using for request set up&amp;nbsp;&lt;SPAN&gt;WinHttp.WinHttpRequest or&amp;nbsp;XMLHTTP? Can you share your code?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 09:50:26 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-sandbox/sd-wan-api-calls-from-excel-vba-failing/m-p/5257068#M10900</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2025-02-05T09:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: SD-WAN API Calls from Excel VBA failing</title>
      <link>https://community.cisco.com/t5/devnet-sandbox/sd-wan-api-calls-from-excel-vba-failing/m-p/5257190#M10902</link>
      <description>&lt;P&gt;Hi -- sure am happy to share -- note that it looks like I have it working now...&amp;nbsp; &amp;nbsp;I dont know WHY but - my original code was using&amp;nbsp;MSXML2.XMLHTTP.&amp;nbsp; After reading your response I started toying with&amp;nbsp;WinHttp.WinHttpRequest.5.1.&amp;nbsp; I will admit I truly dont know the differences between the two object types - but switching to&amp;nbsp;WinHttp.WinHttpRequest.5.1 looks to have done the trick...&amp;nbsp; &amp;nbsp;I will post the code that appears to be working instead of what was NOT working...&amp;nbsp; &amp;nbsp;The only significant difference was the use of the other object type.....&lt;/P&gt;
&lt;P&gt;Two things to note - the funky URL is because I am currently using this to talk to a lab environment built in CML....&amp;nbsp; Once i have everything setup and working as expected, I'll talk to our production vmanage...&amp;nbsp; Also - when I switched to the new object, I stopped getting the other error but got a message about bad cert -- so you will see I am setting up to ignore the cert error (.option(4) = &amp;amp;H3300)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Appreciate your help....&amp;nbsp; &amp;nbsp;May come back later if i find more issues, but for now I am on the right track...&lt;/P&gt;
&lt;P&gt;--&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sub test()&lt;BR /&gt;Dim http As Object&lt;BR /&gt;Dim url As String&lt;BR /&gt;Dim username As String&lt;BR /&gt;Dim password As String&lt;BR /&gt;Dim jsonBody As String&lt;BR /&gt;Dim response As String&lt;BR /&gt;Dim token As String&lt;BR /&gt;&lt;BR /&gt;' Initialize variables&lt;BR /&gt;url = "&lt;A href="https://127.0.0.1:8443/j_security_check" target="_blank"&gt;https://127.0.0.1:8443/j_security_check&lt;/A&gt;"&lt;BR /&gt;username = "xxxx"&lt;BR /&gt;password = "yyyy"&lt;BR /&gt;&lt;BR /&gt;' Create JSON body for the request&lt;BR /&gt;jsonBody = "j_username=" &amp;amp; username &amp;amp; "&amp;amp;j_password=" &amp;amp; password&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;' Create the HTTP object&lt;BR /&gt;Set http = CreateObject("WinHttp.WinHttpRequest.5.1")&lt;BR /&gt;&lt;BR /&gt;' Send the POST request&lt;BR /&gt;With http&lt;BR /&gt;.Open "POST", url, False&lt;BR /&gt;.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"&lt;BR /&gt;.Option(4) = &amp;amp;H3300&lt;BR /&gt;.send jsonBody&lt;BR /&gt;'response = .responseText&lt;BR /&gt;&lt;BR /&gt;If .Status = 200 Then&lt;BR /&gt;' Extract the token from the response headers&lt;BR /&gt;token = http.getResponseHeader("Set-Cookie")&lt;BR /&gt;MsgBox "Authentication successful! Token: " &amp;amp; token&lt;BR /&gt;Else&lt;BR /&gt;MsgBox "Authentication failed. Status: " &amp;amp; http.Status &amp;amp; " Response: " &amp;amp; response&lt;BR /&gt;End If&lt;BR /&gt;'&lt;BR /&gt;End With&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 16:34:13 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-sandbox/sd-wan-api-calls-from-excel-vba-failing/m-p/5257190#M10902</guid>
      <dc:creator>ROBERT STEVENS</dc:creator>
      <dc:date>2025-02-05T16:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: SD-WAN API Calls from Excel VBA failing</title>
      <link>https://community.cisco.com/t5/devnet-sandbox/sd-wan-api-calls-from-excel-vba-failing/m-p/5257200#M10903</link>
      <description>&lt;P&gt;Amazing, happy to help here. I am not an expert on this stuff, but recalled in the grey matter of my mind someone once saying the&amp;nbsp;&lt;SPAN&gt;WinHttp.WinHttpRequest&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;object is more robust for handling API requests compared to XMLHTTP, not something i have played with to comment more, but if its now working yipee right!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 16:46:38 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-sandbox/sd-wan-api-calls-from-excel-vba-failing/m-p/5257200#M10903</guid>
      <dc:creator>bigevilbeard</dc:creator>
      <dc:date>2025-02-05T16:46:38Z</dc:date>
    </item>
  </channel>
</rss>

