How to put URL in comment by using api?

3 Comments

  • Bryan - Community Manager
    Comment actions Permalink

    Hi Nida Patanarat. The Upload API doesn't support URL locations for adding attachments. While there is a "content_url" attribute associated with comment attachments, that is a read-only property that Zendesk Support populates with the location of the uploaded content.

    The ability to upload content via a URL has been requested before but is currently not in the product. I hope that at least sets expectations, so you can determine next steps for your solution.

    0
  • Nida Patanarat
    Comment actions Permalink

    Hi Bryan,

    Thanks for your clarification. Then I try to upload image file instead. The image can be uploaded but cannot be downloaded. I noticed that it may because thumbnails is null. Do you have any idea?

    "attachments": [

                    {

                        "url": "https://nsquaredhelp1597637631.zendesk.com/api/v2/attachments/901097734586.json",

                        "id": 901097734586,

                        "file_name": "Chair.jpg",

                        "content_url": "https://nsquaredhelp1597637631.zendesk.com/attachments/token/tG78vs98rU9Ajc9VwdcnAppy5/?name=Chair.jpg",

                        "mapped_content_url": "https://nsquaredhelp1597637631.zendesk.com/attachments/token/tG78vs98rU9Ajc9VwdcnAppy5/?name=Chair.jpg",

                        "content_type": "image/jpeg",

                        "size": 28,

                        "width": null,

                        "height": null,

                        "inline": false,

                        "deleted": false,

                        "thumbnails": []

                    }

                ],

    Below is when I get token from api via postman.

     

     

    Thanks,

    Nida

    0
  • Bryan - Community Manager
    Comment actions Permalink

    You mention "The image can be uploaded but cannot be downloaded" but the Postman screen shot above is of a POST operation. A GET request is needed to retrieve an attachment using /api/v2/attachments/{id}.json. Can you let me know if I'm missing something Nida Patanarat?

    0

Please sign in to leave a comment.

Powered by Zendesk