Cannot update a custom URL category via the XML/API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Cannot update a custom URL category via the XML/API

L1 Bithead

Hi, 

 

I'm trying to populate an existing custom URL category... My query is the following:

 

https://x.x.x.x/api/?type=config&key=xxxx&action=set&xpath=/config/devices/entry/vsys/entry[@name="v...

 

The result is:

 

<response status="error" code="13">
<msg>
<line>
set failed, may need to override template object first
</line>
</msg>
</response>
 
I already read other people's port about the same error but no solution was available... Any error in the URL?
 
KR,
/x
1 accepted solution

Accepted Solutions

L1 Bithead

Hi Xavier,

 

Try the following:

 

https://x.x.x.x/api/?type=config&action=set&key=KeyValue&xpath=/config/devices/entry/vsys/entry[@name='vsys1']/profiles/custom-url-category/entry[@name='my_malicious_urls']/list&element=<member>www.google.com</member>

 

 

Where host & keyvalue input needed appropriately. 

View solution in original post

3 REPLIES 3

L1 Bithead

Hi Xavier,

 

Try the following:

 

https://x.x.x.x/api/?type=config&action=set&key=KeyValue&xpath=/config/devices/entry/vsys/entry[@name='vsys1']/profiles/custom-url-category/entry[@name='my_malicious_urls']/list&element=<member>www.google.com</member>

 

 

Where host & keyvalue input needed appropriately. 

Tx for the example. It works ok now!

 

/x

L1 Bithead

Here is another example using curl if you see encoding errors

 

curl -k -d key=$KEY --data-urlencode "xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/profiles/custom-url-category/entry[@name='my_malicious_domains']/list" -d 'type=config' -d 'action=set' --data-urlencode "element=<member>http://www.maliciousdomain.com</member>" https://x.x.x.x/api/

  • 1 accepted solution
  • 9744 Views
  • 3 replies
  • 0 Likes
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 LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!