Let the platform do the work

//:record/file/:field POST


Attaches a file to a field on a record.

Request Arguments

Name Type Description Required
format String The data format. Currently accepts 'sugar-html-json'. True
delete_if_fails Boolean Indicates whether the API is to mark related record deleted if the file upload fails. False
oauth_token String The oauth_token value. False - Required if only if delete_if_fails is true.
<attachment field> String The field and file to populate.
Example: {"":"@\/path\/to\/ExampleDocument.txt"}


   "<attachment field>":"@\/path\/to\/ExampleDocument.txt"

Response Arguments

Name Type Description
content-type String The files content type.
content-length Integer The files content length.
name String The files name.
uri String The URI of the file.


   "uri":"http:\/\/sugarcrm\/rest\/v10\/Notes\/ca66c92f-5a8b-28b4-4fc8-512d099b790b\/file\/<attachment field>?format=sugar-html-json&delete_if_fails=1&oauth_token=6ec91cf3-1f97-25b9-e0b1-512f8971b2d4"

Change Log

Version Change
v10 Added /<module>/:record/file/:field POST endpoint.