Get an attachment using APIs
Collapse
X
-
Big thanks, it works fine for auth with regular user.
FYI: HMAC auth doesn't work
Get Metadata - OK
Get File - NothingPHP Code:$response = $api->request('GET', 'Attachment/5e95750bccc13d6d2');
PHP Code:$response = $api->request('GET', 'Attachment/file/5e95750bccc13d6d2');
-
It's not possible via API.
When you download an attachment in EspoCRM it redirects to '?entryPoint=download&id=ATTACHMENT_ID'
It's possible to download this way but it will require a basic authorization.
EDIT:
It will be added in the next release: https://github.com/espocrm/espocrm/issues/1676. You can apply code from the commit to your instance manually.Last edited by yuri; 04-14-2020, 04:38 PM.Leave a comment:
-
Get an attachment using APIs
Such a good product!
I've looked at the documentation of the APIs, the sad fact is, most of it is terrible described
. I'm sorry for being rude.
Please advice how to get an Attachment (file) using APIs.
API request:
Attachment/5e95750bccc13d6d2
API results:
PHP Code:[response] => {"id":"5e95750bccc13d6d2","name":"image.png","deleted":false,"type":"image\/png","size":48493,"sourceId":null,"field":"image","createdAt":"2020-04-14 08:32:11","role":"Attachment","storage":null,"storageFilePath":null,"global":false,"parentId":null,"parentType":null,"parentName":null,"relatedId":"5e956201647c76d31","relatedType":"Account","relatedName":"7","createdById":"1","createdByName":"Admin"}
[code] => 200
Tags: None

Leave a comment: