When using the Salesforce SOAP API (enterprise WSDL) to query a rich text area custom field that contains images — for example, using a SOQL query like SELECT Resolution__c FROM myArticle WHERE ArticleNumber = '000001' AND PublishStatus='Online' AND IsLatestVersion = true AND Language='en_US' — the returned result is an HTML img element with a src URL pointing to Salesforce internal servers.
When a user accesses this content via an Experience Cloud site or Force.com Site without being authenticated, the images do not display. The images only appear after the user logs in to Salesforce and refreshes the page.
This is expected behavior. Images stored in rich text area fields are accessible only within an authenticated Salesforce session. There is no API that retrieves the actual binary file of an image from a rich text area field for unauthenticated access.
Consider switching from a rich text area field to a File field type, or store your images in the Documents object. Both field types allow you to retrieve the actual file body via API query, enabling images to be displayed in unauthenticated contexts.
Refer to the Salesforce Knowledge documentation and the Salesforce API documentation for guidance on using file fields and the Documents object.
You can make your images publicly accessible by publishing articles through a Force.com Site. Follow these steps:
Once this is done, take the img src URL returned from your API query and replace the Salesforce internal domain with your Force.com Site public domain. For example:
From (internal access only): <REDACTED>[instance].content.force.com/servlet/rtaImage?eid=[articleId]&feoid=[fieldId]&refid=[refId]
To (public site access): https://[your-site].force.com/servlet/rtaImage?eid=[articleId]&feoid=[fieldId]&refid=[refId]
Salesforce Knowledge articles can also be retrieved via the Salesforce REST API. Refer to the Salesforce Knowledge REST API developer documentation for guidance on retrieving article versions programmatically.
000385938

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.