-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Working with the page API is fun, if you can do things you would normally have to spend much time for. So here is one interesting snippet.
How do I change the cover photo of a page by Graph API.
Solution:
First upload a image to the page and in return you get the new photo id.
Then send a request to the page and use this photo id to set the cover.
In code this looks like:
// step 1
FacebookType ft =
client.publish(id + "/photos",
FacebookType.class,
BinaryAttachment.with("test.jpg",is),
Parameter.with("message", "description"));
// step 2
client.publish(id, GraphResponse.class, Parameter.with("cover", ft.getId()), Parameter.with("offset_y",0));Metadata
Metadata
Assignees
Labels
No labels