Response: set failed, may need to override template object first

Reply
Highlighted
L0 Member

Response: set failed, may need to override template object first

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!

Highlighted
L4 Transporter

Re: Response: set failed, may need to override template object first

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).

Highlighted
L0 Member

Re: Response: set failed, may need to override template object first

Hi,

 

I am using the same X-Path for the get objects and response is successful.

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!