Sample json response, Sample xml response, Sample error response – Brocade Network Advisor REST API Guide (Supporting Network Advisor 12.3.0) User Manual
Page 37

Brocade Network Advisor REST API Guide
23
53-1003160-01
Logging in and out
3
}
} catch (IOException ie) {
System.out.println(ie.toString());
} finally {
if (null != con) {
con.disconnect();
}
}
Sample JSON response
The following is a sample JSON response to a login request.
CALLING POST http://10.24.41.138/rest/login
Response code is 200
GOT TOKEN FROM RS RESPONSE = Yh8veQHgxR6v6KgNR9Eioeg7168=
{"serverName":"W2K8R2-41-138","serverIp":"10.24.41.138"}
Sample XML response
The following is a sample XML response to a login request.
CALLING POST http://10.24.48.103/rest/login
Response code is 200
GOT TOKEN FROM RS RESPONSE = kPkOm7PX4WempcfP7B8iZrb5RDY=
xmlns:ns2="http://www.brocade.com/networkadvisor/webservices/v1/authservice/respo nse"> :LoginResponse> Sample error response The following is a sample error response to a login request. CALLING POST http://10.24.48.103/rest/login Response code is 500
report
JBWEB000065: HTTP Status 500 - RSException [errorCode=4005,
errorMsg=Invalid username or password]
noshade="noshade">
JBWEB000309: type JBWEB000066: Exception
report
JBWEB000068: message RSException [errorCode=4005,
errorMsg=Invalid username or password]
JBWEB000069: description
JBWEB000145: The server encountered an internal error that prevented it from
fulfilling this request.
JBWEB000070: exception
org.jboss.resteasy.spi.UnhandledException: RSException [errorCode=4005,errorMsg=Invalid username or password]