Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instagram links fail #104

Open
carstenblt opened this issue Aug 24, 2020 · 9 comments
Open

Instagram links fail #104

carstenblt opened this issue Aug 24, 2020 · 9 comments
Labels
help wanted Extra attention is needed

Comments

@carstenblt
Copy link

Instagram is switching to a new API requiring registration and apparently they already stopped working. Building fails with

Error: Request failed with status code 400

@aliwilson
Copy link

+1 i'm also having the same issue with this.

@raae
Copy link
Member

raae commented Aug 26, 2020

That kind of goes against the whole oembed vibe 😠

Looked at their new docs and it says its not supposed to be deprecated until October 24th. So hopefully it will get back up and I have time to figure something out.

@raae
Copy link
Member

raae commented Aug 26, 2020

It seems the endpoint in the oembed list has been updated to the new endpoint and is therefore requiring an access token giving us 400.

I think this can be fixed by overriding the url to the soon to be deprecated oembed url:

settings: {
   Instagram: {
      url: "https://api.instagram.com/oembed"
   }
}

or get an access token and add that to settings:

settings: {
   Instagram: {
      access_token: <access token>
   }
}

I cannot test this until tonight.

@raae raae added help wanted Extra attention is needed hacktoberfest labels Oct 12, 2020
@philsturgeon
Copy link
Contributor

The access_token approach works. Had to jump through loads of hoops, make a Facebook Developer account, make an app, create an App Access Token, etc, but it works.

@raae
Copy link
Member

raae commented Oct 15, 2020

Great news @philsturgeon, would you be willing to add a not about this in the documentation (readme.md)?

@philsturgeon
Copy link
Contributor

philsturgeon commented Oct 15, 2020

@raae will do, but first I'm confused. Using the old API does seem to work for now:

$ curl https://api.instagram.com/oembed/\?url\=https://www.instagram.com/p/B5SYlkZFTBY
{"version": "1.0", "title": "all good here...

It really seems like:

settings: {
  Instagram: {
    url: "https://api.instagram.com/oembed/"
  }
},

should work if thats how you make https://api.instagram.com/oembed/?url=foo happen.

@raae
Copy link
Member

raae commented Oct 15, 2020

Somewhere I found info that the old api will be turned off sometime this month.

So in our docs we can go for the access token solution. And feel free to let people now it's a pain to get hold of an access token.

I am quite furious with Instagram closing of what is supposed to be an open standard...

@philsturgeon
Copy link
Contributor

philsturgeon commented Oct 15, 2020

Here you go: #110

Yeah I'm pretty annoyed too. They said they'd deprecate it Oct 24th then just shut shit down before that. Even if this happened on 24th, "responding with a 400" is not deprecating, that's bricking it.

I wrote up a tutorial a) ranting, b) explaining how to do this nicely without hardcoding tokens in the repo: https://phil.tech/2020/gatsby-instagram-oembed-failures/

I would still love to figure out why we're getting 400's via the plugin but using curl works fine. User agent sniffing perhaps?

@raae
Copy link
Member

raae commented Oct 19, 2020

I am not completely sure adding the url param works, so it might be using the new address and I am guessing then it would return 400 when no access token?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants