Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The url supplied is invalid Facebook RestFB

I am using Facebook Graph using RestFB. When I am trying to post a URL to Facebook -

http://localhost:8080/demo

enter image description here I even tried

http://www.wannaget.com/home

This is also not working. Issue was not local or live url. Because this was working previously But now it gives me invalid URL error.

It gives Following response

INFO: Facebook responded with HTTP status code 400 and response body: {"error":{"message":"(#1500) The url you supplied is invalid","type":"OAuthException","code":1500}}

I don't understand the reason why this is happening. Everything is working fine but now I am facing this issue.

like image 746
Zahid Riaz Avatar asked Jul 19 '12 11:07

Zahid Riaz


2 Answers

The url is not in a valid format. I guess it has to end with an extension, like "http://localhost:8080/demo.html"

A workaround that worked for me (on rails):

I was trying to post on fb the link "localhost:3000/articles/53" with that same error. To fix it I had the route:

match 'news/article/:id/x.x' => 'articles#show'

and post successfully on fb the resultant link "localhost:3000/articles/53/x.x"

Any real solution is welcome!

like image 138
Helio Santos Avatar answered Oct 13 '22 12:10

Helio Santos


The URL you provided is a for a local server running on your machine. Facebook has to be able to access that URL but it can't because it is not on the Internet - it is only accessible from your local computer.

You'll have to give Facebook a real URL that is accessible by their servers...

like image 36
Lix Avatar answered Oct 13 '22 12:10

Lix