how to get facebook page creation date using facebook api - facebook-graph-api

my try : https://graph.facebook.com/v12.0/{mypageid}?fields={fieldname_of_type_PageStartDate}
Could not get any response when using this api and i am also confused about {fieldname_of_type_PageStartDate} parameter value. i tried day,month,year value according to https://developers.facebook.com/docs/graph-api/reference/page-start-date/ this fb website but it didn't work.
please suggest any way to get facenook page creation date using api.

The documentation is a bit misleading, because what that page does not tell you on its own, is that those fields are part of the start_info property of the page - so you have to query that one.
https://graph.facebook.com/v12.0/pageid?fields=start_info
This will give you a structure of the following format:
"data": [
{
"name": "...",
"start_info": {
"type": "Started",
"date": {
"year": 2021,
"month": 11,
"day": 29
}
},
"id": "1234567890"
},
Not all sub-fields will always be set; you might for example encounter types Founded with only a year set, or Unspecified with no date info at all.
Note that this is not the actual page creation date; but the "start date" of the entity represented by the page. So it must be explicitly set in the page settings, otherwise this field will be empty.

Related

searchContacts with phone number query is broken

Using the [searchContacts API method] (https://developers.google.com/people/api/rest/v1/people/searchContacts) used to support searching by telephone number - indeed this is called out in the documentation:
The query matches on a contact's names, nickNames, emailAddresses, phoneNumbers, and organizations fields that are from the CONTACT source.
It no longer returns results when using a phone number as the query. Is this deliberate, or a bug?
As per google people api search by phonenumbers I have tried a query of "canonical format without plus". I have also tried "canonical format with plus" and "exact number as stored".
Name query still works
https://people.googleapis.com/v1/people:searchContacts?readMask=names%2cphoneNumbers&query=Go Ogle&pageSize=30
returns
{
"results": [
{
"person": {
"resourceName": "people/c832768086350305259",
"etag": "%EgcBAgsuNz0/GgECIgwxZGVYd20reHpEUT0=",
"names": [
{
"metadata": {
"primary": true,
"source": {
"type": "CONTACT",
"id": "b8e96298f3117eb"
}
},
"displayName": "Go Ogle",
"familyName": "Ogle",
"givenName": "Go",
"displayNameLastFirst": "Ogle, Go",
"unstructuredName": "Go Ogle"
}
],
"phoneNumbers": [
{
"metadata": {
"primary": true,
"source": {
"type": "CONTACT",
"id": "b8e96298f3117eb"
}
},
"value": "020 7031 3000",
"canonicalForm": "+442070313000"
}
]
}
}
]
}
Phone number query fails
https://people.googleapis.com/v1/people:searchContacts?readMask=names%2cphoneNumbers&query=442070313000&pageSize=30
returns
{}
The query function does indeed seem to be broken at the moment. My tests gave the same results and the question you linked shows that it clearly worked in the past.
I found a bug report on Google's issue tracker. A Googler already replied to it saying that they were able to reproduce it and filed an internal report. It's a matter of time until they fix it so you may want to keep track of that thread or post on it yourself to apply some pressure.
The bug didn't went away although they say it was closed and verified
In order to get the same functionality I had to be creative, the documentation says:
The query matches on a contact's names, nickNames, emailAddresses,
phoneNumbers, and organizations fields that are from the CONTACT
source.
The names, emailAddresses, phoneNumbers and organizations are important fields where you don't want to have garbage, but on my case at least the nickNames had no usage, so I simply add the phone number as nick name and the search works like charm.
Keep in mind that if you have many previous contacts you will have to write a script that will copy their phone number to the one of the nicknames fields.
Enjoy :)

Facebook API process shared object [duplicate]

I just tried through the Graph API Explorer with this path /v2.4/10153513872748291 and I've got this result:
{
"error": {
"message": "(#12) singular links API is deprecated for versions v2.4 and higher",
"type": "OAuthException",
"code": 12
}
}
But https://developers.facebook.com/docs/reference/api/post/ doesn't say anything about deprecation.
I'm not sure if I miss something, or there's another way to get info about an individual post.
Edit: v2.3 works, but v2.4 is the latest one.
Looks like you now need to the combination of the id of the user or page that made the post (or whose wall it is on), an underscore, and then the post id.
For your example post, 10153513872748291, that is made by a page Drama-addict, that has the id 141108613290 – so 141108613290_10153513872748291 will work.
And so does 788239567865981_10153513872748291, because 788239567865981 is the id of the user making the post.
Firstput userId underscore add postId /Likes to check Like status in facebook
userId_post_Id/Likes to fetch Likes Records
userId_post_Id/Comments to fetch Comments Records
https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=303261006522998_751199848395776%2FLikes&version=v2.9
**In this link Right side Get Token indide GetAccessToken to select Permission**
303261006522998_751199848395776/Likes
303261006522998_751199848395776/Comments
{
"data": [
{
"id": "124778301449917",
"name": "Manisha Gera"
},
{
"id": "1680577265523548",
"name": "Rubi Sharma"
}
],
"paging": {
"cursors": {
"before": "MTI0Nzc4MzAxNDQ5OTE3",
"after": "MTY4MDU3NzI2NTUyMzU0OAZDZD"
}
}
}

Query Group Feed Posts by `created_time`

For a small Facebook Sales Group Monitor I need to query the group's new posts. I've intended to do this via the Graph API, requesting only posts which have been either
created since the last query (created_time) or
updated since the last query (updated_time).
This, however, seems not to be possible.
Omitting all non-date fields, a GET /v2.7/<group-id>/feed request returns the following data:
"data": [
{
"updated_time": "2016-01-12T20:11:02+0000",
"created_time": "2014-09-16T09:55:39+0000",
"id": "552364968142715_789142084465001"
},
{
"updated_time": "1970-01-01T00:16:40+0000",
"created_time": "2016-08-28T19:15:53+0000",
"id": "552364968142715_1183108935068312"
},
{
"updated_time": "1970-01-01T00:16:39+0000",
"created_time": "2016-08-29T14:13:22+0000",
"id": "552364968142715_1183722648340274"
},
{
"updated_time": "1970-01-01T00:16:38+0000",
"created_time": "2016-08-28T09:15:05+0000",
"id": "552364968142715_1182673285111877"
},
...
]
The first entry is from the pinned group-rules post, created in 2014, updated 2016.
The second and fourth entries are both from yesterday, the third post is from today.
All but the first post have updated_time-timestamps close to the UNIX epoch's beginning. With a few exceptions, the value seems to be decreasing by 1 second for every post in the list, even when requesting 100+ posts.
The API Reference for Group feeds states, that the since=<timestamp> query parameter only applies on the updated_time field, which does not help in this case.
Is there any way to filter for or at least sort by the created_time value?
I am running into same problem. It seems currently created_time only apply for Page feed, not Group feed at the moment :(

Facebook Objects API Queries o

I have asked some old questions previously but those were quite misleading. So I decided to delete them and creating this one.
My object has a custom property named say it is portal content. In the Facebook Graph API Explorer data related to this object shown like;
{
"created_time": "2015-11-26T08:42:26+0000",
"title": "Title",
"type": "ns:type",
"data": {
"portalcontent": "portalcontent"
},
"id": "12515125125"
},
{
"created_time": "2015-11-26T08:04:09+0000",
"title": "Title2",
"type": "ns:type",
"id": "412512512512"
},
{
"created_time": "2015-11-25T12:56:03+0000",
"title": "Title3",
"type": "ns:type",
"id": "234124124124"
}
I am trying to query this data using Facebook graph api. But can not fetch just based on the portal content custom property.
So far I tried;
appid/objects?pretty=0&type=ns:type&limit=100&portalcontent=portalcontent
to do so. But it is still fetching all objects.
PS: please pm or comment on question for why you are downvoting it. Provide what else you need that I must put on the question. Downvoting for no reason getting people annoyed.
There's currently no way to filter results other than those described on the respective endpoint's docs.
See
https://developers.facebook.com/docs/graph-api/reference/application/objects/
https://developers.facebook.com/docs/graph-api/using-graph-api/v2.5

Populating search results with meta data in Amazon CloudSearch

Unfortunately, Amazon CloudSearch does not support nested JSON, meaning that the below document structure is not valid.
[{
"type": "add",
"id": 1,
"fields": {
"company_name": "My Company",
"services": [
{
"id": 123,
"name": "Construction",
"logo": "logo1.png"
},
{
"id": 456,
"name": "Programming",
"logo": "logo2.png"
}
]
}
}]
Basically I cannot nest an array of objects under the services key. In this particular scenario, only the nested name field has to be searchable, so what I could do is the following:
[{
"type": "add",
"id": 1,
"fields": {
"company_name": "My Company",
"services": [ "Construction", "Programming" ]
}
}]
The above JSON is valid, and I can still search for the service names. However, now I have lost some meta data about my services that I need when displaying the search results. Is there any way in which I can add the meta data to the document in Amazon CloudSearch and have it returned with my search results, such that I can use it when displaying the results?
Or do I have to fetch this additional meta data from my database afterwards to populate the search results with the additional data required to display the results? This does not seem feasible because it complicates my code much more than if I could fetch this data straight from CloudSearch. This would also impact the performance of the search, even though I could use caching - but I kind of want to avoid that if possible, because I don't need it for anything else right now.
So my questions are:
Can I somehow add the meta data for services to the CloudSearch documents and have it returned with my search results?
If not, should I then extract this data from my data store upon receiving the search results from CloudSearch?
Do you have any other solutions or ideas? Are there any best practices with this?
Thank you in advance!