You need to sign in to do that
Don't have an account?
florianhoehn
Cannot access images in rich text fields coming from REST API
Hi everyone,
I have a big problem that I cannot get my head around:
We created a REST API that returns an object with a rich text field in it. It displays beautifully without any trouble IF you are logged in to Salesforce.com directly. If however you are only using OAUTH to authenticate it cannot access the images of this rich text field.
Here an example JSON for a rich text field as we get it in html format:
... "article" : "<p class=\"MsoNormal\"></p>\n<p class=\"MsoNormal\" style=\"text-align: center; \"><img src=\"https://c.eu2.content.force.com/servlet/rtaImage?eid=a06b0000003Xvrq&feoid=00Nb0000000yu5o&refid=0EMb0000000Kyui\" alt=\"User-added image\"></img></p>" ...
How can it be that I can get all text and formatting ok but not access the image via OAUTH?
Any help would be greatly appreciated!
Florian
I would need more stuff like logins ecc..
could this be useful?
http://developer.force.com/cookbook/recipe/converting-a-rich-text-area-fields-image-for-api-upload
Thanks but this is for the upload via the API, I need the download.
Have you already tried to set the token scope to FULL? (this allow api + web access)
yes. That was the one thing that I thought would make sense if it would fix it. Unfortunately it didn't.
Have you tried to change the inital url with something like this?
https://sites.secure.force.com/success/servlet/rtaImage?eid=a06b0000003Xvrq&feoid=00Nb0000000yu5o&refid=0EMb0000000Kyui
Have you tried to append the token at then end of the url?
ex
var oldUrl = 'https://c.eu2.content.force.com/servlet/rtaImage?eid=a06b0000003Xvrq&feoid=00Nb0000000yu5o&refid=0EMb0000000Kyui'
var newUrl = + 'oauth_token=' + access_token
*pay attention to append using the &... so it becomes
var newUrl = + '&oauth_token=' + access_token
Hi Alessio,
I am facing the same problem, and I have tried whatever have been suggested so far without any luck. Please let me know if there is anything that can be done to access the image using oauth.
Regards,
Vikas Malhotra