[SalesForce] Get Attachment which is of Type File from Rest API

I'm trying to get attachments of type file from custom object through salesforce Rest API(outside of salesforce) but i'm not able fetch the file.

This is the file i'm trying to get

Getting below error

[{
    "errorCode": "NOT_FOUND",
    "message": "The requested resource does not exist"
}]

URL's i tried:

http://myinstance/services/data/v41.0/sobjects/Document/069290000002n2kxxx/body/
http://myinstance/services/data/v41.0/sobjects/Attachment/069290000002n2kxxx/body/
http://myinstance/services/data/v41.0/sobjects/SalesforceFiles/069290000002n2kxxx/body/

Best Answer

The Id which you have shared is CONTENTDOCUMENT

So your request will be

/services/data/v39.0/sobjects/ContentDocument/069290000002n2kxxx

ContentDocument API

Related Topic