Configurer un jeton d'application pour les oneboxes Instagram

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 « J'aime »

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 « J'aime »


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 « J'aime »

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 « J'aime »

@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 « J'aime »

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 « J'aime »

Question rapide : Le processus a-t-il été modifié pour devenir « Instagram Basic Display » ou suis-je très très aveugle ? Parce que je ne vois pas l’option oEmbed, le plus proche par définition que je suppose est l’Instagram Basic Display.

En citant :

Instagram Basic Display permet aux applications d’accéder à l’API Instagram Basic Display, qui fournit un accès en lecture seule aux données de base des comptes Instagram des utilisateurs de l’application.

Utilisez cet onglet pour configurer la fenêtre d’autorisation de l’API afin d’obtenir les autorisations des utilisateurs, et pour soumettre votre application à App Review lorsque vous êtes prêt à la passer en mode Live.

Notez que Basic Display n’est pas un outil d’authentification. Les données renvoyées par l’API ne peuvent pas être utilisées pour authentifier vos utilisateurs ou les connecter à votre application. Si votre application utilise les données de l’API pour authentifier les utilisateurs, elle sera rejetée lors de l’examen de l’application. Si vous avez besoin d’une solution d’authentification, utilisez Facebook Login à la place.

Il, cependant, nécessite d’autres URL qui ne sont pas listées ici, donc je ne suis pas sûr, par exemple :

Paramètres OAuth du client

URL de rappel de désautorisation


(Peut-être aussi que quelque chose a changé car cela ne fonctionne pas ici, je pense ?)

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

3 « J'aime »

pour autant que je sache, il s’agit toujours de lecture oEmbed avec un accès avancé

1 « J'aime »

Je vois. Il y a donc une différence avec le tutoriel.

Au lieu d’être ajouté comme n’importe quelle autre fonctionnalité (appelée « Produits » dans l’interface utilisateur) depuis le Tableau de bord, il est maintenant demandé depuis la section « Demande » du menu « Examen de l’application ». Vous sélectionnez la fonctionnalité et la soumettez à l’examen.

Ce qui rend le processus un peu bancal car ils demandent un lien avec un oEmbed valide pour l’approuver… mais cela ne fonctionne pas car la fonctionnalité n’est pas approuvée… :sweat:

4 « J'aime »

Ça fonctionne maintenant sur mon compte. Je vais essayer de résumer ce dont vous avez besoin. Je ne suis pas particulièrement calé en technologie, donc je ne suis pas sûr de pouvoir répondre à de nombreuses questions, mais je suppose qu’il suffit de copier mes paramètres aussi fidèlement que possible pour vérifier que tout fonctionne.

Vous avez besoin de la connexion Facebook (je ne sais pas si l’API Instagram Graph est réellement nécessaire). Vérifiez que la connexion Facebook fonctionne sur votre installation Discourse.

Paramètres de connexion Facebook :

Paramètres de base :

Paramètres avancés :

3 « J'aime »

Salut tout le monde, je voulais vous informer qu’à partir d’aujourd’hui, la description de @Iceman reste exacte.

Certaines mises en page ont été modifiées par rapport au guide (:point_up:), mais la principale différence est que oEmbed doit être demandé après que votre application ait passé l’examen de l’application.

Depuis le menu « Examen de l’application », vous pouvez faire des demandes :

Mon application n’a pas encore passé l’examen de l’application, mais @undasein a réussi à la faire fonctionner récemment, avec l’aide de ce guide et des conseils de https://stackoverflow.com/questions/67998234/starting-using-instagram-oembed-feature.


Bonne chance pour le partage de vos `grams, tout le monde ! :slight_smile:

3 « J'aime »

Dans ma requête, je n’ai rien fait d’élaboré. J’ai juste écrit « J’aimerais intégrer des publications Instagram sur mon forum » et cela a été approuvé en un jour.

1 « J'aime »

Comment puis-je accéder à l’oembed read avancé ? Je ne peux même pas le demander car le bouton est désactivé. J’ai fait une API sur le graph, mais rien ne se passe même après 24 heures

Certains utilisateurs ont contourné ce problème en soumettant l’application à l’examen pour une autre raison (telle que la connexion Facebook), et une fois approuvée, certaines fonctionnalités peuvent être demandées, telles que « Oembed Read ».

Vous voudrez peut-être contacter les canaux de support de la plateforme pour comprendre ce qui se passe avec votre compte. :+1:

1 « J'aime »

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

oEmbed n’existe plus, par quoi dois-je le remplacer ?

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

Je ne vois pas l’option Oembed, laquelle avez-vous choisie ?

Votre application a-t-elle déjà passé l’examen de l’application @danielabc ?

1 « J'aime »

lorsque je vais dans l’option, le bouton est désactivé et je ne peux pas cliquer

lorsque je vais dans l’option, le bouton est désactivé et je ne peux pas cliquer

Mon accès a été révoqué car il n’a pas été utilisé pendant 90 jours. Ce qui signifie, je pense, que personne sur mon forum n’a récemment posté de lien Instagram.

Voici donc l’état actuel de la permission oEmbed Read :

Pour demander un accès avancé à cette permission, vous devez effectuer un appel API de test réussi. Il peut s’écouler jusqu’à 24 heures après le premier appel API pour que ce bouton devienne actif. En savoir plus sur les tests

Comment, en pratique, faisons-nous un appel API avec Discourse dans ce contexte pour demander à nouveau un accès avancé ? :thinking:

2 « J'aime »