Take the 2-minute tour ×

I am completely stumped by this. I have the following Facebook App Access Token registered for my app:


And then I try to GET the following URL: (Fake token underneath)

 String accessToken = "258443224256787|dsK3fffe7g-rejponkVlfwef3GenVng6Y";

 WS.url("https://graph.facebook.com/" + socialUser.id.id + "/likes?access_token="+accessToken)

 accessToken = "258443224256787" + URLEncoder.encode("|") + "dsK3ks7g-dsK3fffe7g-rejponkVlfwef3GenVng6Y";

I get the following error message:


When I use it in the Graph API explorer tool however, I get no errors! I think the problem might be that I don't know how to use the pipe symbol in my URLs (tried Googling for hours without success - attempted URLEncoder.encodre to no avail).

Help please! :-)

(I'm using Java Play! 2)

Edit I should say that when I debug my link I get: "%7C" instead of pipe, due to the URLEncoder.

Edit 2 It also works when I post the URL directly into the browser.

Edit 3 Added URLEncoder-code

share|improve this question
Change your app secret if you haven't already. –  J Starr Jul 25 '12 at 19:35
I made the tokens fake :-) –  nicohvi Jul 26 '12 at 8:38

1 Answer 1

up vote 2 down vote accepted

Turns out that WS.url() didn't accept my query parameters unless I used url().setQueryParameters() which solved the problem. :-)

share|improve this answer

Your Answer


