Attachment in a comment trough API

11 Comments

  • Erica Girges
    Zendesk Developer Advocacy
    Hi Gabriele,
     
    You'll want to make sure the Content-Type is set to application/binary for external source file uploads. Also, could you try opening the attachment in Zendesk into a new tab? 
    Please let me know if you're able to do so, this will better help me to troubleshoot the issue you're having.
     
    Best,
     
    Erica
    0
  • Gabriele Bracciali

    Hello Erica,

    Thanks for helping me!
    I've tried to set the Content-Type to application/binary, but doesn't work.
    And also open it in a new tab, but doesn't work same.

    0
  • Gabriele Bracciali

    Hello Erica Girges, do you have any other suggestions?

    0
  • Erica Girges
    Zendesk Developer Advocacy
    Hi Gabriele,
     
    Apologies for the delay, I was out of the office for a bit. That's definitely very strange then. Let me go ahead and pull you into a ticket so we can get a better look.
     
    Best,
    Erica
    0
  • Gabriele Bracciali

    Hello Erica Girges,

    Sorry I didn't mean to be pushy, but I need to fix it asap.

    I will give you more details about the HTTP request:

    POST 
    https://sendinblue.zendesk.com/api/v2/uploads.json

    query
    filename
    Screenshot 2022-12-06 at 15.42.30.png

    Headers
    Content-Type 
    application/binary

    Body
    --data-binary
    "https://url...."

     

    I hope it's all clear and can help you.

    Thanks!

    0
  • Erica Girges
    Zendesk Developer Advocacy
    Hi Gabriele,
     
    I went ahead and created a ticket for you but can share with you here as well the question that I had. 
     
    I noticed the external url for the attachment is to Jira. Do you know if that url is publicly accessible or does it require authentication to access it?
     
    If it does require authentication, that could be why you're unable to view it after attaching it. Any external sources for attachments would need to be publicly accessible for it to be viewable.
     
    Best,
     
    Erica
    0
  • Gabriele Bracciali

    Hello!!
    Yes the url is from Jira issue, and I can open the link/attachment if I open it in a new browser tab, so it doesn't required the authentication.
    Thanks

    0
  • Tuomas Savonius

    I bet this is the same issue I has faced. ZAF client will not work with

    Content-Type 
    application/binary

    You will need to use for example javascript fetch to call the Zendesk api:
    https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch

    But there you will need to provide a authorization header, and you can't use secure settings to my knowledge. So it is a bad solution to a oversight on Zendesks end.

    0
  • Gabriele Bracciali

    Hello, Thanks Tuomas Savonius

    Can you give me more details, please?

    I am doing this request in n8n.

    0
  • Gabriele Bracciali

    Can we avoid this problem converting the file in binary?

    0
  • Gabriele Bracciali

    Fixed uploading the file in Binary

    0

Please sign in to leave a comment.

Powered by Zendesk