Reputation: 95
I would like to use Graph API to get some information about URLs.
It works like this:
However, when an URL contains comma, things get complicated. For
we get
http://graph.facebook.com/?ids=http%3A%2F%2Fwww.example.com%2Fname%2Csomething
what gives us:
{
"error": {
"message": "(#803) Some of the aliases you requested do not exist: something",
"type": "OAuthException",
"code": 803
}
}
What can be done with URLs to avoid such errors?
Upvotes: 4
Views: 1116
Reputation: 96383
Just double-URL-encode the comma, so use %252C for it:
http://graph.facebook.com/?ids=http%3A%2F%2Fwww.example.com%2Fname%252Csomething
It might look weird, because then the Graph API identifies this URL by http://www.example.com/name\u00252Csomething
- but I just tested it by pointing a like button to a URL containing a comma (un-encoded), liked it – and afterwards it showed 1 share for this URL on the Graph.
Upvotes: 7