Zahid Riaz
Zahid Riaz

Reputation: 2889

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.

Upvotes: 5

Views: 4373

Answers (2)

Helio Santos
Helio Santos

Reputation: 6805

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!

Upvotes: 6

Lix
Lix

Reputation: 47956

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...

Upvotes: 2

Related Questions