Zendesk API - Upload enpoint can't process file from file input

8 댓글

  • Christopher Kennedy
    Zendesk Developer Advocacy
    Hi Ulas,
     
    Which file types are you receiving this upload error for?  Also, does the file extension for the filename URL parameter match the file extension of the local file?
     
    Best,
    1
  • Ulas Can Akpinar

    Hey Christopher,

    thank you for your comment. I've tried several data types like PDF or JPEG files and it happens for all of them. And yes the file extension matches the local file. 

     

    All the best,

    0
  • Ulas Can Akpinar

    As an update, I think this is caused by the ZAF Client not supporting operation with binary files.

    0
  • Christopher Kennedy
    Zendesk Developer Advocacy
    Hi Ulas,
     
    That can definitely result in an upload error.  Are you able to successfully upload via AJAX instead of ZAFClient?
     
    Best,
    0
  • John Merry

    https://developer.zendesk.com/filmorago/api-reference/ticketing/tickets/ticket-attachments/#upload-files
    This endpoint can be used only with curl?
    Sorry if it's a stupid question

    0
  • Eric Nelson
    Zendesk Developer Advocacy
    Hi John, 

    All of our endpoints are language agnostic. For this endpoint just keep in mind that the payload needs to be sent in binary and must be a POST request. Other than that, feel free to communicate with it however works best for your use case. 
     
    Thanks!
    0
  • Benessa Dumol

    Hi Eric Nelson and Christopher Kennedy,

    I would like to ask both of you for help because I am getting the same issue.

    It seems that I am not passing the correct data on the /api/v2/uploads.json?filename=attachment.jpg API endpoint. Currently, I am passing the filename with contentType: "image/jpg", and when it was uploaded and attached to the ticket I am getting the error Error loading image when I tried opening 

    I also tried passing Binary and Base64 data with contentType: "application/binary" but I am getting this error

    {
        "readyState": 4,
        "responseText": "{\"error\":\"AttachmentUnprocessable\",\"description\":\"Attachment file could not be processed.\"}",
        "status": 422,
        "statusText": "error"
    }

    May I ask what is the correct data format that I need to pass on the data parameter? 

    Appreciate your response.

    Thank you,
    Benessa

    0
  • Tipene Hughes
    Zendesk Developer Advocacy

    Hey Benessa,

    I've gone ahead and replied in the ongoing thread relating to the same issue. You can view that here.

    Thanks!

    Tipene

    0

댓글을 남기려면 로그인하세요.

Zendesk 제공