<?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 Re: DNA API - Add Network-Device Troubleshooting in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/dna-api-add-network-device-troubleshooting/m-p/4563250#M8964</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1317328"&gt;@korey_oehlers&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I&amp;nbsp; justing looking at your code in VS Code to debug. Is 'server' global or provided somewhere else in this file? It's not included in the parameters like 'token' and 'device' are.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other than that, it looks good to me.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2022 18:01:41 GMT</pubDate>
    <dc:creator>Alexander Stevenson</dc:creator>
    <dc:date>2022-03-03T18:01:41Z</dc:date>
    <item>
      <title>DNA API - Add Network-Device Troubleshooting</title>
      <link>https://community.cisco.com/t5/network-platform-api/dna-api-add-network-device-troubleshooting/m-p/4558329#M8963</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having trouble adding devices to DNA with the API.&amp;nbsp; I've read the documentation (&lt;A href="https://developer.cisco.com/docs/dna-center/#!add-device-1" target="_blank"&gt;Cisco DevNet: APIs, SDKs, Sandbox, and Community for Cisco Developers&lt;/A&gt;), but can't tell what's wrong. When I try my python method &lt;SPAN&gt;I get this non descript error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;'errorCode': 'Bad request', 'message': 'Invalid input request', 'detail': 'There was an error processing the input arguments.'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anywhere I can look to find a better error message?&amp;nbsp; Here is my python method:&lt;/P&gt;&lt;PRE&gt;def add_dna_device(token, device):

&amp;nbsp; &amp;nbsp; url = f'https://{server}/dna/intent/api/v1/network-device'

&amp;nbsp; &amp;nbsp; headers = {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Content-Type": "application/json",
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "X-Auth-Token": f"{token}"
&amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; payload = {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "type": "NETWORK_DEVICE",
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "cliTransport": "ssh2",
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "ipAddress": [ f"{device}" ],
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "snmpVersion": "2c",
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "snmpROCommunity": "test",
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "snmpRWCommunity": "test",
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "snmpRetry": 3,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "snmpTimeout": 5,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "userName": "test",
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "password": "test",
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "enablePassword": "test"
&amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; response = requests.post(url, headers=headers, data=payload, verify=False)

&amp;nbsp; &amp;nbsp; return response.json()['response']&lt;/PRE&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I've tried using more of the variables in the payload, but can't find a combination that works.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks for your time!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Feb 2022 19:52:37 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/dna-api-add-network-device-troubleshooting/m-p/4558329#M8963</guid>
      <dc:creator>korey_oehlers</dc:creator>
      <dc:date>2022-02-23T19:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: DNA API - Add Network-Device Troubleshooting</title>
      <link>https://community.cisco.com/t5/network-platform-api/dna-api-add-network-device-troubleshooting/m-p/4563250#M8964</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1317328"&gt;@korey_oehlers&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I&amp;nbsp; justing looking at your code in VS Code to debug. Is 'server' global or provided somewhere else in this file? It's not included in the parameters like 'token' and 'device' are.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other than that, it looks good to me.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 18:01:41 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/dna-api-add-network-device-troubleshooting/m-p/4563250#M8964</guid>
      <dc:creator>Alexander Stevenson</dc:creator>
      <dc:date>2022-03-03T18:01:41Z</dc:date>
    </item>
  </channel>
</rss>

