<?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 SNA API to get devices returns no data in Security Analytics</title>
    <link>https://community.cisco.com/t5/security-analytics/sna-api-to-get-devices-returns-no-data/m-p/5165595#M1095</link>
    <description>&lt;P&gt;I'm using the SNA APIs with dCloud.&amp;nbsp; When I use the following API "&lt;SPAN class=""&gt;/tenants/{tenantId}/devices" in Postman, I get the error message, "The requested resource could not be found."&amp;nbsp; It should return&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I'm not able to use any of the APIs within this branch regarding devices, interfaces, traffic, alarms, exporters, etc. because they require a device-id.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can someone explain why I'm not getting any resources returned for devices?&amp;nbsp; How do I determine what those devices are and look for them within the SNA GUI? Thanks.&lt;/P&gt;</description>
    <pubDate>Sun, 25 Aug 2024 02:23:25 GMT</pubDate>
    <dc:creator>rogersm200602</dc:creator>
    <dc:date>2024-08-25T02:23:25Z</dc:date>
    <item>
      <title>SNA API to get devices returns no data</title>
      <link>https://community.cisco.com/t5/security-analytics/sna-api-to-get-devices-returns-no-data/m-p/5165595#M1095</link>
      <description>&lt;P&gt;I'm using the SNA APIs with dCloud.&amp;nbsp; When I use the following API "&lt;SPAN class=""&gt;/tenants/{tenantId}/devices" in Postman, I get the error message, "The requested resource could not be found."&amp;nbsp; It should return&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I'm not able to use any of the APIs within this branch regarding devices, interfaces, traffic, alarms, exporters, etc. because they require a device-id.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can someone explain why I'm not getting any resources returned for devices?&amp;nbsp; How do I determine what those devices are and look for them within the SNA GUI? Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2024 02:23:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/security-analytics/sna-api-to-get-devices-returns-no-data/m-p/5165595#M1095</guid>
      <dc:creator>rogersm200602</dc:creator>
      <dc:date>2024-08-25T02:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: SNA API to get devices returns no data</title>
      <link>https://community.cisco.com/t5/security-analytics/sna-api-to-get-devices-returns-no-data/m-p/5308373#M1205</link>
      <description>&lt;P&gt;You're running into a common issue when using Cisco Secure Network Analytics (SNA) APIs — especially in dCloud environments, which often have preconfigured tenants but minimal or no data populated.&lt;/P&gt;&lt;P&gt;The key error:&lt;/P&gt;&lt;P&gt;"The requested resource could not be found"&lt;/P&gt;&lt;P&gt;…when calling:&lt;/P&gt;&lt;P&gt;GET /tenants/{tenantId}/devices&lt;/P&gt;&lt;P&gt;— indicates that either:&lt;/P&gt;&lt;P&gt;The tenant ID is invalid, or&lt;/P&gt;&lt;P&gt;The tenant exists but has no registered devices, or&lt;/P&gt;&lt;P&gt;You’re using an incorrect base URL or token scope&lt;/P&gt;&lt;P&gt;Let’s walk through a clear troubleshooting path to help you get valid device data from the API.&lt;/P&gt;&lt;P&gt;Step-by-Step Troubleshooting&lt;BR /&gt;1. Verify Tenant ID Is Correct and Exists&lt;BR /&gt;First, confirm you're using a valid tenant ID.&lt;/P&gt;&lt;P&gt;Use this API to list available tenants:&lt;/P&gt;&lt;P&gt;http&lt;BR /&gt;Copy&lt;BR /&gt;Edit&lt;BR /&gt;GET /tenants&lt;BR /&gt;This returns an array of tenants like:&lt;/P&gt;&lt;P&gt;json&lt;BR /&gt;Copy&lt;BR /&gt;Edit&lt;BR /&gt;[&lt;BR /&gt;{&lt;BR /&gt;"id": "a1b2c3d4-e5f6-7890-abcd-1234567890ab",&lt;BR /&gt;"name": "DefaultTenant"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;Make sure the tenantId you're using is the correct one from this list.&lt;/P&gt;&lt;P&gt;2. Verify Devices Exist for That Tenant&lt;BR /&gt;If the /devices endpoint under a valid tenant returns nothing or 404, it means:&lt;/P&gt;&lt;P&gt;The tenant has no visible or registered exporters, flow sources, or monitored entities&lt;/P&gt;&lt;P&gt;This is very common in dCloud labs if no data or traffic is actively flowing&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;h&lt;BR /&gt;Copy&lt;BR /&gt;Edit&lt;BR /&gt;GET /tenants/{tenantId}/devices&lt;BR /&gt;If it still fails:&lt;/P&gt;&lt;P&gt;Make sure you are using a valid Bearer token&lt;/P&gt;&lt;P&gt;Use Accept: application/json headers in Postman&lt;/P&gt;&lt;P&gt;3. Check the SNA GUI for Devices&lt;BR /&gt;In the SNA Web UI (Stealthwatch GUI):&lt;/P&gt;&lt;P&gt;Log in to the WebUI of the SNA Manager (SMC)&lt;/P&gt;&lt;P&gt;Go to:&lt;/P&gt;&lt;P&gt;Hosts &amp;gt; Host Groups – See if any host IPs are classified&lt;/P&gt;&lt;P&gt;Analysis &amp;gt; Flows – See if any data is visible&lt;/P&gt;&lt;P&gt;Integration &amp;gt; Flow Sources or System &amp;gt; Data Sources – to view exporters/devices&lt;/P&gt;&lt;P&gt;Search for NetFlow exporters / flow sensors – these are the "devices" exposed by the API&lt;/P&gt;&lt;P&gt;If no exporters are configured or no traffic is flowing, the API will not return any devices.&lt;/P&gt;&lt;P&gt;4. Alternative: Use /flows or /hostgroups&lt;BR /&gt;If devices aren't working due to empty cluster or lab setup, try endpoints that don’t depend on exporter device IDs:&lt;/P&gt;&lt;P&gt;GET /tenants/{tenantId}/hostgroups&lt;/P&gt;&lt;P&gt;GET /tenants/{tenantId}/flows&lt;/P&gt;&lt;P&gt;GET /tenants/{tenantId}/alarms&lt;/P&gt;&lt;P&gt;Note: These will still return empty arrays if there’s no live data in the lab.&lt;/P&gt;&lt;P&gt;Extra: Sample API Path Setup&lt;BR /&gt;If you're using dCloud, make sure your API environment is set up like this:&lt;/P&gt;&lt;P&gt;Base URL:&lt;BR /&gt;https://&amp;lt;dcloud-sna-host&amp;gt;/sw-reporting/v2&lt;/P&gt;&lt;P&gt;Example working call:&lt;/P&gt;&lt;P&gt;http&lt;BR /&gt;Copy&lt;BR /&gt;Edit&lt;BR /&gt;GET /sw-reporting/v2/tenants&lt;BR /&gt;Authorization: Bearer &amp;lt;token&amp;gt;&lt;BR /&gt;Accept: application/json&lt;BR /&gt;Then use:&lt;/P&gt;&lt;P&gt;http&lt;BR /&gt;Copy&lt;BR /&gt;Edit&lt;BR /&gt;GET /sw-reporting/v2/tenants/{tenantId}/devices&lt;BR /&gt;Summary&lt;BR /&gt;Cause Fix&lt;BR /&gt;Wrong or empty tenant ID Use GET /tenants to confirm valid ID&lt;BR /&gt;No devices registered in dCloud lab Check GUI under Data Sources / Flow Exporters&lt;BR /&gt;No data flowing = no devices populated Trigger simulated flows or check lab setup&lt;BR /&gt;Incorrect API base URL or auth token Ensure /sw-reporting/v2/ base path is correct&lt;/P&gt;&lt;P&gt;Next Step&lt;BR /&gt;Check the output of:&lt;/P&gt;&lt;P&gt;http&lt;BR /&gt;Copy&lt;BR /&gt;Edit&lt;BR /&gt;GET /tenants&lt;BR /&gt;And send back the result or tenantId you're using — I can help verify if it's valid and what next endpoints to try based on that.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2025 16:00:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/security-analytics/sna-api-to-get-devices-returns-no-data/m-p/5308373#M1205</guid>
      <dc:creator>wajidhassan</dc:creator>
      <dc:date>2025-07-11T16:00:03Z</dc:date>
    </item>
  </channel>
</rss>

