logo
down
shadow

Instagram Gem, how do I handle an incorrect access token?


Instagram Gem, how do I handle an incorrect access token?

Content Index :

Instagram Gem, how do I handle an incorrect access token?
Tag : ruby-on-rails-4 , By : uxn
Date : November 28 2020, 11:01 PM

fixed the issue. Will look into that further If the access token is no longer valid you can rescue the Instagram::BadRequest exception:
@token  = 'xXxXxX...'
@client = Instagram.client(access_token: @token)

begin
  user = @client.user
  # YOUR LOGIC HERE
rescue Instagram::BadRequest => e
  if e.message =~ /access_token provided is invalid/
    # ACCESS TOKEN IS NO LONGER VALID
    # DO SOMETHING E.G. SEND THE USER AN EMAIL
  else
    # IT RETURNED 400 FOR ANOTHER REASON
  end
end

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

How to get access token from Instagram token using jQuery or php


Tag : php , By : user183825
Date : March 29 2020, 07:55 AM
Hope that helps The flow is well documented at http://instagram.com/developer/authentication/. You're done with step two, now it's on to step three, where you exchange the temporary code for a long lived access token.
The URL for this exchange is https://api.instagram.com/oauth/access_token and you'll need to POST client_id, client_secret, grant_type, redirect_uri, and code per the docs. cURL is the best way to do this.

Generate Instagram Client Id/Access Token for more than 5 clients or Use Single Token/Id for all pages of one website


Tag : php , By : Pepe Araya
Date : March 29 2020, 07:55 AM
I hope this helps . Not sure what you are trying to do, but if you are just accessing APIs, then Yes, you can use one client_id/access_token to access APIs from multiple pages and also multiple websites.

Get Instagram Access token


Tag : chash , By : chintown
Date : March 29 2020, 07:55 AM
around this issue The answer is No.
In order to authenticate the Instagram user they need to be directed to Instagram. On successful login Instagram will return the user back to your site or another URL of your specification. (this is the redirect Uri)

instagram api app access token


Tag : api , By : user116330
Date : March 29 2020, 07:55 AM
wish help you to fix your issue There are no life long tokens by design. You'll have to implement logic to refresh a token when it expires. There is no way around this, you have to use an access token and you have to deal with the fact that tokens expire. It's on you, as the developer, to implement logic. From the documentation:

how to handle Instagram access token expired error


Tag : objective-c , By : Angel Paunchev
Date : March 29 2020, 07:55 AM
Related Posts Related QUESTIONS :
shadow
Privacy Policy - Terms - Contact Us © scrbit.com