API Upload File

6 댓글

  • enzo fass

    Also when I post to the uploads API. I am only providing the file name, is this sufficient?
    I have the feeling that it is uploading only the file name and not any contents.

    0
  • Sebastiaan Wijchers
    Community Moderator

    Hello Enzo,

    How big is the file you're downloading in Zendesk? Is it 1.9MB like the original, or way smaller?

    You should POST the file, there is a curl example in the documentation:
    https://developer.zendesk.com/rest_api/docs/support/attachments#upload-files

    What's the response body of the call to '/api/v2/uploads.json'?

    With kind regards,

    Sebastiaan
    Sparkly ⭐

    0
  • Nida Patanarat

    Hello Enzo,

    Could you please share me the solutions on how to fix this?

    Thank you very much

    Nida

    0
  • Bryan - Community Manager
    Zendesk Developer Support

    Hi Nida Patanarat. Looks like this question was also cross-posted in the developer community. I posted an answer there — please see https://develop.zendesk.com/hc/en-us/community/posts/360050023554/comments/360012872554. If you have follow-up questions, I can answer them there. Thanks!

    0
  • SAPTARSHI SINHA

    Hi All,

     

    When I am trying to upload a file using endpoint (POST /api/v2/uploads.json), 

    I just noticed that the file is getting uploaded, but the contents of the file(csv) is getting replaced by the Body of the API call. I am simple giving {} in the body, since without a body the API is giving error. 

    Can someone help me with a body for the endpoint? Or maybe how can I upload it with the contents.

     

    Regards.

    Saptarshi

    0
  • Bryan - Community Manager
    Zendesk Developer Support

    Hi SAPTARSHI SINHA,

    Please give the API call that you are making at any returned HTTP status codes (removing any confidential information of course).

    Are you using the example cURL code in the reference documentation for POST /api/v2/uploads.json?

    Also check out another community post where the tool Postman was used for a file upload: Unable to upload image file via /api/v2/uploads.json through postman

    Keep in mind that uploading and attaching to a ticket is a two step process described here: Attaching files to tickets via API.

    0

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

Zendesk 제공