Can't get comment scope - php

I am working with the Instagram API and want to get permission to post comments on behalf of the users. But somehow it does not work.
The request link:
https://instagram.com/oauth/authorize/?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&response_type=token&scope=comments+likes
When this link is going to be opened, I get asked to give permission for basic information and liking, but not for commenting...
And now after I give permission and want to add a comment with the API, it returns a 400 error:
{"meta":{"error_type":"OAuthPermissionsException","code":400,"error_message":"This request requires scope=comments, but this access token is not authorized with this scope. The user must re-authorize your application with scope=comments to be granted write permissions."}}
What am I doing wrong? Is it not possible to get the comments scope? I do it like Instagram describes it on this link on the very bottom
Instagram Authentication

Did you complete the following form?
https://help.instagram.com/contact/185819881608116
It looks like you must complete the form before your app will have access to the POST comments endpoint.

Related

Facebook graph api returns "Unsupported get request" when I try to get a post data created by my app using the post user access token

I have a Facebook application that posts on behalf of the users (approved by Facebook), According to the graph API documentation I should be able to call
/{post_id}?access_token={PostUserAccess_token}
In Documentation, in Permissions paragraph, there is written:
A user access token can read any post your application created on behalf of that user.
I'm using the same post id (ex: XXXX_YYYYY) returned after the post, and the user access token to make the call but I get this error:
"message": "Unsupported get request. Please read the Graph API documentation at ....",
"type": "GraphMethodException",
"code": 100,
Any idea what are the possibilities of this to happen?
The same thing is happening to me. This GET request was working a few days ago. I think the problem is with the Graph API.
Whats funny is that you can make POST request with the same parameters (you have to add something to change like message='TEST') and it will allow you to edit the post if you access token is working.

Foursquare invalid grant error

i am new to foursquare and i wish to have autofill textbox by foursquare api. For this i referred to https://developer.foursquare.com/overview/auth and have registered my app with foursquare. When I write
https://foursquare.com/oauth2/access_token
?client_id=YOUR_CLIENT_ID
&client_secret=YOUR_CLIENT_SECRET
&grant_type=authorization_code
&redirect_uri=YOUR_REGISTERED_REDIRECT_URI
&code=CODE
in browser url (all parameters replaced), i get the following error:
{
"error": "invalid_grant"
}
How do i solve this? How do i implement autofill textbox?
Extending pfhayes answer: CODE is not a constant. Your are supposed to actually replace it with a real code.
It can get confusing, because at some point during the auth flow, there are constants such as code and access_token that should be taken exactly ad in the example.
The code you supply must be the code returned by a successful user authorization, as seen here: https://developer.foursquare.com/overview/auth. When a user authorizes your app with foursquare, they will be redirected to your page with a code HTTP parameter. This code will be the code you exchange for a valid access token.

main-address not returned from linkedin api

I am using the javascript api to get the profile information from linkedin. For that the url passed is -
https://api.linkedin.com/v1/people::(~):(id,first-name,last-name,picture-url,main-address,headline,industry,summary,location,positions)
I am getting all the fields from this api except main-address. When I see the response in console it does not show the mainAddress field.
There is an address to that linkedin profile.
Does there need to have other field other than main-address?
Any help appreciated !
Thanks.
If you need the main address of the authenticated LinkedIn user, take a look to the 'r_emailaddress' scope permission.

Howto use FB Graph to post a message on a page feed

I have created an app, and now i want to post a message on one of my pages wall with use of the new Graph API. Is this do-able?
below is the steps which i do
Using this to Get access code
https://www.facebook.com/dialog/oauth?client_id=1498653617947&redirect_uri=https://apps.facebook.com/post_on__my_page/index2.html&scope=email,read_stream,publish_stream,manage_pages,offline_access
Than use this to get access token
https://graph.facebook.com/oauth/access_token?client_id=1498653617947&redirect_uri=https://apps.facebook.com/post_on__my_page/index2.html&client_secret=seceret&code=AQDCqJNJnCvnFKVdbCyTp2vfzbT0ADbNgYsQ_2YtDdC_O2aIOwvkjx52HNcp3uiuBANJqOhb_M2sptB-lRrIECZxi5kZpzljez1J1oOtTp25gTnNDmV-RCVvR97DMiRAprNtwUBcstAotjsyYo5cNwJCWnkcgNigwhbQtE5Jp22sluVcZKhnO43cWQE#_=_
Now get page id and page access token from below
https://graph.facebook.com/me/accounts/?access_token=the_access_token_above
*use this to post on my page *
https://graph.facebook.com/1916117518646/feed?message:testmessage&access_token=aceess_token
any one please explain which point is wrong because instead of posting is just show posts details
i found that some thing wrong in this below code any one please suggest what and how to do
https://graph.facebook.com/1916117518646/feed?message:testmessage&access_token=aceess_token
I always highly suggest to people experimenting around for the first time to use the Graph API Explorer tool. It helps solidify the structure of the Graph and how to access it. See https://developers.facebook.com/tools/explorer
Another thing I always recommend is to lint the access_token you are trying to use. See https://developers.facebook.com/tools/lint. This is to ensure you have the right token with the correct permissions.
Also the access_token you use to post to a page must be a page token and not a user token. In your above example, it's unclear as to which one you're using since you've named both the same. I know you said you're using it, but with that variable name being the same, I always wonder.
Also the you need to do an HTTP Post and not an HTTP get to post a message. Again, play around in the graph API explorer until you can do it there. Once you've done it there, it's fairly trivial to do it with one of the SDKs.
You need to perform POST request, not GET, and pass parameters in POST body, not in the url
http://developers.facebook.com/docs/reference/api/user/#posts
http://facebook.stackoverflow.com/questions/691425/how-do-you-post-to-the-wall-on-a-facebook-page-not-profile

How to post to facebook wall once I've got the access token

I'm making a facebook app and have got as far as getting the user to allow my apps permissions, which then generates a code. Then using this code to get an access token. So I now have a variable in my PHP script containing the access token. Now how do I use this to post to the users wall?
The easiest way to post a message on the wall is through the graph api. You require the publish_stream permission to post status messages. You can simply do a POST with the desired message and the access token.
See the official facebook documentation for more details: http://developers.facebook.com/docs/reference/api/status/
Facebook changes their API so often, it's best to read their docs, if those are up to date...
Check in IRC #facebook as well.
But basically, you pass that token in to the API call somewhere, somehow and it's in their docs somewhere.
Unless FB has decided you don't need it or ignores it or doesn't want to allow that this week.

Categories