Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
632 views
in Technique[技术] by (71.8m points)

facebook - Upload photos for past date

I am trying to upload few old photos with a past creation date so that they appear properly in timeline. Existing api allows only to pass message and source.

i.e

  POST https://graph.facebook.com/ALBUM_ID/photos?access_token=xyz
  ..multipart.form.data.with.message.and.source..

is the only way I can upload photos.

  POST https://graph.facebook.com/PHOTO_ID?access_token=xyz
  created_time=2010-01-20T09:04Z&updated_time=2010-01-20T09:04Z

doesn't move the photo date either.

I tried creating a post out of the photo upload using the /feed api, but it doesn't allow me to make an existing photo a post. It makes it a post of type link.

What I want to exactly create a photo object and publish following:

  {
    "id": "xx_yy",
    "from": {
       "name": "My Name",
       "id": "myfbid"
    },
    "story": "<My Name> added a new photo.",
    "picture": "<PhotoJPEG>",
    "link": "<FBPhoto_URL>",
    "name": "Photo Name",
    "icon": "https://s-static.ak.facebook.com/rsrc.php/v1/yz/r/StEh3RhPvjk.gif",
    "actions": [
       {
          "name": "Comment",
          "link": "https://www.facebook.com/xxx/posts/yy"
       },
       {
          "name": "Like",
          "link": "https://www.facebook.com/xx/posts/yy"
       }
    ],
    "privacy": {
       "description": "Group",
       "value": "CUSTOM",
       "friends": "SOME_FRIENDS",
       "allow": "<GROUPID>"
    },
    "place": {
       "id": "<placeid>",
       "name": "<PlaceName>"
    },
    "type": "photo",
    "object_id": "12345",
    "created_time": "2010-09-20T13:37:54+0000",
    "updated_time": "2010-09-20T13:37:54+0000",
    "comments": {
       "count": 0
    }
  }
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I'm an Engineer at FB, but not on the Platform team so I'm not 100% up to date on this. There is an undocumented field 'backdated_time' available on the photo uploader in the Graph API. I assume it's supernew and will be being doc'd over the next few weeks, but feel free to try it in the interim (and report back here!).

It takes an ISO-8601 timestamp by the looks of it.

The docs team have been chased to figure out what's going on.

Also, DMCS isn't quite right. FB Engineers (particularly those in our Developer Support team) are encouraged to hang out here to help with questions, and each week on our developer blog we post how many questions were asked and how many were answered. So there is a commitment to getting questions on SO answered - see https://developers.facebook.com/blog/post/625/ as an example.

However, there's a difference between support of existing features and bugs/requests for new features. If you have a bug or feature request, add it to http://developers.facebook.com/bugs.

Thanks!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...