issues getting events data using facebook graph api v2.5 - facebook

Hello i'm trying to get some event information using the facebook graph api v2.5 but I keep getting the error message facebook.GraphAPIError: Unknown path components: /144259682284406. It works without the fields when I don't specify v2.5 however I need to use v2.5 to get the necessary fields
/v2.5/144259682284406?fields=events{name,id,timezone,start_time,end_time,picture,description,category,type,attending_count,interested_count,declined_count}
Blockquote

The exact same request worked in Graph API Explorer or when calling the API via URL directly – so it must have been something in how you pass the parameter in your SDK code.
Checking http://facebook-sdk.readthedocs.org/en/latest/api.html it turns out, that the API version has to be passed when the facebook.GraphAPI object instance is created,
graph = facebook.GraphAPI(access_token='your_token', version='2.2')
That way the SDK will take care of putting that version string into the URLs that the API requests are made to by itself, so that you don’t have to take care of that any more in the following code where you make the API calls.

Try this ;)
The id 144259682284406 you are using is a page object and if you want to get page events you should query like this:
page/events/?fields=field1,field2,... in your case:
/v2.5/144259682284406/events/?fields=name,id,timezone,start_time,end_time,picture,description,category,type,attending_count,interested_count,declined_count

Related

Facebook Insights API not returning store visits data

I am trying to retrieve Store Visits data from the Facebook Insights API. Based on their documentation, these should be available by specifying the following parameters:
store_visit_actions
cost_per_store_visit_actions
When I use store_visit_actions as a parameter, no data is returned. I know data exists because it is displayed through their UI reporting tool.
When I use cost_per_store_visit_actions, I receive a 100 invalid param error:
cost_per_store_visit_actions is not valid for fields param.
These params are listed as "In Development", however, I'm retrieving other development parameters without issue. Is anyone facing the same issue or know how to fix?
this is because the metrics
store_visit_actions
cost_per_store_visit_actions
are deprecated in facebook api v11.0. You can checkout this link:
https://developers.facebook.com/docs/graph-api/changelog/version11.0/

Workfront API Unknown Object Type

I'm getting an error when trying to reference different object codes using the workfront API. When I try to do a https://company.attasksandbox.com/attask/api/arvpth/search
I get the following response:
{"error":{"class":"java.lang.IllegalArgumentException","message":"Unknown object type: arvpth in v2.0"}}
I know the object code exists because it's in the API Explorer. The only thing that's got me confused is that the error displays v2.0, if this means it's trying to use the API versioin 2.0 then, yes the object code did not exist in that version. So does anyone have an idea on why is it trying to use v2.0 instead of the current v4.0 of the API?
Thanks!
In order to use v4 of the API, you have to append api/v4.0/ to your link, ie, https://company.attasksandbox.com/attask/api/v4.0/arvpth/search
At least, that is what I had to do in my version of the environment. Hope this helps.

facebook4j post from is null

I am using the Facebook API from Java with Facebook4j.
I have two servers, on the one that uses Facebook 2.3 API when I get the from of a post,
Post post = connection.getFeed().get(0);
post.getFrom();
I get the user, but in the server that uses Facebook 2.4 API, the from is null.
Any idea? I don't see any documented change in the fb API.
As described in the Facebook Platform Changelog, as of v2.4, you now have to manually specify fields if you want them to be retrieved:
To try to improve performance on mobile networks, Nodes and Edges in
v2.4 requires that you explicitly request the field(s) you need for
your GET requests. For example, GET /v2.4/me/feed no longer includes
likes and comments by default, but GET
/v2.4/me/feed?fields=comments,likes will return the data. For more
details see the docs on how to request specific fields.
According to the docs on Post, the relevant field is named from. To request this field in the me feed using Facebook4J, you can use a Reading object, as follows:
facebook.getFeed(new Reading().fields("from"))

Confluence Prototype REST API - create a page?

Is it even possible to create a page using the Prototype REST API?
I know how to do this using the REST API (available with Confluence 5.5 and up), but I'm not sure how to do this on older versions.
For new api, I do it like that: {url}/rest/api/content and provide parameters like type, space, title and ancestors.
For the Prototype API I've tried to do:
{url}/rest/prototype/latest/content.json and provide the same parameters, but I get "Request failed: method not allowed (405)" in response.
Turns out, the prototype REST API is read-only.

Facebook graph api - Unsupported get request

I'm creating a custom module in Drupal, that for part of its functionality must fetch posts from a business page. So for simplicity, I'm using fbapp module as a dependency (drupal.org/project/fbapp), so that I can use it's authentication and request functions (fbapp_app_authenticate() and fbapp_graph_request()) without having to worry about the constant facebook graph updates making my own code obsolete.
I've created a facebook app, so authentication should be app token, using appid and app secret. This seems fine and I'm getting back access_token. However, when I try to read posts from a publicly available page (the clients), I get the response:
"Unsupported get request. Please read the Graph API documentation at https:\/\/developers.facebook.com\/docs\/graph-api"
Here's the queries and responses my code produces:
graph.facebook.com/oauth/access_token?client_id=<redacted>&client_secret=<redacted>&grant_type=client_credentials
array(1) {
["access_token"]=>
string(43) "<redacted>|<redacted>"
}
graph.facebook.com/<page_id>/posts?access_token=<redacted>|<redacted>"
string(183) "{"error":{"message":"Unsupported get request. Please read the Graph API documentation at https:\/\/developers.facebook.com\/docs\/graph-api","type":"GraphMethodException","code":100}}"
Can anyone verify a correct way to query a Facebook page programmatically, perhaps there's a setting in the page I'm querying that I need to set (although I can't find anything)?
If page restrictions apply, the page's feed can only be retrieved with an user access token as far as I know (because FB needs to evaluate the visibility criteria, and setting your app to the same restrictions doesn't help here):
See
https://developers.facebook.com/docs/graph-api/reference/v2.4/page/feed#readperms
It looks like everything you have done is correct. The response you got can be (i am not sure) because you got your clients pageid wrong.