<?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: Cisco Umbrella Reporting v2 API Unauthorized Access Python in Cloud Edge</title>
    <link>https://community.cisco.com/t5/cloud-edge/cisco-umbrella-reporting-v2-api-unauthorized-access-python/m-p/4619401#M32</link>
    <description>&lt;P&gt;Your timing is good, I had just pulled all of the code in to run it against my lab environment to hopefully find the issue.&amp;nbsp; Glad you're up and running.&lt;/P&gt;</description>
    <pubDate>Fri, 27 May 2022 16:54:40 GMT</pubDate>
    <dc:creator>Brian Sak</dc:creator>
    <dc:date>2022-05-27T16:54:40Z</dc:date>
    <item>
      <title>Cisco Umbrella Reporting v2 API Unauthorized Access Python</title>
      <link>https://community.cisco.com/t5/cloud-edge/cisco-umbrella-reporting-v2-api-unauthorized-access-python/m-p/4528560#M11</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been trying to fetch our Cisco Umbrella logs using the Reporting v2 API but unsuccessful to do so, I always get a&amp;nbsp;b'{"meta":{},"data":{"error":"unauthorized"}}' error message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been successful in getting our data using Cisco Devnet's online GUI-based test tool (Which can be found here:&amp;nbsp;&lt;A href="https://developer.cisco.com/docs/cloud-security/?_ga=2.225835218.917962487.1641766486-616012252.1641766486#!activity-all" target="_blank"&gt;https://developer.cisco.com/docs/cloud-security/?_ga=2.225835218.917962487.1641766486-616012252.1641766486#!activity-all&lt;/A&gt;) so I don't think it's an issue with the client and secret token or bearer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the code, I used the Python template provided in the knowledge base in the link above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additional notes is that using the tool above, fetching the data only works if "Proxy" mode is enabled (Configuration - Use Proxy)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jan 2022 23:42:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/cloud-edge/cisco-umbrella-reporting-v2-api-unauthorized-access-python/m-p/4528560#M11</guid>
      <dc:creator>igarcia012</dc:creator>
      <dc:date>2022-01-09T23:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco Umbrella Reporting v2 API Unauthorized Access Python</title>
      <link>https://community.cisco.com/t5/cloud-edge/cisco-umbrella-reporting-v2-api-unauthorized-access-python/m-p/4532276#M12</link>
      <description>&lt;P&gt;I was able to get this to work using the code samples provided &lt;A href="https://github.com/CiscoDevNet/cloud-security/blob/master/Umbrella/client-samples/python/README.md" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp; I used my Reporting API credentials which in turn created a bearer token that is used in the header of the request.&amp;nbsp; My API call to the reporting API is provided below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;import requests
url = "https://reports.api.umbrella.com/v2/organizations/{org id}/activity?from=-14days&amp;amp;to=now&amp;amp;limit=1&amp;amp;offset=0"

payload={}
headers = {
  'Authorization': 'Bearer {token}'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jan 2022 16:35:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/cloud-edge/cisco-umbrella-reporting-v2-api-unauthorized-access-python/m-p/4532276#M12</guid>
      <dc:creator>Brian Sak</dc:creator>
      <dc:date>2022-01-16T16:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco Umbrella Reporting v2 API Unauthorized Access Python</title>
      <link>https://community.cisco.com/t5/cloud-edge/cisco-umbrella-reporting-v2-api-unauthorized-access-python/m-p/4618778#M30</link>
      <description>&lt;P&gt;This code did not work for me in Python . I've tried the both 'bearer' and 'basic' in the authorization header. It also failed in the Cisco DevNet environment. Both instances return the &lt;SPAN&gt;b'{"meta":{},"data":{"error":"unauthorized"}}' error message.&amp;nbsp;&lt;/SPAN&gt;Is there a setting in Umbrella itself that has to be configured to allow API calls?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 19:20:31 GMT</pubDate>
      <guid>https://community.cisco.com/t5/cloud-edge/cisco-umbrella-reporting-v2-api-unauthorized-access-python/m-p/4618778#M30</guid>
      <dc:creator>fittedsheet</dc:creator>
      <dc:date>2022-05-26T19:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco Umbrella Reporting v2 API Unauthorized Access Python</title>
      <link>https://community.cisco.com/t5/cloud-edge/cisco-umbrella-reporting-v2-api-unauthorized-access-python/m-p/4619364#M31</link>
      <description>&lt;P&gt;Please disregard this question. I was trying to pass the API key in place of the token. User error on my part.&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 15:12:50 GMT</pubDate>
      <guid>https://community.cisco.com/t5/cloud-edge/cisco-umbrella-reporting-v2-api-unauthorized-access-python/m-p/4619364#M31</guid>
      <dc:creator>fittedsheet</dc:creator>
      <dc:date>2022-05-27T15:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco Umbrella Reporting v2 API Unauthorized Access Python</title>
      <link>https://community.cisco.com/t5/cloud-edge/cisco-umbrella-reporting-v2-api-unauthorized-access-python/m-p/4619401#M32</link>
      <description>&lt;P&gt;Your timing is good, I had just pulled all of the code in to run it against my lab environment to hopefully find the issue.&amp;nbsp; Glad you're up and running.&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 16:54:40 GMT</pubDate>
      <guid>https://community.cisco.com/t5/cloud-edge/cisco-umbrella-reporting-v2-api-unauthorized-access-python/m-p/4619401#M32</guid>
      <dc:creator>Brian Sak</dc:creator>
      <dc:date>2022-05-27T16:54:40Z</dc:date>
    </item>
  </channel>
</rss>

