API Upload File

답변함


2020년 7월 16일에 게시됨

Hello all,
I've been trying to attach a file to a ticket via uploads API and the problem that I am encountering is that the file successfully attaches but then when I try to open the file it download to my PC but when I try to open it says file type not supported.

  • I am making the request from ServiceNow through post request to https://example.zendesk.com/api/v2/uploads.json
  • response status code 201
  • Then I take the token in the response to create a new ticket in ZD.
  • response status code 201
  • file type is JPG
  • file size is 1.9 MB

    See images below for reference. 




1

18

댓글 18개

Benessa Dumol 

are you using below JSON to send data,

 -d '{"ticket": {"comment": {"body": "Press play", "uploads": ["4bLLKSOU63CPqaIeOMXYyXzUh"]}}}'

if yes then u need to send array of upload tokens you received after uploading. 

"uploads": ["token1", "token2", "token3"]

Hope this helps,

Dinesh

0


Hello, sorry for hijacking this thread, but I am currently stuck and I desperately need some help.

I am currently developing an app that has 2 fields, a file upload field that allows multiple files and a text area.

Here is the current status of the app:

  • I was able to create a private comment using the value inputted on the text area
  • I was able to get the token when I uploaded the files using the Upload API

The next goal is for all the files to be attached to the ticket. I am using this as my reference and on the examples, only 1 file is attached to the ticket comment.

Can you help to confirm if it is possible to attach multiple files/images to 1 ticket comment? If yes, can you point me in the right direction?

Thank you,

0


Any updates from anyone who was having this issue? 

0


Well do you have an example of that?

0


Hello Chris,

i didn't upload the file separately using api. added the blob of image in the html body and uploaded.  it auto uploaded the attachments.

0


Dinesh Korgaokar - can you provide an example of how this looks in your API call?

1


hello Chris Green,

faced similar issue.  the solution worked for me is adding image blob to the <img src="image blob">. this seems auto uploads the attachments for me.  

0


I am facing this same issue and have not gotten any good support from Zendesk on the issue.....this is quite frustrating. I can make a call to 'List Comments' and see my attachment and can confirm that everything looks good, but when I try to view the attachment in my ticket I'm getting the same as above:

 

0


Hi Dinesh! I responded to your comment here, but feel free to respond either in this post or the other one!

0


Hello,

Facing same issue with request function in APP framework. 

0


로그인하세요.

원하는 정보를 못 찾으셨나요?

새 게시물