# Configureer een app-token voor Instagram oneboxes

**URL:** https://meta.discourse.org/t/configure-an-app-token-for-instagram-oneboxes/223548
**Category:** Integrations
**Tags:** how-to, platforms
**Created:** [2 december 2020 om 20:49 UTC](https://meta.discourse.org/t/configure-an-app-token-for-instagram-oneboxes/223548 "2020-12-02T20:49:25Z")
**Posts on this page:** 9
**Page:** 2

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [22 november 2022 om 17:22 UTC](https://meta.discourse.org/t/configure-an-app-token-for-instagram-oneboxes/223548/28 "2022-11-22T17:22:14Z")

</div>

I think that’s what happened to me too, I don’t know what to do

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [27 november 2022 om 16:53 UTC](https://meta.discourse.org/t/configure-an-app-token-for-instagram-oneboxes/223548/29 "2022-11-27T16:53:40Z")

</div>

[https://www.instagram.com/p/CIRhYzFM7Lu](https://www.instagram.com/p/CIRhYzFM7Lu)

---

<div class="post-metadata">

### Author: ![danielabc](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@danielabc](https://meta.discourse.org/u/danielabc)
#### Post date: [27 november 2022 om 16:54 UTC](https://meta.discourse.org/t/configure-an-app-token-for-instagram-oneboxes/223548/30 "2022-11-27T16:54:25Z")

</div>

Doesn’t it incorporate?

Well, I did everything or what does this post send, but the links do not incorporate!

In my forum and here

---

<div class="post-metadata">

### Author: ![Pandabear](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pandabear/32/207556_2.png) [@Pandabear](https://meta.discourse.org/u/Pandabear)
#### Post date: [15 maart 2023 om 21:10 UTC](https://meta.discourse.org/t/configure-an-app-token-for-instagram-oneboxes/223548/31 "2023-03-15T21:10:03Z")

</div>

I would like to be able to see instagram and tik toks videos and photos on my forum.  
Does anyone know how i can do that. i am also willing to pay for it.

Explain us how you use this permission or this feature  
The instagram\_graph\_user\_profile permission makes it possible for your app to read the user’s user profile from it. This permission must be used to read fields in an Instagram user profile (for example, the user ID or account type). You can use this permission to read the “User” node (representing the Instagram user) and its perimeters. You may also use this permission to request insights and analytics for advertising, marketing or enhancement of your application using non-identifying or anonymized aggregate data (provided that such data cannot be de-anonymized).

Facebook asks me to record a video.

---

<div class="post-metadata">

### Author: ![JasonH](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jasonh/32/287309_2.png) [@JasonH](https://meta.discourse.org/u/JasonH)
#### Post date: [12 april 2023 om 23:17 UTC](https://meta.discourse.org/t/configure-an-app-token-for-instagram-oneboxes/223548/32 "2023-04-12T23:17:14Z")

</div>

Is this broken for Instagram embeds? It was working before and sometime in the last couple of days Instagram links no longer embed.

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [12 februari 2024 om 17:59 UTC](https://meta.discourse.org/t/configure-an-app-token-for-instagram-oneboxes/223548/35 "2024-02-12T17:59:46Z")

</div>

I can’t see the oEmbed app. Instead there is ‘Instagram Basic Display’.

Is this the same thing? My app in Facebook is temporarily suspended (long story), so I can’t muck about with it to find out at the moment.

_later…_

I note this from [https://developers.facebook.com/docs/features-reference/oembed-read](https://developers.facebook.com/docs/features-reference/oembed-read)

> ![image](https://global.discourse-cdn.com/meta/original/4X/b/b/c/bbc0efa935107f64874b5a63a3f10f7831ca10f5.png)

---

<div class="post-metadata">

### Author: ![WaitroseCarpark](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/waitrosecarpark/32/198599_2.png) [@WaitroseCarpark](https://meta.discourse.org/u/WaitroseCarpark)
#### Post date: [27 februari 2024 om 11:41 UTC](https://meta.discourse.org/t/configure-an-app-token-for-instagram-oneboxes/223548/36 "2024-02-27T11:41:18Z")

</div>

My embedding has broken again. Will check my developer console to see if it’s anything obvious (even if it is, I might miss it!)

Well, I didn’t miss it!:

 ![image](https://global.discourse-cdn.com/meta/original/4X/4/9/2/492c8e3726a3840ddff5fcbedf9ec6c0e7f9a5f0.png)

---

<div class="post-metadata">

### Author: ![WaitroseCarpark](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/waitrosecarpark/32/198599_2.png) [@WaitroseCarpark](https://meta.discourse.org/u/WaitroseCarpark)
#### Post date: [27 februari 2024 om 11:46 UTC](https://meta.discourse.org/t/configure-an-app-token-for-instagram-oneboxes/223548/37 "2024-02-27T11:46:28Z")

</div>

I have no idea whether this would fix the broken embeds but I went through the steps anyway.

I AM over the 11 January 2024 deadline so hope it will still be ok.

The steps were fairly simple, just about 4 checkboxes I had to tick to confirm compliance with various matters (that I’d confirmed in the past, and since nothing on my site had changed I believe it should all be fine).

Now I just got to wait a day or two for confirmation.

---

<div class="post-metadata">

### Author: ![DenisDoroshchuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denisdoroshchuk/32/516109_2.png) [@DenisDoroshchuk](https://meta.discourse.org/u/DenisDoroshchuk)
#### Post date: [26 augustus 2025 om 06:57 UTC](https://meta.discourse.org/t/configure-an-app-token-for-instagram-oneboxes/223548/38 "2025-08-26T06:57:47Z")

</div>

Hello everyone, we recently decided to allow users to embed Instagram links. We followed the instructions from this thread → created an app in meta → obtained a token → added it to Discourse OneBox. Everything went well, but the Instagram posts did not appear.

I noticed that Discourse does not correctly convert Instagram links to iframes, and then nothing happens when displaying with this iframe.

For example, link:

```xml
https:/www.instagram.com/p/DNuo51_XP5L/

```

was converted into this iframe:

```xml
<iframe width="" height="98" frameborder="0" data-unsanitized-src="https:/www.instagram.com/p/DNuo51_XP5L/embed" seamless="seamless" sandbox="allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation"></iframe>

```

and when displaying with iframe, nothing happened and there was an empty rectangle.

To fix this, I wrote this code and inserted it as a Custom JS component:

```javascript
import { apiInitializer } from "discourse/lib/api";

export default apiInitializer(api => {
  api.decorateCooked(($cooked) => {
    $cooked[0].querySelectorAll('iframe[data-unsanitized-src]').forEach((f) => {
      const u = f.getAttribute("data-unsanitized-src");
      if (!u) return;

      const fixed = u.replace(/^https:\//, "https://");
      let host = "";
      try { host = new URL(fixed).hostname; } catch (e) {}

      if (host === "www.instagram.com" || host === "instagram.com") {
        const permalink = fixed.replace(/\/embed\/?$/, "/");
        const blockquote = document.createElement("blockquote");
        blockquote.className = "instagram-media";
        blockquote.setAttribute("data-instgrm-permalink", permalink);
        blockquote.setAttribute("data-instgrm-version", "14");

        f.replaceWith(blockquote);

        if (!document.querySelector('script[src*="www.instagram.com/embed.js"]')) {
          const s = document.createElement("script");
          s.async = true;
          s.src = "//www.instagram.com/embed.js";
          document.body.appendChild(s);
        } else if (window.instgrm && window.instgrm.Embeds) {
          window.instgrm.Embeds.process();
        }
      }
    });
  }, { id: "instagram-iframe-to-blockquote" });
});

```

After that, all Instagram Embeds started displaying as intended. This code converts broken iframes into

> .
> 
> I hope this code will be useful to someone.
> 
> ![Screenshot 2025-08-26 at 08.40.28](https://global.discourse-cdn.com/meta/original/4X/5/4/3/5432bc5689eeb19965d1ff2cd720de64b1e7a941.jpeg)
> 
> ![Screenshot 2025-08-26 at 08.50.56](https://global.discourse-cdn.com/meta/original/4X/7/b/a/7ba2323734c26f07ebe550d6ff45494b16fcfa38.jpeg)

[Vorige pagina](https://meta.discourse.org/t/configure-an-app-token-for-instagram-oneboxes/223548.md?page=1)
