Error message while trying to publish a photo to a page
Hi all,
I'm trying to publish a photo to a page using the following:
FacebookClient client = new DefaultFacebookClient(destinationAccessToken);
BinaryAttachment attachment = BinaryAttachment.with(imageName, imageInputStream);
Photo photoResponse = client.publish("/me/photos", Photo.class, attachment);
I'm getting the following response:
{
  "error": {
    "message":"An unexpected error has occurred. Please retry your request later.",
    "type":"OAuthException",
    "code":2
  }
}
When I use the same code to publish to a user wall, it works fine.
I've also tried posting to "/{page id}/photos" with the same result.
The destination access token has the manage_pages, photo_upload, publish_actions, and publish_stream permissions amongst others.
What am I doing wrong here?
Please guide me.
Thanks in advance.