Issue symptoms
Inline images in Zendesk Guide articles display for all users as a broken link, or don't display for anonymous users or end users.
This problem occurs where images are attached as inline attachments to another article that is:
- Restricted to a specific group of users
- In draft status
- In archived status
Due to any of these reasons, the image is displayed as a broken link, followed by the name of the image:
Resolution steps
These are options to fix the problem. If the article is:
- If the article is restricted to a specific group of users, update the restriction settings.
- If the article is in draft status, publish the article.
- If the article is in archived status, restore the article.
Alternatively, download the attachments and upload them individually to each article or use the Guide assets section. This is the recommended approach.
To identify the location of attachment in the original article
- Inspect the individual element in the console and copy its unique numerical ID:
-
Run the following API call for article attachments:
https://{{subdomain}}.zendesk.com/api/v2/help_center/articles/attachments/123456789.json
Replace the subdomain with your subdomain name and the unique ID value with that of one the original article inline attachment.
You'll get the response below that retrieves the original article source.
{
"article_attachment": {
"id": 123456789,
"url": "https://subdomain.zendesk.com/api/v2/help_center/articles/attachments/123456789",
"article_id": 360001328736,
"display_file_name": "Screen Shot 2020-02.png",
"file_name": "Screen_Shot_2020-02.png",
"content_url": "https://subdomain.zendesk.com/hc/article_attachments/1233456789/Screen_Shot_2020-02.png",
"relative_path": "/hc/article_attachments/123456789/Screen_Shot_2020-02.png",
"content_type": "image/png",
"size": 218402,
"inline": true,
"created_at": "2020-02-30T16:30:33Z",
"updated_at": "2020-02-30T16:45:03Z"
}
}
After you've identified the article's unique ID, add it to any knowledge base article editor and this returns the article, for example:
https://{{subdomain}}.zendesk.com/knowledge/articles/360001328736/en-us?brand_id=3149466
For more information, see the section: Working with articles in the knowledge base.
4 Comments
I run the json and sure enough, it returns the missing files.
But that just tells me that the missing files are indeed in the location where they are being called. This is also evident because I can see the images in both the Help Center Preview as End User mode and the Help Center when logged in as an Agent.
The file clearly exists. Zendesk just isn't displaying it for End Users. Why?
I am uploading via API, so I cannot go into each individual article and upload the image file again.
Hi,
did you perhaps found the solution?
Facing exactly the same issue here. I thought workaround would be to create unassociated attachment, parse the response json to get url and then regex through my article content substituting img src url's, prior to uploading the article. It worked in my preview, but I see this is not a sustainable solution.
I don't get what's the point of having an API if you're having to do things in editor manually.
Thanks
Are there any developments/new fixes for this issue? I agree, this is not a sustainable solution at all. Plus the behavior of this issue is inconsistent so it's difficult to avoid. A few of our users have already reported articles with missing images and we don't know how to exactly avoid it.
Hi,
workaround is that you first create article, then obtain article id, which you use when uploading attachments so that attachments are tied to the article. In response json you get an absolute attachment path so you can use regex to substitute relative paths in your article for absolute paths obtained as a response of attachment upload and then use article update API to upload / publish your article with proper attachment paths.
Please sign in to leave a comment.