替换”通过图形API资源管理器"我的应用程序名称标签 [英] Replace "via Graph API Explorer" label by my application name

查看:92
本文介绍了替换”通过图形API资源管理器"我的应用程序名称标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Facebook应用程序开发很新。我玩了一整天与如何发布在页面壁上的消息?。我终于成功了,但每条消息通过图形API资源管理器了。我试图找到如何将其更改为我的应用程序名称没有成功。我想看看我是否能强制应用的价值在API命令,但它并没有考虑到这一点。也许我错过了什么:(如果有人可以帮助,这将是伟大的!

I am quite new in Facebook application development. I was playing the all day with "how to post a message on the wall of a page?". I finally succeeded but each message got "via Graph API Explorer". I tried to find how to change it to my application name without success. I tried to see if I could force the value of application in the api command but it did not take it into account. Maybe I miss something :( If someone can help, that would be great!

我仍然很困惑。让我试着解释一下我想做的事:我想在页面上自动发布(如页面),这些网站上定义(在一种议程)某些事件。我错过了什么,我想,是多么的一切都在Facebook上侧一起工作:
1.登录过程:为应用程序将在cron中运行,这应该不显示登录对话框。
2.访问令牌:应用程序或页面呢?
3.权限:从我的理解,我需要manage_pages(和publish_stream),但不清楚应如何设置

I am still quite confused. Let me try to explain what I want to do: I would like to automatically publish on a page (as the page) some event that are defined on a website (in a kind of agenda). What I miss, I think, is how everything is working together on Facebook side: 1. the login process: as the application will run in a cron, this should not display a login dialog box. 2. the access token: application or page one? 3. the permissions: from my understanding, I need manage_pages (and publish_stream) but not clear how this should be set.

THX任何澄清,也许一个明显的例子:O)

Thx for any clarification and maybe a clear example :o)

推荐答案

OK,我想我终于找到了这样做的方式。我需要一个页面访问code,而不是一个应用程序访问code。必须在应用程序作为一个长期活的外部生成的标记。

OK I think I have finally found the way to do it. I needed a page access code and not an application access code. The token must be generated outside the application as a long live one.


  • 使用获得code:

<$c$c>https://www.facebook.com/dialog/oauth?client_id={app_id}&redirect_uri={my_url}&scope=manage_pages,publish_stream

APP_ID是您的应用程序ID
my_url是你的应用程序URL
范围是你想要的权限授予

app_id is your application ID my_url is your application URL scope is the permission you want to be granted

在重定向的URL,你将有一个code参数。复制它。

In the redirected URL, you will have a code parameter. Copy it.


  • 使用生成用户访问code:

<$c$c>https://graph.facebook.com/oauth/access_token?client_id={app_id}&redirect_uri={my_url}&client_secret={app_secret}&$c$c={$c$c}

app_secret是应用程序的密钥
code是步骤1中的code

app_secret is your application secret key code is the code from step 1

您将得到作为输出的用户的访问令牌。这一个是短住一间。

You will get as output the user access token. This one is a short live one.


  • 短期直播转换为万岁用户访问令牌使用:

<$c$c>https://graph.facebook.com/oauth/access_token?grant_type=fb_exchange_token&client_id={app_id}&client_secret={app_secret}&fb_exchange_token={short现场访问令牌}

由您在步骤2中得到了更换短现场访问令牌
你会得到作为输出的无限用户的访问令牌。

Replace the "short live access token" by the one you got on step 2 You will get as output the infinite user access token.


  • 获取的页面访问令牌(这将是一个无限的访问令牌
    现在用户访问令牌是一个无限的访问令牌太):

https://graph.facebook.com/me/accounts?access_token= {无限用户访问令牌}

替换无限用户访问令牌你在步骤3中得到的价值。

Replace the "infinite user access token" with the value you got on step 3.

此命令将列出所有您管理的页面。输出包含你在现场的access_token需要的页面访问令牌。你可以这样使用此标记在应用程序的任何API命令。

This command will list all the pages you administer. The output contains the page access token you need in field "access_token". You can so use this token in any API command in your application.

最好的最好的是做通过服务器端程序中的所有这些步骤(PHP对我来说)作为应用密钥应保持秘密。

The best of the best is to do all those steps via a server side program (PHP for me) as the application secret key should remain "secret".

这篇关于替换&rdquo;通过图形API资源管理器&QUOT;我的应用程序名称标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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