when I post a comment in the instagram.It reminds me "This client has not been approved to access this resource." I don't know where to go wrong.
POST DATA:
https://api.instagram.com/v1/media/1114266205241331779_282407163/comments?text=this train is test data& access_token=xxxxxxxxxxxx
Response:
{"meta":{"error_type":"OAuthPermissionsException","code":400,"error_message":"This client has not been approved to access this resource."}}
Related
I'm getting really frustrated with the new Instagram API, what I need to do is just get things like pictures, comments, and likes from my Instagram feed. I'm following all the steps that they mention over here https://developers.facebook.com/docs/instagram-basic-display-api/guides/getting-access-tokens-and-permissions, but I'm still not able to get the final access token I need in order to interact with the API. After getting a lot of different errors now I'm stuck with:
{"error_type": "OAuthException", "code": 400, "error_message": "Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request"}
I have verified everything in my Facebook developer setup and everything is ok, the OAuth URL is identical to the one I'm using in the curl command in order to return the access_token and all the setups seem fine. I have noticed that a lot of people are having the same problems but I can't find something that works for me.
This is the way I'm trying to retrieve the access_token:
curl -X POST https://api.instagram.com/oauth/access_token -F client_id=[client_id] -F client_secret=[code] -F grant_type=authorization_code -F redirect_uri=[url] -F code=AQDJxpW5h4r..
I have read that people are using postman and apparently it works over there but I don't know how to use it, any help will be really appreciated.
Upgrade on this, I was finally able to get the access_token via Postman and when I'm trying to use it now I got this error:
{"meta": {"code": 400, "error_type": "OAuthAccessTokenException", "error_message": "The access_token provided is invalid."}}
This is really disappointing, everything was working just fine before this API change. Any ideas?
Just review of the following in your checklist again:
APP_ID and APP_SECRET of "Instagram APP", which is a product added in the Facebook App.
Access Code once submitted in POST request using CURL or Postman, will become invalid for the next request.
The Website Platform is added in "Facebook App".
Test Instagram Users are added and are not pending.
Lastly, Authenticate using the Instagram Test User Profile.
I had the same issue, and actually lost some time solving it.
In my case I only made the configuration in Instagram Product but didn't change the configuration in the login by facebook product.
In summary, you should have in your app in Facebook developers, two products, one Login by Facebook and the other one Instagram. Both must have the same redirect URL.
Hope this helps.
I`m using Analytics Reporting API in my project to retrieve amount of users currently surfing my website. Consider following code:
gapi.auth2.init({
'clientId': '<Client_ID>',
'scope': 'https://www.googleapis.com/auth/analytics https://www.googleapis.com/auth/analytics.readonly',
}).then(function(authData) {
/*1*/
return gapi.client.request({
'path': 'https://www.googleapis.com/analytics/v3/data/realtime?ids=<VIEW_ID>&metrics=rt:activeUsers&dimensions=rt:latitude,rt:longitude'
});
But when i set debugger on the line with /*1*/ and want to investigate what`s inside "authData", in the developer console i see following:
>JSON.stringify(gapi.auth2.getAuthInstance().isSignedIn)
>"{"Ab":false,"Aia":{"value":false},"hg":{"hg":[]}}"
And inside authData i have following:
>JSON.stringify(a.currentUser)
>"{"Ab":{"El":null,"Zi":null},"Aia":{"value":{"El":null,"Zi":null}},"hg":{"hg":[]}}"
That indicates abscence of authenticated user, i presume.
Furthermore, http response for authentication request returns following error
>{error: "IMMEDIATE_FAILED", detail: "Not all scopes are approved."}
The question is: what does it mean and where can i approve those scopes by myself or maybe there is somone from Google who should approve scopes for my requests. Thanks.
Well i acidentally stumbled upon this solution. The reason for scopes to seem unapproved is that the application is not accepted inside an google account as capabke of accessing analytics data (and it's crucial as i use oAuth2 clientID bound to that particular account). So the solution is to allow your project to have access to your account. Sadly there is no such statement in api's docs, nor any example was found also.
I'm trying to provide login using google/facebook/twitter. All three are configured with the following urls for authorize concent redirects:
google: https://accounts.google.com/o/oauth2/auth
facebook: https://www.facebook.com/dialog/oauth
twitter: https://api.twitter.com/oauth/authorize
When a redirect happens, following params are added:
client_id=
redirect_uri=
response_type=
state=
scope=
Both google and facebook are happy with it and show a login screen (if you are not logged in) or the consent screen.. happily everafter!
But twitter seems to be upset, says: Whoa there!
There is no request token for this page. That's the special key we need from applications asking to use your Twitter account. Please go back to the site or application that sent you here and try again; it was probably just a mistake.
Sample Url: https://api.twitter.com/oauth/authorize?client_id=3698443421GbH3698443421hj&redirect_uri=http://localhost:8080/connect/twitter&response_type=code&state=V2aPvq
Why?
I am writing a code in salesforce to update Email signature using the API documentation mentioned in https://developers.google.com/admin-sdk/email-settings/. I am using a 3 legged approach.
Considering that this is an API for domain admins, My questions is
can a user ( non - admin) provide authorization for this API ?.
And can the access token returned as a result of this authorization be used to update his email signature. ?
Right now I am getting an Error 403- "you are not authorized to access this API
Note that this is working fine if a domain admin provide authorization and his access token is used to update his/ any user's email signature
Thanks for your help
With the new updates on the GMAIL Api you can get the user signature by using the method "Users.settings.sendAs: get" explained here https://developers.google.com/gmail/api/v1/reference/users/settings/sendAs/get and it does not require the user to be an admin. This method returns a Users.settings.sendAs resource in the response body and this resource contains the property signature which you can manipulate.
Hope it helps!
I'm having trouble getting an oauth token from Behance. I'm familiar with how oauth works and I've followed the steps outlined here: https://www.behance.net/dev/authentication
My redirect_uri matches what I setup in my behance account, and is it is also url-encoded.
https://www.behance.net/v2/oauth/authenticate?client_id=MYCLIENTID&redirect_uri=URLENCODED_REDIRECT&scope=wip_read|wip_write&state=54fde3ee43d79f4d1d1944f5984d686e
When I go to this page, I'm getting an "Oops! No longer supported" and "This page has been removed." Is oauth even available?
My app is set to development, but I should be able to access my own account with that setting. I'd figure this is pretty straight forward, but maybe I'm missing something. I've contacted their support and have received no feedback.