Structure of a PAN-OS XML API Request
Table of Contents
PAN.OS 11.1 & Later
Expand all | Collapse all
-
- Upgrade a Firewall to the Latest PAN-OS Version (API)
- Show and Manage GlobalProtect Users (API)
- Query a Firewall from Panorama (API)
- Upgrade PAN-OS on Multiple HA Firewalls through Panorama (API)
- Automatically Check for and Install Content Updates (API)
- Enforce Policy using External Dynamic Lists and AutoFocus Artifacts (API)
- Configure SAML 2.0 Authentication (API)
- Quarantine Compromised Devices (API)
- Manage Certificates (API)
-
- Asynchronous and Synchronous Requests to the PAN-OS XML API
- Run Operational Mode Commands (API)
- Apply User-ID Mapping and Populate Dynamic Groups (API)
- Get Version Info (API)
-
- PAN-OS REST API
- Access the PAN-OS REST API
- Resource Methods and Query Parameters (REST API)
- PAN-OS REST API Request and Response Structure
- PAN-OS REST API Error Codes
- Work With Objects (REST API)
- Create a Security Policy Rule (REST API)
- Work with Policy Rules on Panorama (REST API)
- Create a Tag (REST API)
- Configure a Security Zone (REST API)
- Configure an SD-WAN Interface (REST API)
- Create an SD-WAN Policy Pre Rule (REST API)
- Configure an Ethernet Interface (REST API)
- Update a Virtual Router (REST API)
- Work With Decryption (APIs)
Structure of a PAN-OS XML API Request
A PAN-OS XML API request typically comprises a number
of parameters, as shown in the example below:
curl -X POST 'https://firewall/api?type=<type>&action=<action>&xpath=<xpath>&key=<apikey>"
- API key (key=): The API key allows you to authenticate yourself to the API when making requests. Learn about API Authentication and Security and how to Get Your API Key.
- Request type (type=): Because the XML API allows you to perform a wide array of requests, you must first specify the type of request you want, ranging from configuration to operation, importing to exporting, and from reports to user ID. Learn more about Request Types.
- Action (action=): When the request type isconfig (configuration) orop (operational mode command), you must also specify an associated action, such asedit,delete, ormove. Learn more about Configuration Actions.
- XML and XPath elements (xpath= orcmd=): When using configuration or operational mode commands on the firewall, you include only the XML or the XPath that specifies the XML node. Learn more about XML and XPath and XPath Node Selection.
To make requests to the PAN-OS XML API, you can use the GET and
POST methods.
Use a GET request when the query size is less than 2K and you
want to pass strings in the Request URL. When using the GET method,
append the query string to the request URL as a URL-encoded parameter
string:
GET /api/?type=keygen&user=<username>&password=<password>
Use a POST request when you are sending large amounts of form
data (the request size is between 2K to 5MB; limit the request size
to 5MB) or when you are passing non-ASCII characters. Some API requests,
such as importing files, require POST. When using the POST method,
pass the parameters in the request body. In this example, the request
body includes the login credentials:
POST /api/ HTTP/1.1 Content-Type: application/x-www-form-urlencoded password=<password>&user=<username>&type=keygen
If you want to learn about the PAN-OS REST API structure, see PAN-OS REST API Request and Response Structure.