AnsweredAssumed Answered

How to upload file by sugar api

Question asked by inno_priyanka on Dec 21, 2015
Latest reply on Mar 3, 2016 by Vignesh V

i am usin SugarCRM Enterprise, Version 7.6.1.0

 

and used the code to upload doc is

 

$url = $base_url . "/Notes";

$note_arguments = array(

    "name" => "Pri Note",

);

$note_response = call($url, $oauth2_token_response->access_token, 'POST', $note_arguments);

 

$url = $base_url . "/Notes/".$note_response->id."/file/filename";

$file_arguments = array(

    "format" => "sugar-html-json",

    "delete_if_fails" => true,

    "oauth_token" => $oauth2_token_response->access_token,

    "filename" => $_FILES["fileToUpload"]["tmp_name"],

);

$file_response = call($url, $oauth2_token_response->access_token, 'POST', $file_arguments);

 

 

 

i used the file name  $_FILES["fileToUpload"]["tmp_name"], @http://thegoodtimesofindia.com/netmatrixapp/netmatrix/images/logo_netmatrix.png, @c://windows.png, but each time i got the response is "attachment missing".

 

How can i upload the document.???

Outcomes