PAN OS REST API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

PAN OS REST API

L2 Linker

 

 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

1 accepted solution

Accepted Solutions

Cyber Elite
Cyber Elite

@Amin2,

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.

View solution in original post

2 REPLIES 2

Cyber Elite
Cyber Elite

@Amin2,

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.

L2 Linker

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...

  • 1 accepted solution
  • 700 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!