AnsweredAssumed Answered

How can I create notes with an attachment in SugarCRM using SOAP API?

Question asked by Mahavir Mahavir on Jun 10, 2014
Latest reply on Jun 11, 2014 by Mukta Patel
I am using following code for doing same,but not qualify successfully :

$client = new SoapClient(NULL,$url);
$response = $client->login ($user_auth,'test');
$session_id=$response->id;
$create_note = $client->set_entry($session_id, 'Notes', array(array('name'=>'name','value'=>'Note Subject Line' ),array('name'=>'description','value'=>'Test content for note again'),
));

$contents = file_get_contents("/var/www/bb.js");
$note = array(array('name'=>'id','value'=>$create_note->id), 
array('name'=>'filename','value'=>"attachmentName"), 
array('name'=>'file','value'=>base64_encode($contents))

);
$create_note = $client->set_note_attachment($session_id,$note);


In this code i can create Note Successfully,but attachment is not attached to that created Notes.
Please help me where i am wrong.


Outcomes