<?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 Prisma Insights API in PowerShell in Prisma Cloud Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-insights-api-in-powershell/m-p/536339#M910</link>
    <description>&lt;P&gt;Hi all - I am looking for some help. I have been asked if I can extract data using the Prisma Insights API, I have used PowerShell for this in the past for a similar thing in AppDynamics so I think it would be a good starting point for this work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have managed to get the access token and use this in the next part of the code to make the API call but I am getting the following error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Invoke-RestMethod : {"errorCode":"REST10001","message":"Unexpected server error","details":"Failed to process request"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Has anyone used PowerShell with the API or come across this error ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any advise appreciated.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Mar 2023 15:05:28 GMT</pubDate>
    <dc:creator>StephenBuist</dc:creator>
    <dc:date>2023-03-24T15:05:28Z</dc:date>
    <item>
      <title>Prisma Insights API in PowerShell</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-insights-api-in-powershell/m-p/536339#M910</link>
      <description>&lt;P&gt;Hi all - I am looking for some help. I have been asked if I can extract data using the Prisma Insights API, I have used PowerShell for this in the past for a similar thing in AppDynamics so I think it would be a good starting point for this work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have managed to get the access token and use this in the next part of the code to make the API call but I am getting the following error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Invoke-RestMethod : {"errorCode":"REST10001","message":"Unexpected server error","details":"Failed to process request"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Has anyone used PowerShell with the API or come across this error ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any advise appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 15:05:28 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-insights-api-in-powershell/m-p/536339#M910</guid>
      <dc:creator>StephenBuist</dc:creator>
      <dc:date>2023-03-24T15:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Prisma Insights API in PowerShell</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-insights-api-in-powershell/m-p/537933#M917</link>
      <description>&lt;P&gt;StephenBuist, I need a little more context in regards to what you mean by Prisma Insights API.&amp;nbsp; Please use the below links to start or send me a link to the product you are referring to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="Prisma Access Insights APIs" href="https://origin-docs.paloaltonetworks.com/prisma/prisma-access/prisma-access-insights/insights/prisma-access-insights-apis" target="_self"&gt;Prisma Access Insights APIs&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="Access an API with powershell" href="https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7.3" target="_self"&gt;Access an API with powershell&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 20:29:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-insights-api-in-powershell/m-p/537933#M917</guid>
      <dc:creator>MDavis29</dc:creator>
      <dc:date>2023-04-06T20:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Prisma Insights API in PowerShell</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-insights-api-in-powershell/m-p/538948#M924</link>
      <description>&lt;P&gt;Hi - I managed to get past the error message. The issue was that PS was not accepting the JSON payload in directly in the code. I put it in a text file and read it in to the script - this solved the issue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for responding though.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 08:13:13 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-insights-api-in-powershell/m-p/538948#M924</guid>
      <dc:creator>StephenBuist</dc:creator>
      <dc:date>2023-04-17T08:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Prisma Insights API in PowerShell</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-insights-api-in-powershell/m-p/588062#M1227</link>
      <description>&lt;P&gt;Hi Stephen,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to achieve somewhat the same, but using curl. Can you please give an example of the command line, which you used to get the data? I am stuck at the same issue, as you were. Here is my curl command, that I am using. I have put the payload in a .josn file and load it in the command:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;curl -X POST &lt;A href="https://pa-staging02.api.prismaaccess.com/api/sase/v2.0/resource/query/tunnel_status" target="_blank"&gt;https://pa-staging02.api.prismaaccess.com/api/sase/v2.0/resource/query/tunnel_status&lt;/A&gt; -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiOiJyc2Etc2lnbi1wa2NzMS0yMDQ4LXNoYTI1Ni8xIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmMGU1NjQzMi1iODkxLTRiOTItYWZmNS0xOWI5YTc3YmY0NGQiLCJjdHMiOiJPQVVUSDJfU1RBVEVMRVNTX0dSQU5UIiwiYXVkaXRUcmFja2luZ0lkIjoiOWJkMGQ1ODgtNDU4OC00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MrBoZk5MXOvIC5u1mZ4lCoNPkYCxIghHY840FQ5w6Gqh1dT1IVRWkvsfPH8fCdE7G4asy0J0P9NcIEt5Cw" -H "Prisma-Tenant:1547011937" -H "Content-Type: application/json" --data-binary @c:\temp\input.json &amp;gt;c:\temp\output.json&lt;BR /&gt;% Total % Received % Xferd Average Speed Time Time Time Current&lt;BR /&gt;Dload Upload Total Spent Left Speed&lt;BR /&gt;100 666 100 99 100 567 138 791 --:--:-- --:--:-- --:--:-- 936&lt;BR /&gt;&lt;BR /&gt;Below is the output, which I put in the output.json file:&lt;BR /&gt;{"errorCode":"REST10001","message":"Unexpected server error","details":"Failed to process request"}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Do I understand correctly, that instead of .json file, you use .txt? How do you feed the .txt in the command? Or are you saying, that you tried putting the .json load directly in the command, and then did that as me, putting it in a .json file? Your help will be much appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind Regards,&lt;/P&gt;
&lt;P&gt;KPopov&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 08:14:39 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-insights-api-in-powershell/m-p/588062#M1227</guid>
      <dc:creator>kpopov</dc:creator>
      <dc:date>2024-05-28T08:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Prisma Insights API in PowerShell</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-insights-api-in-powershell/m-p/1225703#M1456</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For anyone out there, having similar to my issue, here is the solution:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;curl&lt;/STRONG&gt; &lt;STRONG&gt;-X POST&lt;/STRONG&gt; &lt;A href="https://pa-us01.api.prismaaccess.com/api/sase/v2.0/resource/query/tunnel_status" target="_blank"&gt;https://pa-us01.api.prismaaccess.com/api/sase/v2.0/resource/query/tunnel_status&lt;/A&gt;&amp;nbsp; &lt;STRONG&gt;-H&lt;/STRONG&gt; "&lt;STRONG&gt;Authorization: Bearer&lt;/STRONG&gt; &lt;EM&gt;your long key, which you should have generated&lt;/EM&gt;" &lt;STRONG&gt;-H&lt;/STRONG&gt; &lt;EM&gt;"&lt;/EM&gt;&lt;STRONG&gt;Prisma-Tenant&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;:&lt;/STRONG&gt;123456789"&lt;/EM&gt; &lt;STRONG&gt;-H "Content-Type: application/json" -d @&lt;/STRONG&gt;c:\temp\input.json &lt;STRONG&gt;&amp;gt;&lt;/STRONG&gt; c:\temp\output.json&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 09:23:49 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-insights-api-in-powershell/m-p/1225703#M1456</guid>
      <dc:creator>kpopov</dc:creator>
      <dc:date>2025-04-04T09:23:49Z</dc:date>
    </item>
  </channel>
</rss>

