End-of-Life (EoL)
An API request typically comprises a number of parameters, as shown in the example below:
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 is config (configuration) or op (operational mode command), you must also specify an associated action, such as edit , delete , or move . Learn more about Configuration Actions.
XML and XPath elements ( xpath= or cmd= ): 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.
You use the GET or POST method to make requests to the PAN-OS XML API. Use a POST request when you are sending large amounts of form data or when you are passing non-ASCII characters. Some API requests, such as importing files, require POST. Use a GET request when passing 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
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