You need to sign in to do that
Don't have an account?
Guilhem Achikbache
[PHP/REST] Upload file to a personaccount
Hi everyone,
I'm trying to upload a file in the notes&attachment section of an account, but with no luck. The documentation is very obscure, and I can't even find with the workbench explorer a file that I've uploaded with the salesforce interface.
- What I can't find is where to POST the query :
/services/data/v20.0/sobjects/Account/{ID},
/services/data/v20.0/sobjects/Account/{ID}/Attachment,
/services/data/v20.0/sobjects/Account/Attachment{ID}
- what syntax shoud the JSON data have ? Where do I specify the recordId the file should be attached to ?
- how can I retrieve it later ?
does anyone know how to do this ?
Thanks
I'm trying to upload a file in the notes&attachment section of an account, but with no luck. The documentation is very obscure, and I can't even find with the workbench explorer a file that I've uploaded with the salesforce interface.
- What I can't find is where to POST the query :
/services/data/v20.0/sobjects/Account/{ID},
/services/data/v20.0/sobjects/Account/{ID}/Attachment,
/services/data/v20.0/sobjects/Account/Attachment{ID}
- what syntax shoud the JSON data have ? Where do I specify the recordId the file should be attached to ?
- how can I retrieve it later ?
does anyone know how to do this ?
Thanks
POST to /services/data/v20.0/sobjects/Attachment
Body :
{
parentId : the itemID you wish to attach the file to,
name : the filename
description: the description
body : base64encoded of file contents
contenttype: the mimetype of the file
}
Of all those fields, only the parentId, name and body seem to be displayed in the interface (lightning)