Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(#100) link URL is not properly formatted when posting to a facebook page

I am trying to post a URL to a facebook page. using PHP SDK. I am able to post successfully from my localhost. But on the live server, I get the result "Sorry, something went wrong".

when running the code from live server, I have no problem obtaining access_token to post to the page. Only the posting will not work.

I tried to post the link manually using the graph api explorer. and found that

  1. I am ABLE to post a message successfully via the graph api explorer.
  2. I am NOT able to post a URL via the graph api explorer. I get the error

    "(#100) link URL is not properly formatted"

I do encode the link that i am trying to post. and they are valid, existing links.

I even tried using http%3A%2F%2Fgoogle.com , and it would return the same error.

Some Other information

  1. The code is executed from mydomainname.com/folder/
  2. I have added the domain name to "App Domains" field.
  3. Sandbox Mode is On.
  4. When I tested from my local, I was able to post 25 links to the page.[after which it was giving errors]. When things were not working at the live server, I came back to locahost to again test with 25 links and more and found things to be working fine from localhost. I wonder if I hit some limit or my application has been black listed.

Anyone has got any ideas?

Thanks

UPDATE

I took the URL that was used by the live server (to post link to the facebook page) , and used fiddler to post it from my local machine. and it worked. so i am wondering whats preventing the code from working successfully from the server?

like image 426
Rakesh Avatar asked Nov 03 '22 05:11

Rakesh


1 Answers

I tried the same code from another domain and it worked.

I am yet to find out if it was not working because of the way the 1st domain was sending CURL requests, or if the domain was blacklisted for posting too much in the past.

either way, facebooks error messages are not at all helpful!

like image 179
Rakesh Avatar answered Nov 09 '22 03:11

Rakesh