/moservices/rest/api/login
Required parameters:
Parameter | Description |
---|---|
username | N/A |
password | N/A |
User-Agent | This helps us route your API call appropriately. Default: apiuser |
Logging in with the username “johnsmith@acme.com” and password “changeme”.
curl -d "username=john&password=changeme&User-Agent=apiuser" -k -c tmpCookies.txt https://openmobile.ipass.com/moservices/rest/api/login
String loginURI = "/moservices/rest/api/login"; HttpPost loginPost = new HttpPost("https://openmobile.ipass.com" + loginURI); List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1); nameValuePairs.add(new BasicNameValuePair("username", username)); nameValuePairs.add(new BasicNameValuePair("password", password)); nameValuePairs.add(new BasicNameValuePair("User-Agent", "apiuser")); loginPost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); // Make the Login API call to authenticate HttpResponse loginResponse = httpClient.execute(loginPost); // Consume content so the HTTPClient can be re-used loginResponse.getEntity().consumeContent(); // Get Cookies from the Login API call CookieStore cookieStore = ((AbstractHttpClient) httpClient).getCookieStore(); List<Cookie> cookies = cookieStore.getCookies(); // Set cookies for future API calls httpClient.getParams().setParameter("Cookie", cookies);
Go to: Portal Home > REST API Overview