Anca
Anca

Reputation: 55

How to backdate a post

I'm trying to post a message on the timeline in the past and I get the following error: "Facebook.FacebookOAuthException : (OAuthException - #100) (#100) You cannot specify a scheduled publish time on a published post" I tried to put the current date, a past date or a future date; the result is the same.

I think it may be a problem with the way I obtain the unix timestamp.

Here is the code:

public void PostPostsOnTestUserTimeline()
    {

        string userId = "[TEST_USER_ID]"; 

        var client = new FacebookClient(accessToken);
        dynamic parameters = new ExpandoObject();
        parameters.message = "Check out this funny article - 39";

        parameters.scheduled_publish_time = GetUnixTimestamp(DateTime.Now.AddMinutes(20));

        client.Post(string.Format("{0}/feed", userId), parameters);


    }

    private long GetUnixTimestamp(DateTime dateTime)
    {
        double secondsDouble = (dateTime - new DateTime(1970, 1, 1).ToLocalTime()).TotalSeconds;
        return Convert.ToInt64(secondsDouble);
    }

Any idea why it crashes? I am writing on the timeline of a test user created at "created_time": "2013-03-05T12:34:15+0000". If I don't specify the scheduled_publish_time, it works fine.

Thank you, Iulia

Upvotes: 1

Views: 1224

Answers (1)

Igy
Igy

Reputation: 43816

There's no way to backdate feed posts on user timelines - this feature only exists for Pages or for Open Graph publishing

Upvotes: 1

Related Questions