KinaneD
KinaneD

Reputation: 346

Instagram oEmbed API Invalid parameter

I have a Facebook app with advances access to oEmbed Reads permission. For more than a year now, I've been using the Instagram oEmbed endpoint on Instagram accounts with no issues.

Since a month ago, I started getting Invalid parameter error with response of the sort:

{
    "error": {
        "message": "Invalid parameter",
        "type": "OAuthException",
        "code": 100,
        "error_subcode": 2207047,
        "is_transient": false,
        "error_user_title": "Invalid URL",
        "error_user_msg": "The request parameter 'url' is malformed or does not refer to an embeddable media.",
        "fbtrace_id": "xxxxxxx"
    }
}

When sending requests to https://graph.facebook.com/v16.0/instagram_oembed&url=https://instagram.com/{username}&access_token=xxxxxx

The docs now refers to Instagram posts, which is confusing to me.

Alternatively, using the oembed_page endpoint as per the docs Returns a similar error:

{
  "error": {
    "message": "(#100) Invalid parameter",
    "type": "OAuthException",
    "code": 100,
    "fbtrace_id": xxxxx"
  }
}

Is anyone else having this same issue? Is the oEmbed endpoint specific to posts? How to go about retrieving an Instagram account/page info?

Thanks

Upvotes: 0

Views: 795

Answers (1)

Yvan
Yvan

Reputation: 2699

You've made two mistakes on the query part:

  • first & should be a ?
  • url isn't correctly encoded

It should be:

graph.facebook.com/v16.0/instagram_oembed?url=https%3A%2F%2Finstagram.com%2F{username}&access_token=xxxxxx

Note that the username, if it contains special characters, should be escaped too.

Upvotes: 0

Related Questions