I created Facebook developer app to let my users posting to their Facebook pages/groups via API. I completed app review process for all required permission to be able to post on pages. But I am unable to request advanced access for Groups API which is required when I want to get my app approved for these 2 permissions: groups_access_member_info, publish_to_groups.
When I add these permissions and start the app review process it shows alert that I need to add Groups API as well. Full alert message: "You must also add Groups API to this submission before you can submit for review. You must also add Groups API to this submission before you can submit for review."
This error message is clear but the problem is button is grayed out so I can't add this permission for app review process:
It says I need to make a successful API call to groups endpoint to activate that button which I did already. I waited for a week after that API call but button is inactive still.
Requests I made to make that button active:
curl -i -X POST \
"https://graph.facebook.com/v15.0/[GROUP_ID]/feed?message=Hey&access_token=[REDACTED_ACCESS_TOKEN]"
curl -i -X GET \
"https://graph.facebook.com/v15.0/[GROUP_ID]/feed?access_token=[REDACTED_ACCESS_TOKEN]"
curl -i -X GET \
"https://graph.facebook.com/v15.0/[GROUP_FEED_ID]/?access_token=[REDACTED_ACCESS_TOKEN]"
All these three calls return successful repsonses (on development mode, of course).
Related
I registered my app at the App Dashboard. I got an app ID and an app secret code on the app dashboard.
Then I was able to generate a bearer access token:
curl -X GET "https://graph.facebook.com/oauth/access_token?client_id={MY_APP_ID}&client_secret={MY_APP_CLIENT_SECRET}&grant_type=client_credentials"
Then I try to get the metadata with call:
curl -i -X GET "https://graph.facebook.com/{AN_ID_OF_A_USER}?metadata=1&access_token={ACCESS_TOKEN_GENERATED}"
Unfortunately the later call works only with my own user ID, and not with any other user IDs. I get an error message with other user IDs:
{"error":{"message":"Unsupported get request. Object with ID '12345678910' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https:\/\/developers.facebook.com\/docs\/graph-api","type":"GraphMethodException","code":100,"error_subcode":33,"fbtrace_id":"xXxXxXxXxXxXxXxXxXxX"}}
What should I do or set, and where to be able to get metadata of other users? I would like to be interested in the relationship status of specific users, to get this metadata field programmatically.
There is no way to get IDs of users who did not authorize your App, and there is no way to get any other data of users without authorization. So if the user in question did not authorize your App, he will be completely unavailable.
I'm just getting set up with the ads api at my work using cURL. I've been able to successfully authenticate and get data about my ads and I am now trying to create a newsfeed creative for the page. (Specifically one of the new multi product ones, but this example will just be for a basic "object_story_spec" creative).
When I try to post the creative, I get this error:
{"error":{"message":"(#272) This Ads API call requires the user to be admin of the application. User <page_id> not admin or developer for application <app_id>.","type":"OAuthException","code":272}}
Essentially it seems to be telling me that the page needs to be listed as a developer or admin on the app, but I tried this and there is no option to do that. What am I missing here? I am guessing it is some sort of issue with how I generated the access token, which is a page access token generated from the graph api using my own access token that I generated. Any help is tremendously appreciated!
Here is my code (anything in <> was redacted by me):
curl https://graph.facebook.com/act_<account>/adcreatives
-F "name=Link Page Post Ad Creative"
-F "object_story_spec={'page_id':<page_id>,'link_data':{'message':'Try it out','link':'http://example.com','picture':'http://example.com/pic.jpg'}}"
-F "access_token=<access_token>"
I am building a facebook app and for that I need to create a fake fb user for each user that signs up into my app.
Is there an api available for creating facebook users?
Any help is appreciated.
For testing purpose you can create test user with API. The document is provided here. By specifying installed=true parameter, your app is authorized by default. It's just easy as below:
curl -X POST \
-d "installed=true" \
https://graph.facebook.com/{app-id}/accounts/test-users
Is it possible to change a test user's password so I can logon to any of my test users as normal so I can test my app properly?
I've tried :
https://graph.facebook.com/{user id}?password={newpassword}&method=post&access_token={the access token}
I got the access token from the Roles screen where all my test users are listed. The above link returns :
{
"error": {
"message": "Invalid OAuth access token.",
"type": "OAuthException"
}
}
What am I doing wrong? And is there another way to change the password?
I have 15 or so test users and I need to be able to log in as any of them. Only my main test user is registered with my app, the others are friends of the main test user (this is by design)
I tried creating lots of normal users to test with and quickly realised Facebook do their best to stop people doing this
Thanks
Yes - You can. However I have tried only manually - it works.
You have to be admin of application for which users You are editing
Go to FB Developers page -> Click 'Edit Roles'
At the bottom of the page there will be all users listed, each having option to set password next to its profile photo. Just Click and change.
Hope that helps a bit. As it is not a solution to set manually password for 25 users. But if it is not possible to do it manually then it won't be possible with API. worth to try, just to identify error.
Yes - creating real users for testing purposes is not an option
This is very Easy by using even APP Dashboard as follow
All though you can use Graph API for the same ,with User APP Access Toke or User access Token (If user ID is accessed) for this Process
Here is Python script of the same
For some reason, Facebook's documentation says that you should do an HTTP POST, but the example they show uses a query string, not post data.
Try submitting all query parameters as post data:
curl -H "Content-Type: application/x-www-form-urlencoded" \
--data "access_token=<facebook app access token>&method=post&name=<full user name>&password=<password>" \
-X POST 'https://graph.facebook.com/<facebook test user id>'
I would like post some message as another user (not currently using the app). Is it possible? Of course, I would like use user which allow to get access my app.
When a user goes to your app, you can ask him for the extended permissions 'offline_access' and 'publish_stream'. With these permissions, you should be able to post as that user, even if he is not currently visiting the app.
More info about extended permissions can be found at http://developers.facebook.com/docs/authentication/permissions
edit:
You can publish to the Facebook graph
by issuing HTTP POST requests to the
appropriate connection URLs, using an
access token on behalf of the user or
an application access token (for Open
Graph Pages). For example, you can
post a new wall post on Arjun's wall
by issuing a POST request to
https://graph.facebook.com/arjun/feed:
curl -F 'access_token=...' \
-F 'message=Hello, Arjun. I like this new API.' \
https://graph.facebook.com/arjun/feed
so basically you retrieve the access token when the user authorizes your application, and store it for later use.
Quote found at http://developers.facebook.com/docs/api