How to get public url of an image posted in an article comment?

6 Commentaires

  • Ifra Saqlain
    Community Moderator

    Hi Shailesh,

    Try this:

    1. Click on a photo. 
    2. Right-click and select “Copy image URL.” or  "Copy image address.

     

    Thanks

    Team

     

     

    0
  • Jim Davenport

    Hi Shailesh,

    It looks like you're pulling article comment data from the Zendesk REST API.  The image URLs returned in the article comment body are all relative to the base URL of the Zendesk instance itself.  For example:

    https://{subdomain}.zendesk.com/hc/user_images/RHr2k1JN1RQn6ggoFdRWkA.jpeg

    Where {subdomain} is the subdomain of your account.

    Hope that helps!

    Jim

    Zenplates - Custom themes, plugins and app for Zendesk

    0
  • Shailesh Kumar

    Hi Jim,

     

    Yes, I am pulling the comment data via Zendesk API, but I have to store this image somewhere else(another platform). So how can I download this image via Zendesk API?

     

    Thanks

    0
  • Kay
    Community Moderator

    Hi Shailesh 👋

    Have you tried scanning the comment for a regex which looks for these images?
    Once you know a comment has one, you should be able to execute a separate GET call to fetch these images.

    - Kay

    0
  • Shailesh Kumar

    Hi Kay,

    Yeah I got the image url but what is the endpoint to fetch that image as it is stored in {domain_name}/hc/user_images/q444ETXNsiaI2e2ydZyVRw.png

    Could you please share the endpoint if you know it? It will be helpful to me.

    Thanks

     

    0
  • Kay
    Community Moderator

    Hi Shailesh,

    There is no endpoint for it exactly.
    Or maybe I don't understand the question entirely.

    These images are in the body (i.e. the content) property of the article comments endpoint.
    That endpoint is this one https://developer.zendesk.com/rest_api/docs/help_center/article_comments#list-comments

    In the case of Zendesk's Help Center (the one we are in now) the point to fetch the image would be something like
    https://support.zendesk.com/hc/user_images/lkjsdlkljkslls.png

    0

Vous devez vous connecter pour laisser un commentaire.

Réalisé par Zendesk