User Guide

login 51
URL loginUrl = new URL(baseUrl + "api/xml?accesskey=" + accessKey +
"&action=login&login=" + login + "&password=" + password);
URLConnection conn=loginUrl.openConnection();
conn.connect();
InputStream resultStream=conn.getInputStream();
Document doc=new SAXBuilder(false).build(resultStream);
String cookieString=(String) (conn.getHeaderField("Set-Cookie"));
StringTokenizer st=new StringTokenizer(cookieString, "=");
if (st.countTokens() > 1 && st.nextToken().equals("BREEZESESSION")) {
String cookieNext= st.nextToken();
int semiIndex= cookieNext.indexOf(';');
cookie= cookieNext.substring(0, semiIndex);
}
if (cookie == null){
throw new RuntimeException("Couldn't find the Breeze cookie.");
}
To pass the BREEZESESSION cookie for all subsequent requests, use the following code:
URLConnection conn= url.openConnection();
conn.setRequestProperty("Cookie", "BREEZESESSION=" + cookie);
conn.connect();
Parameters
accesskey
The access key for your account.
Note: The accesskey parameter is required only in Breeze 4.0; it is not required for Breeze 4.1. If you
include this parameter in Breeze 4.1, it is ignored.
account-id
The ID of the account that the user is associated with. This parameter is optional.
If your organization has only one account, dont specify an
account-id.
login The user’s login name, which is usually the users e-mail address.
password The user’s password.
Note: If the login or password is missing or incorrect, the Breeze server returns a status code of
"no-data".
Filters
Results cannot be filtered or sorted.
Returned elements
None.
Sample results
<results>
<status code="ok" />
</results>