发表在朋友的墙上,代表用户 [英] Post on a friend's wall on behalf of a user

查看:89
本文介绍了发表在朋友的墙上,代表用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个Facebook应用程序,需要代表用户在朋友的墙上发布,但不在画布应用程序的范围之内。我有以下内容:

I am writing a Facebook application that needs to post on a friend's wall on behalf of a user, but out of the scope of a canvas application. I have the following:

  • 应用程式ID

  • 应用程式秘密

  • publish_stream海报的权限

这在理论上应该足以做我想要的。我目前正在做的:

This should theoretically be enough to do what I want to. What I am currently doing:

  1. 使用应用程式ID和应用程式密码取得代表我应用程式的OAuth令牌(请参阅「认证为应用程式」 here )。

  2. 试图在朋友的墙上发布POST / / friend_wall / feed(请参阅此处)和在步骤1中检索到的OAuth令牌
  1. Use app ID and app secret to get an OAuth token representing my application (see "Authenticating as an Application" here).
  2. Attempting to publish on my friend's wall using a POST on /friends_wall/feed (see here) and the OAuth token retrieved in step 1.

但是,这最终会在朋友的墙上发布,因为朋友而不是用户(应用程序也有publish_stream朋友的权限)。这不是太意外,因为在这个过程中,我没有指定谁的海报应该是谁。

However, this ends up posting on the friend's wall as the friend rather than the user (the app also has publish_stream permissions for the friend). This isn't too unexpected, as nowhere in this process have I specified who the poster should be.

我的问题是:是否可以为代表用户的应用程序获取OAuth令牌?如果没有,有没有办法在画布应用范围之外的用户的朋友的墙上张贴?

谢谢,

Ashoat

Thanks,
Ashoat

推荐答案

其实,我想我已经弄清楚了这里的答案。我不认为在新的OAuth API中有办法实现,但是似乎有一种旧的REST API的方法。请参阅文档 here

Actually, I think I've figured out the answer here. I don't think that there's a way to do it in the new OAuth API, but there does seem to be a way with the older REST API. See the documentation here.

只需将我的问题中的第2步与上述文档替换,仍然使用步骤1中的OAuth令牌,您应该很好:)

Simply replace step 2 in my question with the above documentation, still using the OAuth token from step 1, and you should be good :)

这篇关于发表在朋友的墙上,代表用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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