Hello!
I've just started working with the REST Games API using Java, and Im having some trouble with successfully calling the "ping" API call (to log in and make sure it's working):
This is the code I have so far (I've cut it down for ease of reading):
The code seems to work. It creates the MD5 hash string, and then sends this all off with the URL with the my actual username and password but it just keeps returning 401 errors from the server, saying that the username/password/user agent is wrong.
Any ideas on how to solve this?
Thanks in advance
I've just started working with the REST Games API using Java, and Im having some trouble with successfully calling the "ping" API call (to log in and make sure it's working):
This is the code I have so far (I've cut it down for ease of reading):
Code:
URL url = new URL("https://api.games.betfair.com/rest/v1/ping?username=exampleUsername");
HttpsURLConnection connection = (HttpsURLConnection)url.openConnection();
connection.setRequestProperty("gamexAPIPassword", "examplePassword");
connection.addRequestProperty("gamexAPIAgent", "exampleGamesApp.1.0");
connection.addRequestProperty("gamexAPIAgentInstance", constructMD5Hash());
BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String input;
while ((input = br.readLine()) != null) {
System.out.println(input);
}
br.close();
Any ideas on how to solve this?
Thanks in advance

