- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
05-03-2020 12:03 PM - edited 05-04-2020 09:57 PM
Hi,
When I am trying to hit below API, I am getting error response, pasted below.
Payload:
{"type":"config","action":"set","key":"<Key>","xpath":"/config/devices/entry/vsys/entry/address-group/entry/[@name='apadr']","element":"<static><member>dstobj02</member>\n<member>dstobj01</member>\n</static>"}
Response:
'<response status="error" code="13"><msg><line>set failed, may need to override template object first</line></msg></response>'
Thanks!
05-04-2020 04:03 PM
First and foremost, you seem to have posted your API key on the internet, which is basically posting your password. Please change the password associated with that account as it is no longer secure.
As for the error, you are not specifying a specific vsys in the xpath, so that might be the error..? It could also be that if the address group "apadr" is currently a dynamic address group, since you're using a set I know PAN-OS will error out, just don't remember off the top of my head if it's this specific error or something else.
In general, it is highly recommended that you use one of the API libraries Palo Alto Networks has made available for free to make it easier to work with the API, such as pan-python (python), pandevice (python), or pango (golang).
05-06-2020 09:42 PM
Hi,
I am using the same X-Path for the get objects and response is successful.
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 LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!