24 comments

  • 0

    Hi Fannar, can you describe what you mean here?  To include an image in your forum entry, use the "Insert/edit image" icon on the entry editor:

    tiny-mce-image-attach.jpg

  • 0

    I'm talking about the API. I want to create a forum entry like yours with image inline through the API, not using the editor.

  • 0

    Fannar,

    We do not support this explicitly, but it can be done.  If you look at the source code for that image above, you'll see that it's represented as an attachment resource:

    <img src=" [/attachments/token/d8xiapybjpnz8dq/?name=tiny-mce-image-attach.jpg](view-source:https://support.zendesk.com/attachments/token/d8xiapybjpnz8dq/?name=tiny-mce-image-attach.jpg)" border="0" alt="tiny-mce-image-attach.jpg" />

    Using our attachments API, you can upload your attachment and compose the URL with the token that is generated via the attachments API and the filename which you provide when uploading.

  • 0

    Good point. Thanks!

  • 0

    What about non-image attachments, like pdf or word files?

  • 0

    Javier,

    In the end they're all just files, so this will work with any file format.

    Steven

  • 0

    So I uploaded an attachment by POSTing to http://bigtent.zendesk.com/uploads.xml?filename=test.pdf

    and got back this response:

    HTTP/1.1 200 OK
    Response content length: 115
    <uploads token="r4mri2avmp48zzj">
      <attachments>
        <attachment>4298853</attachment>
     </attachments>
    </uploads>

     

    Then I figured out the download URL would be

    http://bigtent.zendesk.com/attachments/token/r4mri2avmp48zzj/?name=test.pdf

    but that gives me a 404 response. Was that the wrong URL for the download?

  • 0

    Also, can I send files compressed with gzip and get them decompressed on your side? That way, uploads will be smaller and faster.

  • 0

    The token returned by the attachments API is for a batch upload. It allows you to associate multiple images with a single entry/ticket. I have yet to find a way to get the attachment token using the API which means you can't insert images into the content area unless you do it manually.

  • 0

    Here are some solutions I found while poking around - 

    1) You can point to an attachment using /attachments/{id} rather than /attachments/token/{token}. This makes it possible to construct a url using the data returned after uploading an attachment using the API.

    2) Although undocumented, you can get info on an attachment from /attachments/{id}.xml. The returned XML contains the token for the image.

  • 0

    Only predicament with this approach is that it then still shows the list of attachments at the bottom of the article. When the images are already shown, it is not required to show the attachment list as well.  Is there a way to not show the list of attachments ?

    Thanks!

  • 0

    I have yet to find a way to do hide attachments.

  • 0

    Thanks for the feedback Trevor.  You guys at screensteps have done an excellent job in implementing the discussions in this forum. It is *much *easier to use screensteps to prepare forum content, as opposed to entering it with the online zendesk editor.

  • 0

    Regarding the undocumented APIs that Trevor is alluding to for getting details of an attachment as well as deleting them, we are planning on documenting those.

  • 0

    Willem - To hide attachments I am going to upload the attachments but not associate them with the post using the "uploads" node. The forum entry will display the images inline but will not show the images as attachments. I believe this means the images won't be deleted if you delete the entry using the web interface though.

  • 0

    How are you finding the attachment ids or even the token for an attachment that's previously been uploaded to a ticket/comment? Once the id/token is known, retrieval would work a treat but I can't seem to locate either.

  • 0

    In my case I'm the one uploading the attachments so I get the ids/tokens at upload time.

  • 0

    So, if end users are creating tickets through the web interface, there's currently no way to find the URL of attachments for those tickets.

  • 0

    Not that I am aware of.

  • 0

    Hi all, just as a followup - attachments seem to be available within the comments node of the xml.

  • 0

    I would like to do the opposite. I plan to store a lot of pre-written PDF help files for customers in the agents forum so that an agent can search for a possible answer to a customers problem. It would then be good if they could attach the relevant PDF to the customer reply directly from the forum. Or is there a better way of doing this? I only want to send it to customers after it has been confirmed what the problem is.

  • 0

    Hey Ian: 

    There's no way to attach a file that exist in the forum directly to a ticket. I'd suggest compiling a list of those documents/links to those documents in a forum, allowing your agents to quickly copy/paste the link in to the ticket. If they want to attach a document, they'll need to manually upload it to the ticket. 

  • 0

    Hey Justin:

    Thank you. I like the idea of adding the links rather than the documents as it means that if they are updated the current one will always be used (as long as the name is the same). Thanks again Justin.

  • 0

    Cheers!

Please sign in to leave a comment.