Upload a Rest API photo without posting to the wall

I am making an FB application where users can upload a photo to a photo album that is being created at the same time. My problem is that I want the photos to be included in the album, avoiding publishing the same photos on the users wall and in the users news feed. Not sure if this is possible or if there is a workaround.

thanks for the help

+4
source share
2 answers

You just need to use the no_story=1 parameter within your call.

It is not described on Album or Photo , but is on User , and it also works with photos.

Related: facebook upload photo without news post? Maybe?

+4
source

The only way around this is to delete the stories (messages) generated for each photo upload. To answer another question in the stream, you can upload photos, see this blog post https://developers.facebook.com/blog/post/493 , which explains how to do this using batch requests.

Assuming you used batch requests (or even if you download them one at a time), you can follow this process:

  • After loading photos using the Graph API, pay attention to the identifier of the downloaded photo.

  • Request https://graph.facebook.com/me/feed?fields=object_id&access_token=youruseraccesstoken to get the latest wall information. You can go to the limit parameter to get too many results.

  • Scroll through the results, trying to match the object_id with the information stored in step (1). Pay attention to the corresponding identifier, this is the identifier of the wall (s).

  • For each wall ID found in step (3), enter HTTP DELETE at https://graph.facebook.com/POST_ID with an access_token that has publish_stream access.

Wall posts should disappear, but the photos are still in the album.

0
source

Source: https://habr.com/ru/post/1340239/


All Articles