: Asynchronous and Synchronous Requests to the PAN-OS XML API
Focus
Focus

Asynchronous and Synchronous Requests to the PAN-OS XML API

Table of Contents

Asynchronous and Synchronous Requests to the PAN-OS XML API

Most PAN-OS XML API requests are synchronous, meaning the response immediately provides the requested data. For example, when you Make Your First API Call and request system information, the API response is immediate and contains information such as the IP address, hostname, and model of your firewall.
However, there are some Request Types that require more time to process and are asynchronous, meaning they require more than one request to get final results. These API requests include the following:
With asynchronous requests, you first initiate a request. The API responds with a job ID while it processes your request. In your subsequent requests, you use this job ID to check on the results of your original request.
Examples (replace
jobid
with the actual job ID):
  • Get reports:
    curl -X POST 'https://firewall/api?type=report&action=get&job-id=jobid&key=<apikey>"
  • Retrieve logs:
    curl -X POST 'https://firewall/api?type=log&action=get&job-id=jobid&key=<apikey>"
  • Export technical support data:
    curl -X POST 'https://firewall/api?type=export&category=tech-support&action=get&job-id=jobid&key=<apikey>"
  • Commit:
    curl -X POST 'https://firewall/api?type=commit&cmd=<commit></commit>&key=<apikey>"
  • Operational commands:
    curl -X POST 'https://firewall/api?type=op&cmd=<show><jobs><id>jobid</id></jobs></show>&key=<apikey>"

Recommended For You