I need to shedule a facebook post using an image. It should appear in the planner tool of the Meta Business Suite.
I found this example, but I can't figure out how to use an image and set a publication date.
Depencency:
<dependency>
<groupId>com.facebook.business.sdk</groupId>
<artifactId>facebook-java-business-sdk</artifactId>
<version>17.0.3</version>
</dependency>
Code:
import com.facebook.ads.sdk.*;
import java.io.File;
import java.util.Arrays;
public class PageFeedPost {
public static void main (String args[]) throws APIException {
// https://github.com/facebook/facebook-java-business-sdk/blob/main/examples/PageFeedPost.java
String access_token = "<ACCESS_TOKEN>";
String app_secret = "<APP_SECRET>";
String app_id = "<APP_ID>";
String id = "<PAGE_ID>";
APIContext context = new APIContext(access_token).enableDebug(true);
new Page(id, context).createFeed()
.setMessage("This is a test value")
.execute();
}
}
Also, how to get all scheduled items from the planner?