I have a problem when accesing a pdf stored as salesforce file via URL. At some point in time I was able to load a pdf (stored as note and attachment) in my browser using the following link :

 [server url]/servlet/servlet.FileDownload?file=00P2............

But on this instance of my environment, even if I am using notes and attachment or salesforce files, I noticed that the prefix is 069...... and not 00P. I found that this prefix is the prefix for content document. But how can I access a content document via URL ?

My requirement is not to get the base64 data from the pdf, I just need a URL to the pdf, because i will need this URL for a webservice call, let say via twilio.

Doest anybody know how to get it ? Or even better, if I can generate the public link via apex code, an then used that link will be even better.


Try this URL format - note the "document" instead of "version" in the path:

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.