Facebook - interests required List<unsigned int32> although Page ID are strings - facebook

I currently developed a solution for custom uploading videos for specific customers.
One of my customers need the ability to specify "interests" for a video he upload.
From the API documentation, interests are:
interests
list
One or more IDs of pages to target fans of pages.Use type of page to get possible IDs as find Targeting Options and use the returned id to specify.
There is some mis-documentation regarding this feature: "find Targeting Options" does not talks about type=page.
But, still, I can search for page, using the "search" endpoint: /2.5/search?q=gsw&type=page and get the ID of the page.
As to my understanding, I can specify a page, for example "Golden State Warriors" fan page, specify its id, and then every user which follows this page will be considered as interested in my post.
So, I think my flow should be:
1) Search for the requested page using the "search" api. Get the page's IDS.
2) When creating the video, specify the ID in the "interests" parameter list.
Now, I need to know how to specify the ID in the interests list - The documentation says it list, but the page ID as a number string...
So in conclusion, I would like some help in verifying that all that I have written is correct and make sense, and also to know how to get the int32 id of a page - is it just mistake in the documentaion?
Thanks!

Related

Is there a way to display the Product Title before the Brand Name in Facebook Page Shop?

I exported all the tags required by Facebook from my third-party online store (Lightspeed) and the data stream works as expected in terms of automatic updates, but products on my facebook page shop (Shop tab) are displayed with the brand name first — L'Oratoire Saint-Joseph — followed by the product title.
See it live : https://www.facebook.com/osaintjoseph/
The unfortunate result is that the text under many products is exactly the same. Is there a way to display the Product Title before the Brand Name?
Lightspeed support told me I had to take it up with Facebook. I am awaiting their reply. See my questions in the fb developer forum here : https://developers.facebook.com/settings/developer/community/
There are 3 ways to add products to Facebook Shop:
Manually
Data feed (e.g. CSV import)
Third party plugins (which you’re using).
Manually – the user is only able to enter 4 properties; title, description, image & variant. See facebook.com/business/help/293945421560847. There is no concept of product brand.
Data feed – this allows for additional properties, such as brand name. In the table, see example files and select product (csv, tsv or xml) facebook.com/business/help/120325381656392?id=725943027795860. However it looks like all Facebook does is concatenate string, that's the product title becomes "{brandName} – {productName}". It look like brand name is not used anywhere else. Nor is there an option to change the way it's displayed. If you edit the product, you should be able to see this in the Product Title.
Shop tab (third party plugin) – (May be it's me, but I found their documentation hard to follow) – They send an XML feed to Facebook support.shoptab.net/hc/en-us/articles/200583466-XML-Feed-for-Facebook-Storefront-with-ShopTab. They do not appear to have a concept of brand. Try and examine the data. I would expect the brand name to appear in the product title. Alternatively they allow for CSV, which also doesn't contain brand name support.shoptab.net/hc/en-us/articles/200583906-CCNow-Integration-with-ShopTab-s-Facebook-Store-App
Summary
If possible, examine the data that is sent from Shop tab to Facebook.
Try and find out if you’re able to exclude / alter the string concatenation of brand name from product title in Shop tab. If not raise a support ticket with them.
Alternatively see if you can manually edit the product title in Facebook. It’s not a long-term fix, but helps understand how the system are integrated.

Facebook Graph API. How to get data from public page?

Sorry for my English.
There is needed to get email, site link, phone number, instagram link, country and city from each page returned from search request. I don't know why, but /{page-id} and /{page-id}?fields={field_name} requests don't return any fields besides 'id'.
How can I get this info by Graph API when I know id of the page?
You have to specify the fields you need in your request. Otherwise you only get a very lightweight page object ;)
In general Facebook sends the id and some name (depending on the object) although there are much more fields in the requested object. This is done, because especially on mobile devices the bandwidth is important and these objects are very small. But as developer you can add some more fields to your request and add the mentioned fields query parameter.
You can then add a comma separated list with all the fields of the requested object. The returned JSON contains all these fields. But you have to be careful, because asking for a field that is not part of an object leads to a request error. So check the Facebook reference for the fields.
Next step for checking why you don't get the fields are possible missing permissions. You can only ask for fields that are public (in sense of public for the API, not necessarily the Facebook page) or you have some special permissions for.
For pages you don't own you need the "Page Public Metadata Access" feature enabled for your access token. Otherwise you don't get any further information for this page.
This is not required for pages you are the admin of.
For more details about the fields topic check the Reading/Choosing Fields section here:
https://developers.facebook.com/docs/graph-api/using-graph-api

Facebook URL Graph Search - Page Queries

I am looking to generate a list of URLS or FB ID's for a set of existing Facebook Pages. Ultimately the initial query I am looking to run is simple: Find all NEW facebook pages created in City XYZ.
The term NEW, is open to interpretation. It could mean "Created this month" Or newer relative others in a set (these details are not important at the moment) . Also, "Pages" refers to fan pages (not user profiles).
I have identified 3 possible approaches. Both of which I am hoping to get some input on. Regarding feasibility and process.
Option 1) Somehow leverage Facebook's Graph API and develop some time of web application to generate a list of all Pages, then filter by city, then filter by date created.
Option 2 (Best Case)) Write or generate a custom Graph Search URL with embedded search criteria and leverage FBs existing search feature to get results. A great example of this approach is used by the tool searchisback.com. Only this tool is used to do advanced searches on People, but I need advanced searches on Pages.
Option 3) Locate a tool that already does this that I can use.
I again hoping to get some input and possible some direction/recommendations.
I should also mention that I actually know very little about Facebook APIs and Facebook Development. My position right now is of some who knows what they want to do, but no idea how to do it.
Option 1: Not possible, you can only search for Pages by name, the Graph Search is not available with the API. Those are all the options: https://developers.facebook.com/docs/graph-api/using-graph-api#search
Option 2: See answer to option 1.
Option 3: There are tools that list Pages, but they all have to add them manually. So there is not really a tool that does what you want to achieve.
In short: What you want to do is not possible.

Google Analytics API, filter by parameter

Our app uses the Google Analytics Rest API. We'd like to get the number of page views generated by different links to the site.
For example, one link to our site might be:
http://oursite.com?linknum=12345
and another might be:
http://oursite.com?linknum=23456
We'd like to track the number of page views by all visitors who click on each link, so we need a way to filter by parameter.
So far, we just get the number of page views for all visitors without any filters:
curl 'https://www.googleapis.com/analytics/v3/data/ga?ids=ga:(our id) &metrics=ga:pageviews&start-date=2014-4-26&end-date=2011-12-08&access_token=(our access token)'
The best way to learn the API is to use the query explorer at
http://ga-dev-tools.appspot.com/explorer/
For your analysis, add dimension=ga:pagePath and sort=ga:pageviews.
In addition, you could ask for pages which match a filter expression.
For example filter=ga:pagePath=#linknum to only include pages with linknum.

Fetch a group object with Graph API using group alias?

How can i fetch data with group page alias ?
Take for example this group: http://www.facebook.com/groups/toroneradio/.
Making request to https://graph.facebook.com/toroneradio gives me back:
"message": "(#803) Some of the aliases you requested do not exist: toroneradio"
Making request to the graph API with the group's id: https://graph.facebook.com/173246339390721 works OK.
It works great for pages though.
Looked at FQL groups table but name is not searchable. (FQL Groups table)
Also looked for some documentation and in FB bugtracking, couldn't find anything.
Is there way to get programaticly the group id from group alias or directly to get Group graph object?
Thanks, in advance!
The Easy Way
If you haven't done so, join the Facebook group which you want to fetch the group ID
Use the Facebook Graph API explorer
Access your list of groups via http://graph.facebook.com/me/groups
Search for the group and the ID will be listed in the object
If you are doing it through your Facebook application, all you need is to grab an FB access token before you do the FB Graph API call (read up the documentation here, especially the Authorization section)
The Hard Way
In case the easy way doesn't work (or if you feel iffy in joining the group), here's the sure-fire way to do so:
Start up Firebug and enable the "Net" tab
Bring up Facebook - check that the Net panl will show all the HTTP requests that's happening
Click the "Clear" button so that you have the panel in the blank slate
Click on the link of the Facebook group that you wanted to retrieve the Facebook ID
Look out for a GET request to generic.php - that would be the very first request, but hunt it down if it's not. Click on the [+] box to expand the details
Click on the "Parameters" tab and you'd see a key-value dictionary of the request. There'll be two fields in there called "key" and "sk", both of which would carry the same value like "group_1656399367890"
The group's ID will be the numeric value after "group_" (in this case, it'll be 1656399367890)
Hope that helps!
By using FQL:
SELECT id FROM profile WHERE username='groupname' AND type='group'
Just figured this out! Do this: http://graph.facebook.com/search?q=[ALIAS]&type=group