Yammer 附件 - 如何使用 pending_attachments 调用? [英] Yammer attachments - how do I use the pending_attachments call?

查看:58
本文介绍了Yammer 附件 - 如何使用 pending_attachments 调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Yammer API,并且希望能够将文件添加到通过我的应用程序创建的新帖子中.这似乎是通过 api/pending_attachments 调用完成的,但是 文档有点粗略,并没有真正说明 pending_attachments 调用的期望 - 它想要一个 attachment 属性,但完全不清楚这意味着什么- 是 文件吗? 文件名吗? 在大多数情况下,除了出现 500 错误之外,我无法使该页面上的测试执行任何其他操作,即不太令人鼓舞,但如果我以 Base64 编码格式发布文件块,它确实会失败,告诉我请求太大.如果我只有一个字段,我如何告诉 Yammer 我上传的块属于哪个文件,以便它可以关联它们?

I am working with the Yammer API and I want to be able to add files to new posts created through my application. This appears to be done through the api/pending_attachments call, but the documentation is a little sketchy and doesn't really make it clear what the pending_attachments call is expecting - it wants an attachment property but it's entirely unclear what that means - is it the file? Is it the file name? In most cases I can't make the test on that page do anything other than fail with a 500 error, which is less than encouraging, but if I post a file chunk in Base64 Encoded format, it does fail in a way that tells me the request is too large. If I do only have a single field how do I tell Yammer what file the chunks I am uploading belong to so it can relate them?

这篇文章看来有一个特殊的秘密和完全未公开的上传 URL 必须将文件发送到,但那里的上传过程似乎可能不适用于我目前正在使用的分块上传(尽管可以在必要时更改) 整个事情非常混乱.

From this post it seems that there is a special secret and entirely unpublicised upload URL that one has to send the files to, but the upload process there seems like it might not work with chunked uploads which is what I'm currently using ( although that could be changed if necessary ) and the whole thing is very confusing.

在这种情况下,我没有使用特定的库,只是与 Yammer 提供的服务进行交互.我正在使用 C#,但我的问题是关于 Yammer API,所以我不太担心语言方面的问题.

I'm not using a specific library in this case, just interacting with the service that Yammer presents. I'm working from C#, but my question is about the Yammer API, so I'm not too worried about the language side of things.

我需要做什么才能将挂起的附件直接成功上传到 Yammer?

What do I need to do in order to successfully upload pending attachments directly to Yammer?

推荐答案

注意:Pending_attachments 不是将文件上传到 Yammer Post 的正确端点.

Note: Pending_attachments is not the correct endpoint to upload files to Yammer Post.

成功创建带有附件的 Yammer 帖子的步骤

Steps Successfully Create a Yammer Post with attachments

  1. 使用此端点创建 Yammer Post 并存储来自响应的 thread_id.来自响应json的messages.thread_id
  2. 使用此端点通过发送multipart/form-data 格式化数据.
  1. Create Yammer Post using this endpoint and store the thread_id from response.messages.thread_id from response json
  2. Upload the attachment using this endpoint by sending a multipart/form-data formatted data.

这篇关于Yammer 附件 - 如何使用 pending_attachments 调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆