How can I add a custom date to the facebook timeline through graph api
I want to insert an entry to the new facebook timeline with a specific date (e.g., February 10, 2008), but not manually. I want to be able to do this using either the graph api or the new open-graph-beta. Is there a specific api call that can do this, or is there some other way.
Update:
I have figured out that in the api call you need to specify the start_time and end_time parameters as seen in the snippet below:
FB.api('me/APP_NAMESPACE:ACTION?\
start_time=904920127&\
expires_in=905006527&\
OBJECT_TYPE=URL&\
acc开发者_运维技巧ess_token=YOUR_ACCESS_TOKEN', 'post', function (response) {
if (!response || response.error) {
console.log(response);
} else {
alert('Post was successful! Action ID: ' + response.id);
console.log(response)
}
});
However the problem with this is that it just adds a specific year to your timeline and doesn't really add an entry to that particular timeline, i.e., when I click on the particular year I just created in my timeline app nothing shows up besides seeing the new year in my time line, in this case it's 1998.
When you post an action via the Graph API, you can set 'start_time' and 'end_time' parameters.
This tells Facebook when the action occurred - and is useful for both backloading historical actions from a long time ago, or delayed actions like publishing offline listening activity.
Facebook represents actions on the timeline in the time period in which they occurred. Setting start_time in the past will make the activity appear in the past on their timeline.
Note that its against policy to publish 'fake' past actions - you must only publish actions that the user actually did in the past.
I think it may not be allowed, here's what you get for a start_time in the past :
{"error":{"type":"Exception","message":"The action you are trying to publish is invalid because the 'start_time' you provided of '1325770789' is more than '86400' seconds in the past."}}
精彩评论