Api query problem

Reply
Not applicable

Api query problem

Hello,

I an doing a traffic query through the API like this

https://pa/api?/type=log&log-type=traffic&query=(add.src in 10.1.1.1)&key=API_KEY

I get the response with a job id.

But when i try to get the content of the job ID

https://pa/api?/type=log&action=get&job-id=JOB&key=API_KEY

I get the following error

<response status="error" code="17">

<msg>

    <line>show-> query -> id is unexpected </line>

</msg>

</response>

Tags (2)
L1 Bithead

Re: Api query problem

I was able to duplicate the error you were seeing and was able to get the query results using the following command:

//firewall/api/?&type=op&cmd=<show><query><result><id>JOB-ID</id></result></query></show>&key=API_KEY

L5 Sessionator

Re: Api query problem

//firewall/api/?&type=op&cmd=<show><query><result><id>JOB-ID</id></result></query></show>&key=API_KEY

This command resulted in an error.

<response status="error" code="17">

<msg>

<line>

<![CDATA[ show -> query -> result is unexpected ]]>

</line>

</msg>

</response>


//firewall/api/?&type=op&cmd=<show><query><id>JOB-ID</id></query></show>&key=API_KEY

This command worked.

//firewall/api?/type=log&action=get&job-id=JOB&key=API_KEY

This command worked, too.

Tested in 5.0.3.



SRA
L4 Transporter

Re: Api query problem

Your usage is correct. Can you confirm the job id value you provided is the same as the one returned by the previous query.

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 Live Community as a whole!

The Live Community thanks you for your participation!