AnsweredAssumed Answered

update blog via rest api

Question asked by brogits on Aug 29, 2011
Latest reply on Mar 20, 2012 by jpotts
Hello,

I am trying to update a blog on Alfresco share site via Restful API but of no success for 2 days now. I had tried to search the internet but can't find a good place to start. I even bought Alfresco developer guide book hoping to get some information on how to correctly consume Alfresco Restful API.

I have successfully retrieve the list of my blogs coming from Alresco but now that I am trying to updating a particular blog it does not even return an error.

Any body here can point me to some resources that can help me figure out my issue?

For info this is the code i have which always returns null from the call:


$bizObj->draft=false;
$data = json_encode($bizObj);
$postUrl = $webServer. "/alfresco/service/api/blog/node/$bizObj->storeType/$bizObj->storeId/$bizObj->id";
try{
   $ch=curl_init();
   curl_setopt($ch,CURLOPT_URL,$postUrl);         
   curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
   curl_setopt($ch, CURLOPT_USERPWD, "$user:$pwd");
   curl_setopt($ch,CURLOPT_POST,1);
   curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
         
   $json=json_decode(curl_exec($ch),true,512);     
   curl_close($ch);
   if($json==null){
      …..
      …..
   }else{
      …..
      …..
   }
   }catch(Exception $e){
      ….
   }

Thank you.

Outcomes