You need to sign in to do that
Don't have an account?

How to see attachment content/download file via REST API
Hi All,
I was able to succesfully get the access token and make calls to see my 2 records which i had attached.
Using the below calls for my instance i am able to see the attributes, contentDocumentLink, id, LinkedEntityID and ContentDocumentID, VersionData as well.
What steps should i do next to make call to see my document content/download my file?
Postman Call:
/services/data/v43.0/query?q=select id, LinkedEntityId,ContentDocumentId from ContentDocumentLink where LinkedEntityId = '0016asdasd33'
Postman call to get version data:
/services/data/v43.0/query?q=SELECT VersionData FROM ContentVersion WHERE (ContentDocumentId = '069sdsds' or ContentDocumentId = '069asdssd') AND IsLatest = true
I was able to succesfully get the access token and make calls to see my 2 records which i had attached.
Using the below calls for my instance i am able to see the attributes, contentDocumentLink, id, LinkedEntityID and ContentDocumentID, VersionData as well.
What steps should i do next to make call to see my document content/download my file?
Postman Call:
/services/data/v43.0/query?q=select id, LinkedEntityId,ContentDocumentId from ContentDocumentLink where LinkedEntityId = '0016asdasd33'
Postman call to get version data:
/services/data/v43.0/query?q=SELECT VersionData FROM ContentVersion WHERE (ContentDocumentId = '069sdsds' or ContentDocumentId = '069asdssd') AND IsLatest = true
string x = EncodingUtil.base64Decode(EncodingUtil.base64Encode(cn.VersionData)).toString();
You may use the above code snippet to get the actual file data.
All Answers
string x = EncodingUtil.base64Decode(EncodingUtil.base64Encode(cn.VersionData)).toString();
You may use the above code snippet to get the actual file data.
services/data/v43.0/sobjects/ContentVersion/0686Casadads/VersionData (response of this call is content type of application/octetstream)
The url i am hitting above is what i got in the response from:
/services/data/v43.0/query?q=SELECT VersionData FROM ContentVersion WHERE (ContentDocumentId = '069sdsds' or ContentDocumentId = '069asdssd') AND IsLatest = true
I'm new to POSTMAN . I'm trying same scenario but not able to get the actual file from ContentVersion. Could you please help me with the actual code that needs to sent with POSTMAN Get call?
Thanks in Advance!