如何通过uploadsmallfile api在yammer中上传文件

发布于 2025-02-09 23:33:58 字数 432 浏览 0 评论 0 原文

我想通过他们的REST API在Yammer中创建一个帖子,然后将图像附加到此帖子。

在yammer documentation 他们说您必须首先通过uploadsmallfile API上传文件,它将返回文件的ID,然后您可以使用此ID将文件连接到帖子中。

在编码之前,我试图使其在Postman中起作用。 当我发送请求时,我被禁止使用403,并且在阅读文章后,我认为这是因为我使用的访问权限没有提供良好的权利。

在哪里以及如何获取access_token可以使我上传文件?

I want to create a post in Yammer via their REST API and attach an image to this post.

In the yammer documentation they say that you have to first upload a file via the uploadSmallFile API, it will returns the id of the file and then you can use this id to attach the file in the post.

Before coding I'm trying to make it works in Postman.
When I send the request I got 403 Forbidden, and after reading articles I think it is because the access_token I use doesn't provide the good rights.

Where and how to grab an access_token that permit me to upload a file ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怎言笑 2025-02-16 23:33:58

我找到了解决方案:

如果要使用上载mallfile API,则必须抓住Azure Active Directory(AAD)令牌。

因此,您必须使用

当您提供范围参数时,只需使用 https://api.ymerm.com/user_impersonation 像这样:

I found the solution:

If you want to use the uploadSmallFile API you have to grab an Azure Active Directory (AAD) token.

So you have to use the microsoft oauth2 auth-code flow.

And when you provide the scope parameter, just use https://api.yammer.com/user_impersonation like this:

postman parameters

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文