Adding an additional URL to a Custom URL Category using XML-API

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

Adding an additional URL to a Custom URL Category using XML-API

L1 Bithead

How can I add an additional URL to an existing Custom URL Category using XML-API.  I have been trying variations of the following command:


https://00.0.0.00/api/?type=config&action=set&key=authkey&path=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/profiles/custom-url-category/entry[@name='MS_WHITE']&element=<member>www.goodsite.com</member>


When I enter this command it returns this error:

<![CDATA[ unexpected here ]]>


Does anyone know how I can make this work.  Thank you.

8 REPLIES 8

L4 Transporter

http(s)://hostname/api/?type=config&action=set&xpath=/config/devices/entry/vsys/entry[@name='vsys1']/profiles/custom-url-category/entry[@name='xmltest urlcat']/list&element=<list><member>www.somesite.com</member></list>

Check the FAQ section in the API guide for this and other examples.

Hi Savasarala.  Thank you for your help.  I see the examples in the API Guide now.  When I use this command,  I geth the following error:

<![CDATA[ -> list -> list has unexpected text. ]]>


Thoughts?

I have also tried and received the same error...

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

<msg>

<line>

<![CDATA[ list -> list has unexpected text. ]]>

</line>

</msg>

</response>

Not applicable

I was able to successfully make this work using the following URL (specific to my site...please excuse the personalized / non obfuscated naming)

https://panorama/api/?type=config&action=set&xpath=/config/shared/profiles/custom-url-category/entry...<member>www.apitest.com</member><member>www.apitest2.com</member><member>www.apitest3.com</member>

I got some info about cli debug from the following thread that was very helpful

https://live.paloaltonetworks.com/message/11766#11766

basically, the <list></list> tags seemed to be interfering with the /list in the URI (I think...)

I'm not sure if this would be a supported method, however it did work

Thanks

Cully

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!