What's the proper way to update the "published" field on a Photo using the Facebook Graph API?

57 Views Asked by At

When I try to update the published field on an existing Photo object I get: OAuthException code 1: "An unknown error has occurred." Here's what I'm trying:

Upload an image:

$ curl -X POST -F published=false -F "access_token=$TOKEN" -F [email protected] https://graph.facebook.com/$ALBUM_ID/photos

Grab the link and verify that the link shows up for me, but not my friends:

$ curl -X GET "https://graph.facebook.com/v2.6/$PHOTO_ID?fields=link&access_token=$TOKEN"

Set the published bit:

$ curl -X POST -F published=true -F "access_token=$TOKEN" https://graph.facebook.com/$PHOTO_ID
{"error":{"message":"An unknown error has occurred.","type":"OAuthException","code":1,"fbtrace_id":"D+Z1Gs9zZat"}}%

According to the docs that field is available for updating. So is this a documentation bug or an API bug?

I'm trying to upload a bunch of pictures with published=false and then publish them all at the same time later by just updating the published field.

1

There are 1 best solutions below

0
On BEST ANSWER

Looks like there's currently a bug in the platform. Here's the bug report.