- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
10-04-2024 09:19 AM
I am just starting out and learning automation. I am using PAN OS 10.2 on PA 820 lab device. When I try to use a use the GET Method to query addresses, the restapi-doc shows: https://10.x.x.x/restapi/v10.2/Objects/Addresses .
I don’t see the “"Invalid Query Parameter: key". Could it be that my API key is bad or invalid? Below is my curl command I was using
curl -k -X GET "https://10.x.x.x.x/restapi/v10.2/Objects/Addresseslocation=vsys&vsys=vsys1&key=LUF7************==" | jq
I have attached the output response.
Thanks
-Amin
10-04-2024 09:27 AM
You won't use &key= with the REST API like you can with the XML API. With REST you're forced to actually use the X-PAN-KEY:<key> header for authentication.
10-04-2024 09:27 AM
You won't use &key= with the REST API like you can with the XML API. With REST you're forced to actually use the X-PAN-KEY:<key> header for authentication.
10-05-2024 06:00 AM
Thank you Bpry, your recommendation the curl command worked, I had to adjust the space in front of X-PAN-KEY parameter. I am taking Udemy course and the instructor is using 9.0 code for the class.
Someone sent me this usage guide on PanOS and Panorama for working with objects: https://docs.paloaltonetworks.com/pan-os/10-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-a...
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!