I am using Graph API Explorer to try and work out how to create a user event prior to coding it for real in Objective-C for an iOS app.
I have obtained an auth token which contains user_event, publish_actions and create_event permissions.
I am POSTing a request to https://graph.facebook.com/12345678/events with parameters of name set to Tester 2 and start_date set to 2013-06-27
In response I get
{
"error": {
"message": "(#100) Invalid parameter",
"type": "OAuthException",
"code": 100
}
}
I can't see what I'm doing wrong. Any help would be much appreciated.
Thanks
Andrew
It's because you need to use start_time instead of start_date.
Doc reference:
https://developers.facebook.com/docs/reference/api/event/
Related
I would like to connect our klipfolio dashboard with the facebook graph api. The problem is that somehow the facebook documentation does not seem to comply with the actual statement needed in order to return any results.
Here ist my statement according to facebook: FB-Documentation
https://graph.facebook.com/v8.0/{mySite-ID}/insights?metric=(post_impressions_paid,post_impressions_organic)
The Error Message I receive when trying to execute this statement either with klipfolio or via the facbeook graph api explorer ist
{
"error": {
"message": "(#100) The value must be a valid insights metric",
"type": "OAuthException",
"code": 100,
}
}
Do you know what I'm doing wrong?
Thank you for your help.
Greetings from Vienna,
Christian
PD: be kind, I'm both new to this forum and also no developer ;)
I read the example of Graph API document at this: https://developers.facebook.com/docs/graph-api/reference/privacy/, and try to get the privacy of specified post but no luck. The link I tried is:
https://graph.facebook.com/me/?fields=value&access_token=<my token>
Response:
{
"error": {
"message": "(#100) Tried accessing nonexisting field (value) on node type (User)",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "DSUBZSZdJT8"
}
}
Please help me.
The error message is very clear, there is no field called "value" in the user table - which is exactly what you are trying to access with the /me endpoint. This would be the API call to get the privacy setting of a specific post:
https://graph.facebook.com/{post-id}?fields=privacy{value}&access_token={user-token}
I was Unable to get the search result in Facebook Graph Api Explorer For Topic search API. I am getting the following error. I also have the access token included.
{
"error": {
"message": "(#15) This method must be called with an app access_token.",
"type": "OAuthException",
"code": 15,
"fbtrace_id": "CJiZqVSATXu"
}
}
Well, the error message actually contains the problem. You're not using an App Access Token, but seemingly an User Access Token (from the Access Token structure in your screenshot).
You must select an app of yours in the upper right Applications dropdown, and then select Get App Token in the dropdown below.
Still, that will probably not help much in this case. Are you aware that only whitelisted apps can use the Topic Search API?
See
https://developers.facebook.com/docs/graph-api/using-graph-api#search
https://developers.facebook.com/docs/mediasolutions/topic_search/v2.5
On Graph API Explorer I can do this search: search?q=Barcelona&type=event
But when I try the same with my app access token I get this error:
{
"error": {
"message": "(#200) Must have a valid access_token to access this endpoint",
"type": "OAuthException",
"code": 200
}
}
The other searches work well.
UPDATE 2017-11-27:
As Facebook doesn't allow an event search based on location anymore, I'd recommend to use https://github.com/tobilg/facebook-events-by-location-core
Original answer:
Please refer to https://developers.facebook.com/docs/reference/api/search/#access_tokens
There, it's stated that all searches except for pages and places require an user access token.
I wanted to publish a link on the given profile on Facebook via the app. Post to https://graph.facebook.com/PROFILE_ID/links with access_token and other necessary parameters.
For testing purpose, I got the access_token with Graph API Explorer and had the publish_stream and share_item extended permission.
Then I got the error
{
"error": {
"message": "An access token is required to request this resource.",
"type": "OAuthException",
"code": 104
}
}
I tried fb_id and fb_username for the PROFILE_ID but got the same error. Anything wrong?
Thanks
Yes. /links is read only. To create a link, you need to POST to /USER_ID/feed.
https://developers.facebook.com/docs/reference/api/user/#links