Real Time Update not working for some fields? - facebook

I'm checking wich fields from the User object are susceptible to RTU (real time updates); in the documentation it says:
The User object supports Real-Time Updates for all fields except the
verified property.
But, so far, for this fields:
video upload limits television significant other favorite_teams
favorite_athletes political interested_in bio updated_time
third_party_id gender user_likes languages
I've got this message:
{"error":{"message":"(#100) \"SOME_FIELD\" is an invalid field name","type":"OAuthException"}}
My application has the necessary permissions, checked by using this method (taken from this url):
https://api.facebook.com/method/users.hasAppPermission?ext_perm=SOME_PERMISSION&uid=UID&access_token=ACCESS_TOKEN_FOR_MY_APP
Am I missing something? Those fields are working for someone else or is just me?
Thanks.

I've tried the same. Facebook seems to be a little slow here. They did not implement all fields in the RTU. You can find a list of available fields here (under objects): https://developers.facebook.com/docs/reference/api/realtime/
However, even this list does not seem correct, as I did not get for example television to work either.
It is kind of odd to ask for the object "user" to get notifications about you page.. This all does not seem to be finished yet..

Related

where is the “Recently Used”,“In Active Adverts”, "Action Needed", "Shared" filtering based from facebook custom audience data?

If you go to business manager of facebook, then go to the "All Audiences", then under the "Audiences" tab, you will see a "Filters" button right beside the "Create Audience" button. Now my question is, which part the json data being provided by the facebook apis should I based the data that I should pull out based from these filters ?
- Recently Used
- In Active Adverts
- Action Needed
- Shared
Because unlike the "ready" and "not ready" status, those four filters that I mentioned are not straight forward where I can just look for the numbers from the returned json data. so how ?
Most likely, not all of this information is available through the API.
However, if you take a look at the following doc, you can see some reelvant fields that may help:
https://developers.facebook.com/docs/marketing-api/reference/custom-audience
Most likely you can use the field operation_status to look at whether an audience needs action.
For whether it's shared, take a look ad the edge adaccounts which will let you see the ad accounts this audience has been shared with.
For recently used, you'll probably have to look at the edge ads and review the status of the ads.
To save having to make multiple requests, you can take a look at field expansion in the Graph API, which will let you query for fields of objects in results using a single request:
https://developers.facebook.com/docs/graph-api/using-graph-api#fieldexpansion

Facebook Marketing API some field are not shown

I have a development level access to Marketing API and it looks like I cannot read some fields of specific objects.
For example I try the following call:
You can see that promoted_object, link_url and object_url are not displayed in the result. And I should have one of those three value as the Ads was ad to promote "web site click".
Is it a bug or a limitation of the development acces or I am doing something wrong?
It is true that not all fields are readable by all apps, however in the case above it is most likely that these fields are empty on that object and therefore not returned in the response.
Promoted object, for example, is required on the adset level now, however it may be the case the adset you are trying to read is very old and therefore does not have one specified.
In regards to the creative fields, again not all creatives have these fields and in the case they are empty, are not returned in the response. You should check the promoted_story_id to see if this contains what you're looking for.

Can't submit Facebook Ad with api, new error code Your ad is ineligible for News Feed targeting

I was having trouble submitting an ad through the Facebook ads api, like I was doing before.
It seems a new problem has come up. The Api of course only gives me a generic error "Invalid Parameter" however in the past I noted this this comes up for basically any reason that ad creation fails and does not tell you anything specific. In a different situation I used curl to the Facebook graph because I noted that it will give you additional information. However not much more in this case. Note the error message below the code.
curl -X POST -F "name=Ad Administrator_15"
-F "campaign_id=xxxxxxxxxx995" -F "creative={'creative_id': xxxxxxxxxx795}" /
-F "adgroup_status=PAUSED" /
-F "access_token={access_token}" / "https://graph.facebook.com/v2.2/act_{account_id}/adgroups"
This is the error received
{"error":{"message":"Invalid parameter","type":"FacebookApiException","code":100,"error_subcode":1487757,"is_transient":false,"error_user_title":"Ad Ineligible for Feed Targeting","error_user_msg":"Your ad is ineligible for News Feed targeting."}}
In checking on the facebook ads error message page. The error is not even
listed, though many others are.
previously I was getting the invalid parameter message back from the API just because I had not put a payment profile on my ad account. But used curl instead to find out this message. But after that I was creating ads just fine. Seems like this is a new problem.
If I could ask Facebook directly. I would ask "Hey can you put some descriptive error messages on your failures so that developers can see how to fix problems?" I guess that's too much to ask.
Anyhow, I may note here that The Campain was newly created with the api, then the adset, then the ad creative with the ad image, all created fine with recorded IDs (I masked these ids mostly in the code shown here for security reasons). When using these id's even outside of the API with curl I get the failure noted. Here is what shows in the API for an error with the trace.
Invalid parameter
/var/www/turnkey/vendor/facebook/php-ads-sdk/src/FacebookAds/Http/Client.php(191): FacebookAds\Http\Exception\RequestException::create(Array, 500)
#1 /var/www/turnkey/vendor/facebook/php-ads-sdk/src/FacebookAds/Http/Request.php(276): FacebookAds\Http\Client->sendRequest(Object(FacebookAds\Http\Request))
#2 /var/www/turnkey/vendor/facebook/php-ads-sdk/src/FacebookAds/Api.php(140): FacebookAds\Http\Request->execute()
#3 /var/www/turnkey/vendor/facebook/php-ads-sdk/src/FacebookAds/Api.php(182): FacebookAds\Api->executeRequest(Object(FacebookAds\Http\Request))
#4 /var/www/turnkey/vendor/facebook/php-ads-sdk/src/FacebookAds/Object/AbstractCrudObject.php(248): FacebookAds\Api->call('/act_xxxxxxxx40...', 'POST', Array)
#5 /var/www/turnkey/application/modules/Ads/models/FacebookAdsApi.php(473): FacebookAds\Object\AbstractCrudObject->create()
Here is a thought, if anyone, including someone at Facebook since they own this site, could tell me what is going on, I would really appreciate it.
Thanks in advance.
The Facebook documented required length for the message body for an ad Creative is that it needs to be a minimum length of 1 character and a maximum length of 90 characters. Before what would happen is that ads could be created. Even with test content in the title and body of your ad. Then they would not be approved if Facebook did not like the content. Such as messages like "test title, test body" and things like this. Facebook seems to be evaluating the text on submission now, rather than on ad approval. I guess they want to cut down on unnecessary ad approvals. So with out updating their documentation. It seems there are new requirements for the body field. And perhaps the title field.
All I did was lengthen the body of the ad message from 17 characters to 38 characters. This did one of two things. It made the field long enough to pass a new undocumented restriction, or, by adding some more words to the text they decided that it wasn't test message.
Here is the problem with that thinking on their part though.
1 I am paying for the ad, I should be able to put the content I want in it. As long as it is meaningful and doesn't violate some obvious certain policies for content such as obscenity etc.
2 If it's about the length rather than the content. My ad that I am paying for that only has 17 characters, should be required to be longer if I just want to say something short.

How can I query public facebook events by location/city?

I've been trying to figure out how to do this, and was thinking it wasn't possible, then found this website: (Removed due to a dead link)
You can search by city there and I have no idea how they do it? The normal graph API's don't allow searching for events by location as far as I can see. Any advice/tips/info would be great!
Updated 2014-07-02
You can't directly search the Facebook API for events near a location. Since originally giving this answer, the Graph API has made it harder to search for events.
The Elmcity script referenced by the OP does a simple search for a keyword in the event title. Try "Lancaster" for example. You'll get events that have the word Lancaster somewhere in their metadata.
Their query looks something like this:
https://graph.facebook.com/search?q=lancaster&type=event
You can also search for a non-location based word in the title like "picnic" and the script returns events.
For the problem of actually finding events near a location, in the current iteration the "venue" field is only a string, so it has no relationship to any Facebook place. Running these query returns nothing:
https://graph.facebook.com/madisonsquaregarden/events
https://graph.facebook.com/108424279189115/events
So using a batched request isn't even a possibility.
According to the documentation FQL seems to be a better solution. In the event documentation, the venue.name column is indexable! Easy, right?
Wrong. When you run this FQL query to find events at some location like this:
SELECT name, start_time, venue FROM event WHERE CONTAINS("madison square garden")
You find that venue.name isn't populated.
Trying any other variation like:
SELECT name, start_time, venue FROM event WHERE venue.id = 108424279189115
Throws a "statement not indexable" error.
So while building a "Facebook Events Near Me" is the killer app, the only way that it seems possible is to search for common strings for events near you, get those events, then filter out irrelevant events from the result set.
This JavaScript library on GitHub seems like an interesting approach to look at. It uses a places search and then does an events search on those places.
tobilg/facebook-events-by-location-core
As of recent. the Events end points have been deprecated due to the privacy issue.
Your app will now need to be reviewed first to access events api, when it resumes.
Events and points has been deprecated due to privacy issues. Now you have to review your app before you can access events api. After successful approval you can search events.
So what you can do is enter "Events", but you need to enter the date, or tomorrow after that. Then, on the right, in your filters, enter the location field, select other, then punch in the location you want.

What are the "base URLs" for status, photos, etc?

I developed an app that looks for specific terms using the facebook api (search).
Every result comes with an ID for the item that can be of many types like "status","photos",etc.
I remember that some time ago I could surf facebook and get this URLs from the browser address bar, but now with some updates that facebook has made it seems to be all AJAX based calls and it seems like you do not have a "specific page" for each item.
I looked over the web and could not find anything regarding this.
Is there any way I can get a "photo id" from the API and open it like "http://facebook.com/photos/0293820293842"?
Thanks for any clue.
https://graph.facebook.com/{id}/picture
https://graph.facebook.com/40796308305/picture (by page id)
https://graph.facebook.com/cocacola/picture (by page's name)
https://graph.facebook.com/4/picture (by user id)
https://graph.facebook.com/4/zuck (by user name)
after some time I just gave up trying to get the picture from the data provided by the search API.
From the api I get entries of type "photo" but they do not match with the API documentation found at http://developers.facebook.com/docs/reference/api/photo/ since I do not receive the fields "picture", "source" or "images" (they just does not exist in the results from a search)
Looking to find a way to use the approach of "setting up the URL from the fields received from the API" I could not get any sucess either.
That's one case... I set up a search for "pepsi"... and within the results I got a "photo" object.
In this object I have the following fields:
id: 100002307882828_188072634633218
author\id: 100002307882828
link : "http://www.facebook.com/photo.php?fbid=320417371337648&set=a.133681116677942.17717.131381520241235&type=1" (this link really points to the photo's page, but is not the photo itself)
object_id: 320417371337648
I used the URL you provided as a "base" and tried to setup some combination that returns me a photo but I always get "Content not found" as result.
The only way I could find the final photo URL is to make another call to the API using the Photo Id as parameter (but I would need to do a lot of calls to the API and this just do not fit my scenario)
If I call https://graph.facebook.com/320417371337648 I get everything I need from the photo, but this is the "another call" I would need to perform for each result I get.
Thanks a lot for your help,
Regards,
Victor Reboucas