- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
04-09-2018 05:19 AM
Hello
I'm trying to modify a shared address group bye using xml api and use POST http method
url:
https://$url/api/?key=$key&type=config&action=edit&xpath=/config/shared/address-group/entry[@name='GRP-NAME']
header:
Content-Type='text/xml'
body:
<entry name="GRP-NAME">
<static>
<member>SRV-10.0.0.32</member>
<member>172.20.34.101</member>
</static>
</entry>
But when i execute post call with POSTMAN, The response is:
<response status="error" code="12">
<msg>
<line>Invalid target object in edit handler</line>
</msg>
</response>
I don't understand why, because if i do:
https://$url/api/?key=$key&type=config&action=get&xpath=/config/shared/address-group/entry[@name='GRP-NAME']
The response is the detail of the group 'GRP-NAME'
thanks
04-10-2018 04:55 AM
I found the solution:
put in url only:
https://$url/api/
headers:
['Content-Type' => 'application/x-www-form-urlencoded']
body:
key=$key&type=config&action=edit&xpath=/config/shared/address-group/entry[@name="GRP-NAME"]&element=<entry name="GRP-NAME"><static><member>namemembers</member</static></entry>'
04-10-2018 04:55 AM
I found the solution:
put in url only:
https://$url/api/
headers:
['Content-Type' => 'application/x-www-form-urlencoded']
body:
key=$key&type=config&action=edit&xpath=/config/shared/address-group/entry[@name="GRP-NAME"]&element=<entry name="GRP-NAME"><static><member>namemembers</member</static></entry>'
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!