Hello,
I'm trying to issue a call through API so that I can delete user properties. When I go to ourwiki.com/@api/users/=john_smith%40ourwiki.com/properties it returns the XML which includes all of that users properties.
I'm trying to store that XML in variable $xmlString then I should be able to loop through to get the properties and in turn delete. The user properties is key value where the key and value can be anything so there is no way of being able to know all options unfortunately.
The code so far:
$delete = "http://www.ourwiki.com/@api/DELETE:users/$user_id/properties/%s";
$xmlString = file_get_contents('ourwiki.com/@api/users/=john_smith%40ourwiki.com/properties')
$xml = new SimpleXMLElement($xmlString);
foreach($xml->property as $property) {
$name = $property['name']; // the name is stored in the attribute
file_get_contents(sprintf($delete, $name));
}
For some reason, file_get_contents does not seem to be able to get the XML. I've even made sure that allow_url_fopen is enabled in the environment. Any help with this would be greatly appreciated.