-1

I've retrieve my page token from developer.facebook.com to share post in a my page using php from script found here: Simple example to post to a Facebook fan page via PHP?

All is ok if I try to post only a text.

Then i tried to include a picture example from a random domain like "http://www.samsung.com/image.jpg". But I get this error:

(#100) Only owners of the URL have the ability to specify the picture, name, thumbnail or description params.

So, i tried to insert a url image from my own domain "http://www.example.com/image.jpg" but I get the same error.

I've completed verification-domain inside business-manager of facebook. then i've linked my fb page "Test" to my domain (always inside business-manager).

Error still remain!

Any suggest?

edit: my test script running on localhost with wamp now

itajackass
  • 346
  • 1
  • 2
  • 15

1 Answers1

0

Change the Open Graph Tags of the Page Source if you want to change data like picture, description, ... it is not possible to set them with the API anymore.

More information: https://developers.facebook.com/docs/sharing/webmasters/

Btw, that other thread is from 2011. A lot has changed since then.

Edit: For posting a picture, use this API: https://developers.facebook.com/docs/graph-api/photo-uploads/

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • I don't want share a page on facebook, i want to UPLOAD A image (or get an image from an existing url) to facebook with custom text attachment using pure php – itajackass Mar 15 '20 at 15:17
  • oh, sorry, i misunderstood. so you do not want to share a link, but post a picture? that would be a different api call. – andyrandy Mar 15 '20 at 15:28
  • i added a link in my answer about that – andyrandy Mar 15 '20 at 15:29
  • thank you. But is not fully what i want. I need to insert a post with text, link to something and a preview image.. Not a single image – itajackass Mar 15 '20 at 17:01
  • so you DO want to share a link...in that case, my initial answer applies, there is no other way. – andyrandy Mar 15 '20 at 17:23
  • No i don't want to SHARE, i need to CREATE a post from zero – itajackass Mar 15 '20 at 17:37
  • i know, you want to create a post with a link. that is sharing with the api. and you cannot change the open graph data anymore, they will always come from the page source. just change the open graph data in the source. – andyrandy Mar 16 '20 at 07:56