我想通过他们的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 ?
发布评论
评论(1)
我找到了解决方案:
如果要使用上载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 usehttps://api.yammer.com/user_impersonation
like this: