为Instagram oneboxes配置应用程序令牌

If you already have a Facebook App associated with your Discourse site, scroll down to Adding oEmbed to your Facebook App.

If you do not have a Facebook Developer account and Facebook App:

Go to https://developers.facebook.com/. You’ll be prompted to log in to your Facebook account if you aren’t currently logged in. You may be asked to ‘convert’ your Facebook account to a developer account if you haven’t done so previously. You may be asked to verify your account with Facebook by adding a phone number or by completing other steps. You’ll need to just follow the prompts and do what Facebook requires of you.

Once you have a Facebook Developer account, click on ‘My Apps’ from the Facebook Developer homescreen:

…and ‘Create App’:

Select an app type of ‘Something Else’ and ‘Continue’:

Enter an ‘App Display Name’ and an ‘App Contact Email’. Once you’ve read through their Terms and Polices, you can click ‘Create App’:

If you are a robot: nothing to see here. Beep bop boop. :robot:

If you are not a robot: click “I’m not a robot”, follow the prompts, and click ‘Submit’.

Congrats! You have a Facebook App!

Adding oEmbed to your Facebook App:

Scroll to the bottom of the list of Products, find ‘oEmbed’ and click ‘Set Up’:

If you agree with how you’re going to use the oEmbed product, click the checkbox, and then click ‘Confirm’:

The oEmbed product has been added. Click on ‘Settings’:

‘Display Name’ and ‘Contact Email’ should already be filled in. You’ll need to enter URLs for your ‘Privacy Policy’ and ‘Terms of Service’. Select a ‘Category’ from the list of available options. Click ‘Save Changes’ when you’re happy with everything:

Click the toggle at the top of the screen to change from ‘In development’ to ‘Live’ mode:

Click ‘Switch Mode’:

Having done all that, we can actually generate an App Token by following Facebook’s instructions on App Access Tokens. You’ll need the value of the ‘App ID’ field, and the value of the ‘App Secret’ field. To get the App Secret, click ‘Show’. You may be asked to reauthenticate yourself or similar, but you should end up with a long hexadecimal value that you can copy:

As per Facebook’s documentation, you need to send those values to Facebook to generate a token. Are you familiar with using curl? Great! They suggest the following (replacing {your-app-id} and {your-app-secret}) with the values you copied from the screen above.

curl -X GET "https://graph.facebook.com/oauth/access_token?client_id={your-app-id}&client_secret={your-app-secret}&grant_type=client_credentials"

Alternatively, copying just the URL (after replacing those two values) to your browser should also work:

https://graph.facebook.com/oauth/access_token?client_id={your-app-id}&client_secret={your-app-secret}&grant_type=client_credentials

Facebook will respond with a small chunk of JSON, that should look something like this example:

{"access_token":"1234567890654321|c3bd55c09fc5e561552ad7a8717","token_type":"bearer"}

Copy the value of your access_token, excluding the quote marks (i.e., in my example it would be 1234567890654321|c3bd55c09fc5e561552ad7a8717), and go to your Discourse site’s Settings. Find the site setting called facebook_app_access_token in the Onebox setting. Paste the ‘access_token’ value in to this field:

Click the :white_check_mark: …and you’re done!

Pasting a URL such as https://www.instagram.com/p/CIRhYzFM7Lu/ in to a post on your site should result in a lovely onebox, just like this one:

https://www.instagram.com/p/CIRhYzFM7Lu/

Last edited by @JammyDodger 2024-05-26T06:49:11Z

Check documentPerform check on document:
17 个赞

New oEmbed Read Feature and App Review Requirements

Today, June 8, 2021, we announced v11.0 of the Graph API and Marketing APIs. With this update, there are new requirements to be able to access oEmbed APIs . Some of your apps currently access the oEmbed APIs and might be affected by these changes.

To continue accessing the oEmbed APIs, you will have to submit your apps for review by September 6th, 2021 . If you want to request new access to the oEmbed APIs, you will also need to submit your app(s) for review.

To learn more, please review the updated requirements. If your apps haven’t been reviewed for the oEmbed API feature by September 6, 2021, your apps will lose access to this feature. To avoid disruption to your apps’ oEmbed access, please submit for App Review as soon as possible.

New rules from our Facebook overlords, I’ve just submitted both of my apps for review. I found a public post with an Instagram embed and linked directly to show how the integration works. Hopefully this is sufficient.

8 个赞


womp womp, review failed.

here’s what i submitted

Your submission details

Is a Facebook reviewer able to access or login to your app to verify you’re using permissions or features according to Facebook Platform Policy?

Yes

Platform Settings

Desktop

Site URL:https://fixed.org.au/

No account needed

  1. Visit The 'what you've done to your bike today' thread - #10218 by jaseyjase - Post your ride - FOA
  2. The instagram post is embeded in the page. The site is running Discourse forum software (https://discourse.org/)

Oembed Read

Tell us how you’re using this permission or feature

Discourse (https://discourse.org/) can embed Instagram and Facebook posts in community posts, it keeps people on our website while richly embedding content

Oembed URL

The 'what you've done to your bike today' thread - #10218 by jaseyjase - Post your ride - FOA

I just resubmitted (had some extra text in Oembed URL) and it’s been approved!!! :smiley: waiting for my second app to be…

3 个赞

The text looks the same as in your initial review submit. Can you elaborate on what extra information you provided compared to the failed review?

In addition: Did you pass FB login data to the forum or not?

1 个赞

@znedw my question still stands, if you can help everyone with some insight on this please?

The first review failed because I had some extra text in the Oembed URL field and the form removes spaces onsubmit, so the URL didn’t work… That’s the only difference between attemps

Nope, in the Platform section (I had to add a platform in the wizard), I just wrote

No account needed

I didn’t really want to setup a discourse account just for FB review, so I just found a post on our forum that was public, and had an Instagram image embedded. I thought this would show how the integration functions well enough. I guess FB could read the discourse source and work it out themselves :man_shrugging:

Sorry I missed this. I literally did no changes to either forum, just found a forum post with an instagram pic embedded as mentioned above and then walked through the app review wizard on FB

3 个赞

Hi @znedw, I followed your guide and got our app review approved 24 hours later.

Although, I had to enter the direct link to the embedded Instagram post into the oEmbed-URL field as the form did not accept the link to the topic on our domain in that field. Maybe they changed that part.

For the rest, I followed exactly your wording. And it worked.

1 个赞

快速提问:流程是否已更改为“Instagram 基本显示”或是我眼瞎了?因为我找不到 oEmbed 选项,按定义最接近的是我猜的 Instagram 基本显示。

引用:

Instagram 基本显示允许应用访问 Instagram 基本显示 API,该 API 提供对应用用户 Instagram 帐户基本数据的只读访问。

使用此选项卡可配置 API 的 授权窗口,以便您可以从用户那里获得 权限,并在准备好将应用切换到实时模式时提交 应用审核

请注意,基本显示不是身份验证工具。API 返回的数据不能用于验证您的应用用户或让他们登录您的应用。如果您的应用使用 API 数据来验证用户,它将在应用审核期间被拒绝。如果您需要身份验证解决方案,请改用 Facebook 登录

但是,它需要此处未列出的其他 URL,所以我不太确定,例如:

客户端 OAuth 设置

取消授权回调 URL


(另外,也许有什么东西改变了,因为它在这里不起作用,我想?)

https://www.instagram.com/p/CIRhYzFM7Lu

3 个赞

据我所知,它仍然是 oEmbed readadvanced access

1 个赞

明白了。那和教程就有区别了。

它不再像其他功能(在用户界面中称为“产品”)那样从仪表板添加,而是从“应用审核”菜单的“请求”部分进行请求。您选择该功能并将其提交审核。

这使得该过程有点像漏洞,因为他们要求提供一个有效的 oEmbed 链接才能批准它……但这不起作用,因为该功能尚未获得批准……:sweat:

4 个赞

我的帐户现在可以正常工作了。我会尝试总结你需要的内容。我不太懂技术,所以不确定能否回答很多问题,但我想你可以尽量复制我的设置来检查是否都能正常工作。

你需要 Facebook 登录(我不知道是否真的需要 Instagram Graph API)。请检查你的 Discourse 安装上的 Facebook 登录是否正常工作。

Facebook 登录设置:

基本设置:

高级设置:

3 个赞

大家好,想告诉大家的是,从今天起,@Iceman 的描述仍然准确。

一些页面布局已根据指南 (:point_up:) 修改,但主要区别在于 oEmbed 必须在您的应用通过应用审核 之后 才能请求。

在“应用审核”菜单中,您可以提出请求:

我的应用尚未通过应用审核,但 @undasein 在本指南的帮助下,并根据 https://stackoverflow.com/questions/67998234/starting-using-instagram-oembed-feature 的建议,最近成功使其生效。


祝大家分享 grams 顺利!:slight_smile:

3 个赞

我的请求很简单,我只是写了“我想在我的论坛上嵌入 Instagram帖子”,一天就获得了批准。

1 个赞

我该如何访问高级 oembed 读取?我甚至无法请求它,因为按钮被禁用了。我在图上做了一些 API 调用,但即使过了 24 小时也没有任何反应。

一些用户通过因其他原因(例如 Facebook 登录)提交应用进行审核来解决此问题,一旦获得批准,就可以请求某些功能,例如“Oembed Read”。

您可能需要联系平台支持渠道以了解您帐户的情况。 :+1:

1 个赞

[quote=“Jamie Wilson, post:1, topic:223548, username:jamie.wilson”]noEmbed
[/quote]

noEmbed 不再存在,我应该改用什么?

[quote=“Iceman, post:10, topic:223548, username:Iceman”]Instagram Basic Display
[/quote]

我看不到 Oembed 选项,你选了哪一个?

@danielabc,您的应用通过应用审核了吗?

1 个赞

当我进入选项时,按钮是关闭的,我无法点击

当我进入选项时,按钮是关闭的,我无法点击

我的访问权限因 90 天未使用而被撤销。这意味着,我认为,我的论坛上没有人最近发布过 Instagram 链接。

因此,oEmbed 读取权限的当前状态如下:

要请求此权限的高级访问权限,您需要进行一次成功的 API 测试调用。在首次 API 调用后的 24 小时内,此按钮才会变为活动状态。了解测试

在这种情况下,我们如何在 Discourse 中实际进行 API 调用以再次请求高级访问权限? :thinking:

2 个赞