Structure of a PAN-OS XML API Request
An API request typically comprises a number of parameters, as shown in the example below:
- 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.
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:
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
Recommended For You
Recommended videos not found.