Jump to content

knowram

Members
  • Posts

    226
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

knowram's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. thank you guys for the input. I understand that just saying it doesn't work is not really helpful. I did that mostly because I am still trying to figure out the best way to do this. I have seen some posts that talk about the cURL library and now AbraCadaver has suggested HTTP classes. I am looking for something simple that I can simply update the XML that needs to be sent as well as the action ( POST, PUT, DELETE, GET). Sorry I didn't write the original post this way it's mostly only now become clear that this was my intention for this post. I know this is allot but would you be able to share an example of a POST with each method (cURL, HTTP classes) that has authentication by any chance?
  2. If I understand the API correctly I am trying to do 'POST','GET','PUT' or 'DELETE' functions with an XML payload. but even saying that I am not sure what it means.
  3. Hello all. I am a self taught developer and therefore only know what i have done so please be nice. I am trying to figure out how to use an XML API from cisco. They have given the following example. POST http://<server>/vmrest/users?templateAlias=voicemailusertemplate <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <User> <Alias>jdoe</Alias> <DtmfAccessId>7890</DtmfAccessId> </User> presumably if I really knew what I was doing this would make sense to me however it does not. I would like to be able to perform this function through a web interface with php. After doing some searching I found the following bit of code that I tried manipulate to to complete the function above however I am having problems getting it to work. <?php //You can use 'POST','GET','PUT' or 'DELETE' $xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <User> <Alias>jdoe</Alias> <DtmfAccessId>7890</DtmfAccessId> </User>'; $auth = base64_encode('username:password'); $header = array("Authorization: Basic $auth"); $opts = array( 'http'=>array( 'method'=>'POST', 'header'=>$header, 'content'=>$xml ) ); $context = stream_context_create($opts); /* Sends an http request to www.example.com with additional headers shown above */ $url = 'http://172.16.16.121/vmrest/users?templateAlias=voicemailusertemplate'; $fp = fopen($url, 'r', false, $context); fpassthru($fp); fclose($fp); ?> If anyone could help point me in the right direction I would much appreciate it. Thank you
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.