this might be a simple question but i was wondering how i could use the API in Java?
Whenever i try to access the follow url i get an error:
url: http://localhost:8080/api?mode=qstatus& ... d05f70efe9
Java error: java.net.ConnectException: Connection refused: connect
Java code:
Code: Select all
try{
DocumentBuilderFactory dbfFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dbBuilder = dbfFactory.newDocumentBuilder();
Document doc = dbBuilder.parse("http://localhost:8080/api?mode=qstatus&output=xml&apikey=711de66ca57dae90338267d05f70efe9");
doc.getDocumentElement().normalize();
System.out.println("Root element: " + doc.getDocumentElement().getNodeName());
} catch(Exception e){
System.err.println(e);
}
Code: Select all
<result>
<status>False</status>
<error>API Key Incorrect</error>
</result>
Could someone explain to me how to work with the api?
[edit]
Also adding the &ma_username=USERNAME&ma_password=PASSWORD didn't work (obviously i did enter the correct username and password. i used USERNAME and PASSWORD here just for example purposes).
[/edit]