I want to write a JAVA program to create posts including images, for our clients Facebook pages.
using this endpoint https://graph.facebook.com/{{page_id}}/photos
and defining the page_access_token, the text message and URL of the photo I can do it.
In the following example I have created page_access_token and page_id in Base Environment.
{ "url":"Path_to_the_photo", "message":"The Desired Text" }
As you can see in this photo, the request to create the post is Successful.
However I want to be able to edit this photo when it is needed, but I cannot find the endpoint in the documentation Developers Facebook.
I noticed that using https://graph.facebook.com/v19.0/{{page_post_id}} endpoint I can edit the text but not the photo. Does anyone have the idea how I can tackle this?
PS: I have successfully created the application with the full access and the following permissions:
- read_insights
- pages_manage_cta
- pages_show_list
- pages_messaging
- pages_read_engagement
- pages_manage_metadata
- pages_read_user_content
- pages_manage_ads
- pages_manage_posts
- pages_manage_engagement

I found the solution. First we need to send a post request to the endpoint: 1-
https://graph.facebook.com/{{page_id}}/photos
on success reading the id. 2- Then another post request to https://graph.facebook.com/{{page_post_id}}