This module allows you to create App Users. App42 Cloud API’s facilitates complete User Management for any Mobile or Web App. It enables User registration, retrieval, state management e.g. Lock, Delete, Authentication and more. Along with User management, the library provides API’s for persistent Session Management.

Initialize

In order to use various functions available in a specific API, a developer has to create an instance of ServiceAPI by passing the apiKey and secretKey which will be created after the app creation from AppHQ dashboard.

Required Parameters

apiKey - The Application key given when the application was created. secretKey - The secret key corresponding to the application key given when the application was created.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
ServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY");
ServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY");
ServiceAPI *api = [[ServiceAPI alloc]init];
api.apiKey = @"<API_KEY>";
api.secretKey = @"<SECRET_KEY>"; 
ServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY");
ServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY");
ServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY");
App42.initialize("API_KEY","SECRET_KEY");
ServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY");
$api = new ServiceAPI("API_KEY","SECRET_KEY"); 
UserService::Initialize("API_KEY","SECRET_KEY");
api = App42RubyAPI::ServiceAPI.new("API_KEY","SECRET_KEY")
var api:ServiceAPI = new ServiceAPI("API_KEY","SECRET_KEY");
Coming Soon

Build Service

After initialization, developer needs to call the buildXXXService method on ServiceAPI instance to get the instance of the particular API that you wish to build. For example, To build an instance of UserService, buildUserService() method needs to be called.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
UserService userService = api.buildUserService(); 
UserService userService = api.BuildUserService();  
UserService *userService = [api buildUserService]; 
UserService userService = api.buildUserService(); 
UserService userService = api.buildUserService(); 
UserService userService = api.BuildUserService();
var userService  = new App42User();
UserService userService = api.BuildUserService(); 
$userService = $api->buildUserService(); 
UserService* userService = UserService::getInstance();
user_service = api.build_user_service
var userService:UserService = api.buildUserService(); 
Coming Soon

Import Statement

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
 
import com.shephertz.app42.paas.sdk.android.ServiceAPI;
import com.shephertz.app42.paas.sdk.android.App42Response;
import com.shephertz.app42.paas.sdk.android.App42Exception;
import com.shephertz.app42.paas.sdk.android.App42BadParameterException;
import com.shephertz.app42.paas.sdk.android.App42NotFoundException;
import com.shephertz.app42.paas.sdk.android.user.User;
import com.shephertz.app42.paas.sdk.android.user.Profile;
import com.shephertz.app42.paas.sdk.android.user.UserGender;
import com.shephertz.app42.paas.sdk.android.user.UserService;
using com.shephertz.app42.paas.sdk.windows;  
using com.shephertz.app42.paas.sdk.windows.user;   
#import "Shephertz_App42_iOS_API/Shephertz_App42_iOS_API.h"   
import com.shephertz.app42.paas.sdk.jme.ServiceAPI;
import com.shephertz.app42.paas.sdk.jme.App42Response;
import com.shephertz.app42.paas.sdk.jme.App42Exception;
import com.shephertz.app42.paas.sdk.jme.App42BadParameterException;
import com.shephertz.app42.paas.sdk.jme.App42NotFoundException;
import com.shephertz.app42.paas.sdk.jme.user.User;
import com.shephertz.app42.paas.sdk.jme.user.Profile;
import com.shephertz.app42.paas.sdk.jme.user.UserGender;
import com.shephertz.app42.paas.sdk.jme.user.UserService;
import com.shephertz.app42.paas.sdk.java.ServiceAPI;
import com.shephertz.app42.paas.sdk.java.App42Response;
import com.shephertz.app42.paas.sdk.java.App42Exception;
import com.shephertz.app42.paas.sdk.java.App42BadParameterException;
import com.shephertz.app42.paas.sdk.java.App42NotFoundException;
import com.shephertz.app42.paas.sdk.java.user.User;
import com.shephertz.app42.paas.sdk.java.user.Profile;
import com.shephertz.app42.paas.sdk.java.user.UserGender;
import com.shephertz.app42.paas.sdk.java.user.UserService;
using com.shephertz.app42.paas.sdk.csharp;  
using com.shephertz.app42.paas.sdk.csharp.user;  
<script type="text/javascript" src="App42-all-x.x.x.min.js">&lt;/script>
using com.shephertz.app42.paas.sdk.csharp;  
using com.shephertz.app42.paas.sdk.csharp.user;  
use com\shephertz\app42\paas\sdk\php\App42Response;  
use com\shephertz\app42\paas\sdk\php\App42Exception;  
use com\shephertz\app42\paas\sdk\php\App42BadParameterException;  
use com\shephertz\app42\paas\sdk\php\App42NotFoundException;  
use com\shephertz\app42\paas\sdk\php\user\UserService;  
use com\shephertz\app42\paas\sdk\php\ServiceAPI;  
include_once '../UserService.php';  
include_once '../ServiceAPI.php';   
include_once '../App42Response.php';  
include_once '../App42Exception.php';   
include_once '../App42BadParameterException.php';  
include_once '../App42NotFoundException.php';  
#include "User/UserService.h"
#include "User/App42UserResult.h"
require 'App42_Ruby_API'
import com.shephertz.app42.paas.sdk.as3.ServiceAPI;
import com.shephertz.app42.paas.sdk.as3.App42Response;
import com.shephertz.app42.paas.sdk.as3.App42Exception;
import com.shephertz.app42.paas.sdk.as3.App42BadParameterException;
import com.shephertz.app42.paas.sdk.as3.App42NotFoundException;
import com.shephertz.app42.paas.sdk.as3.user.User;
import com.shephertz.app42.paas.sdk.as3.user.UserService;
Coming Soon

Create User

This function allows you to create a User session for the specified User.

Required Parameters

userName - User for whom User Session is to be created pwd - Password for the User emailId - EmailId of the user

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";    
User user = userService.createUser(userName, pwd, emailId); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
String jsonResponse = user.toString();    
public class Callback : App42Callback  
{  
String userName = "Nick";   
String pwd  = "*****";
String emailId = "nick@shephertz.co.in";
userService.CreateUser(userName,pwd,emailId, this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		User user = (User) response;
		Console.WriteLine("userName is " + user.GetUserName());
		Console.WriteLine("emailId is " + user.GetEmail());     
		String jsonResponse = user.ToString();  
	}  
}  
NSString *userName = @"Nick";
NSString *pwd = @"********";
NSString *emailId = @"nick@shephertz.co.in";
User *user = [userService createUser:userName password:pwd emailAddress:emailId]; 
NSLog(@"userName is %@" , user.userName);
NSLog(@"emailId is %@" ,  user.emailId);
NSString *jsonResponse = [user toString]; 
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";    
User user = userService.createUser(userName, pwd, emailId); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
String jsonResponse = user.toString();    
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";    
User user = userService.createUser(userName, pwd, emailId); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
String jsonResponse = user.toString();  
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";
userService.CreateUser(userName, pwd, emailId,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		User user = (User) response;
		App42Log.Console("userName is " + user.GetUserName());
		App42Log.Console("emailId is " + user.GetEmail()); 
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick";  
var pwd = "*********";  
var emailId = "nick@shephertz.co.in";  
var result ;  
userService.createUser(userName, pwd, emailId,{  
	success: function(object) 
	{  
		var userObj = JSON.parse(object);  
		result = userObj.app42.response.users.user;
		console.log("userName is " + result.userName)
		console.log("emailId is " + result.email)
	},  
	error: function(error) {  
	}  
}); 
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";
User user = userService.CreateUser(userName, pwd, emailId); 
Console.WriteLine("userName is " + user.GetUserName());
Console.WriteLine("emailId is " + user.GetEmail());
String jsonResponse = user.ToString();         
$userName = "Nick";
$pwd = "********";
$emailId = "nick@shephertz.co.in";
$user = $userService->createUser($userName, $pwd, $emailId); 
print_r("userName is " . $user->getUserName());
print_r("emailId is " . $user->getEmail());
$jsonResponse = $user->toString(); 
class CApp42Callback : public IApp42Callback
{
	public:
		void onResult(App42Result* result){
			IwDebugTraceLinePrintf("UserResult::body is %s", result->getBody().c_str());
		}
};
CApp42Callback* authUserCallback = NULL;
std::string userName = "Nick";
std::string pwd = "********";
std::string emailId = "nick@shephertz.co.in";
userService->CreateUser(userName,pwd,emailId,authUserCallback);
UserService::Terminate();
if(authUserCallback)
{
	delete authUserCallback;
	authUserCallback = NULL;
}
user_name = "Nick";
pwd = "********";
emailId = "nick@shephertz.com";
user = user_service.create_user(user_name, pwd, emailId); 
puts "userName is #{user.userName}";
puts "email is #{user.email}";
jsonResponse = user.to_s(); 
var userName:String = "Nick";   
var pwd:String  = "*****";
var emailId:String = "nick@shephertz.co.in";
userService.createUser(userName,pwd,emailId, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var user:User = User(response);
		trace("response is : " + user);
	}  
}  
    Coming Soon 

Create User With Role

This function enables you to create App users along with granting them specific roles.

Required Parameters

userName - User for whom User Session is to be created pwd - Password for the User emailId - EmailId of the user roleList - List of roles to be assigned to User

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";   
ArrayList<String> roleList = new ArrayList<String>();
roleList.add("Admin");
roleList.add("Manager");
roleList.add("Programmer");
roleList.add("Tester"); 
User user = userService.createUser(userName, pwd, emailId,roleList); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
String jsonResponse = user.toString();    
public class Callback : App42Callback  
{  
String userName = "Nick";   
String pwd  = "*****";
String emailId = "nick@shephertz.co.in";
IList<String> roleList = new List<String>();  
roleList.Add("Admin");  
roleList.Add("Manager");  
roleList.Add("Programmer");  
roleList.Add("Tester");  
userService.CreateUser(userName,pwd,emailId,roleList, this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		User user = (User) response;   
		Console.WriteLine("userName is " + user.GetUserName());
		Console.WriteLine("emailId is " + user.GetEmail());  
		String jsonResponse = user.ToString();  
	}  
}  
NSString *userName = @"Nick";
NSString *pwd = @"********";
NSString *emailId = @"nick@shephertz.co.in";
NSArray *roleArray = [[NSArray alloc]initWithObjects:@"Admin",@"Manager",@"Programmer",@"Tester", nil];
User *user = [userService createUser:userName password:pwd emailAddress:emailId roleList:roleArray]; 
NSLog(@"userName is %@" , user.userName);
NSLog(@"emailId is %@" ,  user.emailId);
NSString *jsonResponse = [user toString]; 
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";   
Vector roleList = new Vector();
roleList.addElement("Admin");
roleList.addElement("Manager");
roleList.addElement("Programmer");
roleList.addElement("Tester"); 
User user = userService.createUser(userName, pwd, emailId,roleList); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
String jsonResponse = user.toString();   
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";   
ArrayList<String> roleList = new ArrayList<String>();
roleList.add("Admin");
roleList.add("Manager");
roleList.add("Programmer");
roleList.add("Tester"); 
User user = userService.createUser(userName, pwd, emailId,roleList); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
String jsonResponse = user.toString();   
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";
IList<String> roleList = new List<String>();  
roleList.Add("Admin");  
roleList.Add("Manager");  
roleList.Add("Programmer");  
roleList.Add("Tester");  
userService.CreateUser(userName, pwd, emailId,roleList,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		User user = (User) response;   
		App42Log.Console("userName is " + user.GetUserName());
		App42Log.Console("emailId is " + user.GetEmail()); 
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available       
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";
IList<String> roleList = new List<String>();  
roleList.Add("Admin");  
roleList.Add("Manager");  
roleList.Add("Programmer");  
roleList.Add("Tester");  
User user = userService.CreateUser(userName, pwd, emailId,roleList); 
Console.WriteLine("userName is " + user.GetUserName());
Console.WriteLine("emailId is " + user.GetEmail());
String jsonResponse = user.ToString();         
$userName = "Nick";
$pwd = "********";
$emailId = "nick@shephertz.co.in";
$roleList = array();
array_push($roleList, "Admin");
array_push($roleList, "Manager");
array_push($roleList, "Programmer");
array_push($roleList, "Tester");
$user = $userService->createUser($userName, $pwd, $emailId, $roleList); 
print_r("userName is " . $user->getUserName());
print_r("emailId is " . $user->getEmail());
$jsonResponse = $user->toString(); 
Coming Soon
user_name = "Nick";
pwd = "********";
emailId = "nick@shephertz.com";
roleList = Array.new();
roleList.push("Admin");
roleList.push("Manager");
roleList.push("Programmer");
roleList.push("Tester");		
user = user_service.create_user_with_role(user_name,pwd,emailId,roleList); 
puts "userName is #{user.userName}";
puts "email is #{user.email}";
userRoleList  = user.roleList();
for roles in userRoleList do
puts "role is #{roles}";
end
jsonResponse = user.to_s();
var userName:String = "Nick";   
var pwd:String  = "*****";
var emailId:String = "nick@shephertz.co.in";
var roleList:Array = new Array();
roleList.push("Admin");  
roleList.push("Manager");  
roleList.push("Programmer");  
roleList.push("Tester");  
userService.createUser(userName,pwd,emailId,roleList, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var user:User = User (response);     
		trace("userName is " + user.getUserName());
		trace("emailId is " + user.getEmail());
	}  
}  
Coming Soon

Create User Profile

Creates or Updates User Profile. Note: First time when the Profile for the user is created. In future calls user information will be updated.

Required Parameters

user - User for which profile has to be created/updated

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";						
String pwd = "********";
String emailId = "nick@shephertz.co.in";					
User userObj = userService.createUser(userName, pwd, emailId);  
Profile profile = userObj.new Profile();
Date date = new Date(); 			 
profile.setFirstName("Nick");
profile.setLastName("Gill");
profile.setSex(UserGender.MALE);
profile.setDateOfBirth(date);
profile.setCity("Houston");
profile.setState("Texas");
profile.setPincode("74193");
profile.setCountry("USA");
profile.setMobile("+1-1111-111-111");
profile.setHomeLandLine("+1-2222-222-222");
profile.setOfficeLandLine("+1-33333-333-333");
User user = userService.createOrUpdateProfile(userObj); 
System.out.println("userName is " + user.getUserName());
System.out.println("firstName is " + user.getProfile().getFirstName()); 
System.out.println("city is " + user.getProfile().getCity()); 
System.out.println("country is " + user.getProfile().getCountry()); 
public class Callback : App42Callback  
{  
	String userName = "Nick";   
	String pwd  = "*****";
	String emailId = "nick@shephertz.co.in";
	bool flag  = true;
	userService.CreateUser(userName,pwd,emailId, this); 
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		if(flag)
		{
			User user = (User) response; 
			User.Profile profile = new User.Profile(user);
			profile.SetCountry("USA");
			profile.SetCity("Houston");
			profile.SetDateOfBirth(new DateTime());
			profile.SetFirstName("Nick");
			profile.SetLastName("Gill");
			profile.SetHomeLandLine("+1-1800-877-453");
			profile.SetOfficeLandLine("+1-1800-111-999");
			profile.SetMobile("+958901234571");
			profile.SetSex(UserGender.MALE); 
			flag = false;
			userService.CreateOrUpdateProfile(user, requestCallback);
		}
		String jsonResponse = user.ToString();  
	}  
}  
NSString *userName = @"Nick";
NSString *pwd = @"********";
NSString *emailId = @"nick@shephertz.co.in";
User *userObj = [userService createUser:userName password:password emailAddress:emailId]; 
Profile *profile = [[Profile alloc]initWithUser:userObj];			
profile.firstName = @"Nick";
profile.lastName = @"Gill";
profile.sex = MALE;
NSDate *date = [NSDate date]; 	 		
profile.dateOfBirth = date;
profile.city = @"Houston";
profile.state = @"Texas";
profile.pincode = @"74193";
profile.country = @"USA";
profile.mobile = @"+1-1111-111-111";
profile.homeLandLine = @"+1-2222-222-222";
profile.officeLandLine = @"+1-33333-333-333";	
User *user = [userService createOrUpdateProfile:userObj] 
NSLog(@"userName is %@" , user.userName);
NSLog(@"emailId is %@" ,  user.emailId);
NSString *jsonResponse = [user toString];                      
String userName = "Nick";						
String pwd = "********";
String emailId = "nick@shephertz.co.in";					
User userObj = userService.createUser(userName, pwd, emailId);  
Profile profile = userObj.new Profile();
Date date = new Date(); 			 
profile.setFirstName("Nick");
profile.setLastName("Gill");
profile.setSex(UserGender.MALE);
profile.setDateOfBirth(date);
profile.setCity("Houston");
profile.setState("Texas");
profile.setPincode("74193");
profile.setCountry("USA");
profile.setMobile("+1-1111-111-111");
profile.setHomeLandLine("+1-2222-222-222");
profile.setOfficeLandLine("+1-33333-333-333");
User user = userService.createOrUpdateProfile(userObj); 
System.out.println("userName is " + user.getUserName());
System.out.println("firstName is " + user.getProfile().getFirstName()); 
System.out.println("city is " + user.getProfile().getCity()); 
System.out.println("country is " + user.getProfile().getCountry()); 
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";
User userObj = userService.createUser(userName, pwd, emailId);
Profile profile = userObj.new Profile();
Date date = new Date();
profile.setFirstName("Nick");
profile.setLastName("Gill");
profile.setSex(UserGender.MALE);
profile.setDateOfBirth(date);
profile.setCity("Houston");
profile.setState("Texas");
profile.setPincode("74193");
profile.setCountry("USA");
profile.setMobile("+1-1111-111-111");
profile.setHomeLandLine("+1-2222-222-222");
profile.setOfficeLandLine("+1-33333-333-333");
User user = userService.createOrUpdateProfile(userObj); 
System.out.println("userName is " + user.getUserName());
System.out.println("firstName is " + user.getProfile().getFirstName()); 
System.out.println("city is " + user.getProfile().getCity()); 
System.out.println("country is " + user.getProfile().getCountry()); 
String userName = "Nick";   
String pwd  = "*****";
String emailId = "nick@shephertz.com";
bool flag  = true;
userService.CreateUser(userName,pwd,emailId, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		if(flag)
		{
			User user = (User) response; 
			User.Profile profile = new User.Profile(user);
			profile.SetCountry("USA");
			profile.SetCity("Houston");
			profile.SetDateOfBirth(new DateTime());
			profile.SetFirstName("Nick");
			profile.SetLastName("Gill");
			profile.SetHomeLandLine("+1-1800-877-453");
			profile.SetOfficeLandLine("+1-1800-111-999");
			profile.SetMobile("+958901234571");
			profile.SetSex(UserGender.MALE); 
			flag = false;
			userService.CreateOrUpdateProfile(user, new UnityCallBack());
			/* Above line will create user profile and returns User object which has profile object in it. */
		}
		else {
			User user = (User) response;
			/* This will create user in App42 cloud and will return User object */  
			App42Log.Console("userName is " + user.GetUserName());
			App42Log.Console("emailId is " + user.GetEmail()); 
		}
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available       
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";
User userObj = userService.CreateUser(userName, pwd, emailId);  
User.Profile profile = new User.Profile(userObj);
profile.SetFirstName("Nick");
profile.SetLastName("Gill");
profile.SetSex(UserGender.MALE);
profile.SetDateOfBirth(DateTime.Now);
profile.SetCity("Houston");
profile.SetState("Texas");
profile.SetPincode("74193");
profile.SetCountry("USA");
profile.SetMobile("+1-1111-111-111");
profile.SetHomeLandLine("+1-2222-222-222");
profile.SetOfficeLandLine("+1-33333-333-333");
User user = userService.CreateOrUpdateProfile(userObj); 
Console.WriteLine("userName is " + user.GetUserName());
Console.WriteLine("firstName is " + user.GetProfile().GetFirstName()); 
Console.WriteLine("city is " + user.GetProfile().GetCity()); 
Console.WriteLine("country is " + user.GetProfile().GetCountry()); 
$userName = "Nick";
$pwd = "********";
$emailId = "nick@shephertz.co.in";
$userObj = $userService->createUser($userName, $pwd, $emailId);  
$profile = new Profile($userObj);
$date = date(DATE_ATOM, mktime());
$date1 = strtotime($date);
$currentDate= date('Y-m-j', $date1); 
$profile->setCountry("USA");
$profile->setCity("Houston");
$profile->setDateOfBirth(currentDate);
$profile->setFirstName("Nick");
$profile->setLastName("Gill");
$profile->setHomeLandLine("+1-1800-877-453");
$profile->setOfficeLandLine("+1-1800-111-999");
$profile->setMobile("+1-1111-111-111");
$profile->setSex(UserGender::MALE);
$profile->setState("Texas");
$user = $userService->createOrUpdateProfile($userObj); 
print_r("userName is " . $user->getUserName());
print_r("emailId is " . $user->getEmail()); 
$jsonResponse = $user->toString();  
Coming Soon
user_name = "Nick";
email = "nick@shephertz.com";
user = user_service.createUser(user_name, "ssss", email);
profileObj = App42::User::User::Profile.new();
profileObj.officeLandLine = ("+1-1800-111-999");
profileObj.firstName = "Nick";
profileObj.dateOfBirth = "03-11-2012";
profileObj.country = ("USA");
profileObj.city = ("Houston");
profileObj.lastName = ("Gill");
profileObj.mobile = ("+958901234571");
profileObj.pincode = ("74193");
profileObj.sex = App42::User::User::UserGender.new.enum("MALE");
profileObj.homeLandLine = ("+1-1800-877-453");
profileObj.state = ("Texas");
user.profile= profileObj;
userObj = user_service.createOrUpdateProfile(user);
puts "userName is #{userObj.userName}";
puts "email is #{userObj.email}";
puts "firstName #{userObj.profile.firstName}";
jsonResponse = userObj.to_s(); 
Coming Soon
Coming Soon

Authenticate

Authenticate user based on userName and password.

Required Parameters

userName - UserName which should be unique for the App pwd - Password for the User

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
String pwd = "********";   
User user = userService.authenticate(userName, pwd); 
System.out.println("userName is " + user.getUserName());
System.out.println("sessionId is " + user.getSessionId());
public class Callback : App42Callback  
{  
	String userName = "Nick";   
	String pwd  = "*****";
	userService.Authenticate(userName,pwd, this);  
		void App42Callback.OnException(App42Exception exception)  
		{  
			Console.WriteLine("Exception Message");  
		}  
		void App42Callback.OnSuccess(Object response)  
		{  
			User user = (User) response;     
			Console.WriteLine("userName is " + user.GetUserName());
			Console.WriteLine("sessionId is " + user.GetSessionId());
		}  
}  
NSString *userName = @"Nick";
NSString *pwd = @"********";
User *user = [userService authenticate:userName password:pwd]; 
NSLog(@"userName is %@" , user.userName);
NSLog(@"sessionId is %@" ,  user.sessionId);
String userName = "Nick";
String pwd = "********";   
User user = userService.authenticate(userName, pwd); 
System.out.println("userName is " + user.getUserName());
System.out.println("sessionId is " + user.getSessionId());
String userName = "Nick";
String pwd = "********";   
User user = userService.authenticate(userName, pwd); 
System.out.println("userName is " + user.getUserName());
System.out.println("sessionId is " + user.getSessionId());
String userName = "Nick";
String pwd = "********";
userService.Authenticate(userName, pwd,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		User user = (User) response;     
		App42Log.Console("userName is " + user.GetUserName());
		App42Log.Console("sessionId is " + user.GetSessionId());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick";  
var pwd = "*********";  
var result ;  
userService.authenticate(userName, pwd,{  
	success: function(object) 
	{  
		var userObj = JSON.parse(object);  
		result = userObj.app42.response.users.user;
		console.log("userName is " + result.userName)
		console.log("sessionId is " + result.sessionId)
	},  
	error: function(error) {
	}  
}); 
String userName = "Nick";
String pwd = "********";
User user = userService.Authenticate(userName, pwd); 
Console.WriteLine("userName is " + user.GetUserName());
Console.WriteLine("sessionId is " + user.GetSessionId());
String jsonResponse = user.ToString();         
$userName = "Nick";
$pwd = "********";
$user = $userService->authenticate($userName, $pwd); 
print_r("userName is " . $user->getUserName());
print_r("sessionId is " . $user->getSessionId());
$jsonResponse = $user->toString(); 
class CApp42Callback : public IApp42Callback
{
	public:
		void onResult(App42Result* result){
			IwDebugTraceLinePrintf("UserResult::body is %s", result->getBody().c_str());
		}
};
CApp42Callback* authUserCallback = NULL;
std::string userName = "Nick";
std::string pwd = "********";
userService->Authenticate(userName,pwd,authUserCallback);

UserService::Terminate();
if(authUserCallback)
{
	delete authUserCallback;
	authUserCallback = NULL;
}
user_name = "Nick";
pwd = "*******";
user = user_service.authenticate(user_name, pwd); 
puts "email is #{user.userName}";
jsonResponse = user.to_s(); 
var userName:String = "Nick";   
var pwd:String  = "*****";
userService.authenticate(userName,pwd, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception : "+ excption);  
	}  
	public function onSuccess(response:Object):void  
	{  
		var user:User = User(response);
		trace("userName is " + user.getUserName());
		trace("sessionId is " + user.getSessionId());
	}  
}
Coming Soon 

Change User Password

Change the password for user based on the userName. If the old password is valid.

Required Parameters

userName - UserName which should be unique for the App oldPwd - Old Password for the user for authentication newPwd - New Password for the user to change

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
String oldPwd   = "******";
String newPwd   = "*******";	
App42Response response = userService.changeUserPassword(userName, oldPwd, newPwd); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
public class Callback : App42Callback  
{  
	String userName = "Nick"; 
	String oldPwd   = "******";
	String newPwd   = "*******";	
	userService.ChangeUserPassword(userName,oldPwd,newPwd, this);  
		void App42Callback.OnException(App42Exception exception)  
		{  
			Console.WriteLine("Exception Message");  
		}  
		void App42Callback.OnSuccess(Object response)  
		{  
			App42Response response = (App42Response) response;     
			String jsonResponse = response.ToString();  
		}  
}  
NSString *userName = @"Nick"; 
NSString *oldPwd = @"*******"; 
NSString *newPwd = @"*******"; 
App42Response *response = [userService changeUserPassword:userName oldPassword:oldPwd newPassword:newPwd]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];                             
String userName = "Nick";
String oldPwd   = "******";
String newPwd   = "*******";	
App42Response response = userService.changeUserPassword(userName, oldPwd, newPwd); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String userName = "Nick";
String oldPwd   = "******";
String newPwd   = "*******";	
App42Response response = userService.changeUserPassword(userName, oldPwd, newPwd); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String userName = "Nick";
String oldPwd   = "******";
String newPwd   = "*******";	
userService.ChangeUserPassword(userName, oldPwd, newPwd,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response response = (App42Response) response;     
		String jsonResponse = response.ToString();  
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
oldPwd   = "******",
newPwd   = "*******",
result ;  
userService.changeUserPassword(userName, oldPwd, newPwd,{  
	success: function(object) 
	{  
		var userObj = JSON.parse(object);  
		result = userObj.app42.response;
		console.log("success is " + result.success)
	},  
	error: function(error) {
	}  
}); 
String userName = "Nick";
String oldPwd   = "******";
String newPwd   = "*******";	
App42Response response = userService.ChangeUserPassword(userName, oldPwd, newPwd); 
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString(); 
$userName = "Nick";
$oldPwd   = "*******";
$newPwd   = "*******";
$response = $userService->changeUserPassword($userName, $oldPwd, $newPwd); 
$success = $respons->isResponseSuccess();
$jsonResponse = $respons->toString(); 
Coming Soon
user_name = "Nick";
old_Pwd = "*******";
new_Pwd = "*******";
response = user_service.change_user_password(user_name, old_Pwd, new_Pwd); 
success = response.is_response_success();
jsonResponse = response.to_s(); 
var userName:String = "Nick"; 
var oldPwd:String = "******";
var newPwd:String = "*******";	
userService.changeUserPassword(userName,oldPwd,newPwd, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception : ") + excption;  
	}  
	public function onSuccess(response:Object):void
	{  
		var response:App42Response = App42Response (response);
		trace("response is : " + response);
	}  
}  
Coming Soon 

Assign Roles

Assign Roles for the App.

Required Parameters

userName - UserName which should be unique for the App roleList - List of roles to be assigned to User

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
ArrayList<String> roleList = new ArrayList<String>();
roleList.add("Admin");
roleList.add("Manager");
roleList.add("Programmer");
roleList.add("Tester"); 
User user = userService.AssignRoles(userName,roleList); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
for(int i = 0; i < user.getRoleList().size();i++)
{
	System.out.println("roleList is " + user.getRoleList().get(i));
}
public class Callback : App42Callback  
{  
String userName = "Nick";  
IList<String> roleList = new List<String>();  
roleList.Add("Admin");  
roleList.Add("Manager");  
roleList.Add("Programmer");  
roleList.Add("Tester");  
userService.AssignRoles(userName,roleList, this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		trace("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		User user = (User) response;     
		Console.WriteLine("userName is " + user.GetUserName());
		Console.WriteLine("emailId is " + user.GetEmail());
		for(int i = 0; i < user.GetRoleList().Count;i++)
		{
			Console.WriteLine("roleList is " + user.GetRoleList()[i]);
		}
	}  
}  
NSString *userName = @"Nick";
NSArray *roleArray = [[NSArray alloc]initWithObjects:@"Admin",@"Manager",@"Programmer",@"Tester", nil];
User *user = [userService assignRoles:userName roleList:roleArray]; 
NSLog(@"userName is %@" , user.userName);
NSLog(@"emailId is %@" ,  user.emailId);
NSString *jsonResponse = [user toString]; 
String userName = "Nick";
Vector roleList = new Vector();
roleList.addElement("Admin");
roleList.addElement("Manager");
roleList.addElement("Programmer");
roleList.addElement("Tester"); 
User user = userService.assignRoles(userName,roleList); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
Vector roleList = user.getRoleList();   
for(int i=0;i < roleList.size();i++)  
{ 
	User role = (User)roleList.elementAt(i);  
	System.out.println("role is " + role);
}         
String userName = "Nick";
ArrayList<String> roleList = new ArrayList<String>();
roleList.add("Admin");
roleList.add("Manager");
roleList.add("Programmer");
roleList.add("Tester"); 
User user = userService.assignRoles(userName,roleList); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
for(int i = 0; i < user.getRoleList().size();i++)
{
	System.out.println("roleList is " + user.getRoleList().get(i));
}
String userName = "Nick";
IList<String> roleList = new List<String>();  
roleList.Add("Admin");  
roleList.Add("Manager");  
roleList.Add("Programmer");  
roleList.Add("Tester");  
userService.AssignRoles(userName,roleList,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		User user = (User) response;     
		App42Log.Console("userName is " + user.GetUserName());
		App42Log.Console("emailId is " + user.GetEmail());
		for(int i = 0; i < user.GetRoleList().Count;i++)
		{
			App42Log.Console("roleList is " + user.GetRoleList()[i]);
		}
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available       
String userName = "Nick";
IList<String> roleList = new List<String>();  
roleList.Add("Admin");  
roleList.Add("Manager");  
roleList.Add("Programmer");  
roleList.Add("Tester");  
User user = userService.AssignRoles(userName,roleList); 
Console.WriteLine("userName is " + user.GetUserName());
Console.WriteLine("emailId is " + user.GetEmail());
for(int i = 0; i < user.GetRoleList().Count;i++)
{
	Console.WriteLine("roleList is " + user.GetRoleList()[i]);
}
$userName = "Nick";
$roleList = array();
array_push($roleList, "Admin");
array_push($roleList, "Manager");
array_push($roleList, "Programmer");
array_push($roleList, "Tester");
$user = $userService->assignRoles($userName, $roleList); 
print_r("userName is " . $user->getUserName());
print_r("emailId is " . $user->getEmail());
$jsonResponse = $user->toString(); 
Coming Soon
user_name = "Nick";
roleList = Array.new();
roleList.push("Admin");
roleList.push("Manager");
roleList.push("Programmer");
roleList.push("Tester");
user = userService.assign_roles(user_name,roleList); 
puts "userName is #{user.userName}";
userRoleList = user.roleList();
for roles in userRoleList do
puts "role is #{roles}";
end
jsonResponse = user.to_s(); 
var userName:String = "Nick";  
var roleList:Array = new Array();  
roleList.push("Admin");  
roleList.push("Manager");  
roleList.push("Programmer");  
roleList.push("Tester");  
userService.assignRoles(userName,roleList, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var user:User = User(response);
		trace("response is : " + user);
	}  
}  
Coming Soon

Get User

Gets user details based on userName.

Required Parameters

userName - UserName which should be unique for the App

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
User user = userService.getUser(userName); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
String jsonResponse = user.toString();    
public class Callback : App42Callback  
{  
	String userName = "Nick";  
	userService.GetUser(userName, this);  
		void App42Callback.OnException(App42Exception exception)  
		{  
			Console.WriteLine("Exception Message");  
		}  
		void App42Callback.OnSuccess(Object response)  
		{  
			User user = (User) response;     
			Console.WriteLine("userName is " + user.GetUserName());
			Console.WriteLine("emailId is " + user.GetEmail());
		}  
}  
NSString *userName = @"Nick";
User *user = [userService getUser:userName]; 
NSLog(@"userName is %@" , user.userName);
NSLog(@"emailId is %@" ,  user.emailId);
NSString *jsonResponse = [user toString]; 
String userName = "Nick";
User user = userService.getUser(userName); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
String jsonResponse = user.toString();   
String userName = "Nick";
User user = userService.getUser(userName); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
String jsonResponse = user.toString();   
String userName = "Nick";
userService.GetUser(userName,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		User user = (User) response;     
		App42Log.Console("userName is " + user.GetUserName());
		App42Log.Console("emailId is " + user.GetEmail());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick";  
var result ;  
userService.getUser(userName,{  
	success: function(object)
	{  
		var userObj = JSON.parse(object);  
		result = userObj.app42.response.users.user;
		console.log("userName is " + result.userName)
		console.log("emailId is " + result.email)
	},  
	error: function(error) {  
	}  
});     
String userName = "Nick";
User user = userService.GetUser(userName); 
Console.WriteLine("userName is " + user.GetUserName());
Console.WriteLine("emailId is " + user.GetEmail());
String jsonResponse = user.ToString();         
$userName = "Nick";
$user = $userService->getUser($userName); 
print_r("userName is " . $user->getUserName());
print_r("emailId is " . $user->getEmail());
$jsonResponse = $user->toString(); 
class CApp42Callback : public IApp42Callback
{
	public:
		void onResult(App42Result* result)
		{
			IwDebugTraceLinePrintf("UserResult::body is %s", result->getBody().c_str());
		}
};
CApp42Callback* authUserCallback = NULL;
std::string userName = "Nick";
userService->GetUser(userName,authUserCallback);
UserService::Terminate();
if(authUserCallback)
{
	delete authUserCallback;
	authUserCallback = NULL;
}
user_name = "Nick";	
user = user_service.get_user(user_name); 
puts "userName is #{user.userName}";
puts "email is #{user.email}";
puts "firstName #{user.profile.firstName}";
jsonResponse = user.to_s();
var userName:String = "Nick";  
userService.getUser(userName, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception : " + excption);  
	}  
	public function onSuccess(response:Object):void  
	{  
		var user:User = User (response);
		trace("userName is " + user.getUserName());
		trace("emailId is " + user.getEmail());
	}  
}  
Coming Soon

Get Roles By User

Get Roles based on userName.

Required Parameters

userName - UserName which should be unique for the App

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
User user = userService.getRolesByUser(userName); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
for(int i = 0; i < user.getRoleList().size();i++)
{
	System.out.println("roleList is " + user.getRoleList().get(i));
}
public class Callback : App42Callback  
{  
	String userName = "Nick";  
	userService.GetRolesByUser(userName, this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		User user = (User) response;      
		Console.WriteLine("userName is " + user.GetUserName());
		Console.WriteLine("emailId is " + user.GetEmail());
		for(int i = 0; i < user.GetRoleList().Count;i++)
		{
			Console.WriteLine("roleList is " + user.GetRoleList()[i]);
		}
	}  
}  
NSString *userName = @"Nick";
User *user = [userService getRolesByUser:userName]; 
NSLog(@"userName is %@" , user.userName);
NSLog(@"emailId is %@" ,  user.emailId);
NSString *jsonResponse = [user toString]; 
String userName = "Nick";
User user = userService.getRolesByUser(userName); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
String jsonResponse = user.toString();   
String userName = "Nick";
User user = userService.getRolesByUser(userName); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
for(int i = 0; i < user.getRoleList().size();i++)
{
	System.out.println("roleList is " + user.getRoleList().get(i));
}
String userName = "Nick";
userService.GetRolesByUser(userName,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		User user = (User) response;      
		App42Log.Console("userName is " + user.GetUserName());
		App42Log.Console("emailId is " + user.GetEmail());
		for(int i = 0; i < user.GetRoleList().Count;i++)
		{
			App42Log.Console("roleList is " + user.GetRoleList()[i]);
		}
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available   
String userName = "Nick";
User user = userService.GetRolesByUser(userName); 
Console.WriteLine("userName is " + user.GetUserName());
Console.WriteLine("emailId is " + user.GetEmail());
for(int i = 0; i < user.GetRoleList().Count;i++)
{
	Console.WriteLine("roleList is " + user.GetRoleList()[i]);
}
$userName = "Nick";
$user = $userService->getRolesByUser($userName); 
print_r("userName is " . $user->getUserName());
print_r("emailId is " . $user->getEmail());
$jsonResponse = $user->toString(); 
Coming Soon
user_name = "Nick";
user = user_service.get_roles_by_user(user_name); 
puts "userName is #{user.userName}";
puts "email is #{user.email}";  
userRoleList = user.roleList(); 
puts "firstName is #{user.profile.firstName}";  
jsonResponse = user.to_s();  
var userName:String = "Nick";  
userService.getRolesByUser(userName, new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var user:User = User (response);
		trace("response is " + user);
	}  
}  
Coming Soon

Get Users By Role

Get Users based on Role.

Required Parameters

role - Role which should be unique for the App.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String role = "Role of the User";
ArrayList<User> user = userService.getUsersByRole(role); 
for(int i = 0; i < user.size(); i++) 
{
	System.out.println("userName is " + user.get(i).getUserName());
	System.out.println("emailId is " + user.get(i).getEmail());
	ArrayList<String> roleList = user.get(i).getRoleList();
	for(int j = 0; j < roleList.size();j++) 
	{
		System.out.println("roleList is " + roleList);
	}
}
public class Callback : App42Callback  
{  
	String role = "Role of the User";   
	userService.GetUsersByRole(role, this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		IList<User> user = (IList<User>) response;  
		for(int i = 0; i < user.Count; i++) 
		{
			Console.WriteLine("userName is " + user[i].GetUserName());
			Console.WriteLine("emailId is " + user[i].GetEmail());
			IList<String> roleList = user[i].GetRoleList();
			for(int j = 0; j < roleList.Count;j++) 
			{
				Console.WriteLine("roleList is " + roleList);
			}
		}     
	}  
}  
NSString *userName = @"Role of the User";
NSArray *user = [userService getUsersByRole:userName]; 
NSLog(@"userName is %@" , [[user objectAtIndex:0] userName]);
NSLog(@"emailId is %@" ,  [[user objectAtIndex:0] emailId]);
NSString *jsonResponse =[[user objectAtIndex:0] toString]; 
String role = "Role of the User";
Vector userList = userService.getUsersByRole(role); 
for(int i=0;i < userList.size();i++)  
{ 
	User uset = (User)userList.elementAt(i);  
	System.out.println("userName is " + uset.getUserName());
	System.out.println("emailId is " + uset.getEmail());
	Vector userRoleList  = user.getRoleList();
	for(int j =0;j< userRoleList.size();j++)
	{
		String role = (String) userRoleList.elementAt(j);
		System.out.println("role is " + role);
	}
}         
String role = "Role of the User";
ArrayList<User> user = userService.getUsersByRole(role);
for(int i = 0; i < user.size(); i++) 
{
	System.out.println("userName is " + user.get(i).getUserName());
	System.out.println("emailId is " + user.get(i).getEmail());
	ArrayList<String> roleList = user.get(i).getRoleList();
	for(int j = 0; j < roleList.size();j++) 
	{
		System.out.println("roleList is " + roleList);
	}
}
String role = "Role of the User";
userService.GetUsersByRole(role,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		IList<User> user = (IList<User>) response;  
		for(int i = 0; i < user.Count; i++) 
		{
			App42Log.Console("userName is " + user[i].GetUserName());
			App42Log.Console("emailId is " + user[i].GetEmail());
			IList<String> roleList = user[i].GetRoleList();
			for(int j = 0; j < roleList.Count;j++) 
			{
				App42Log.Console("roleList is " + roleList);
			}
		}     
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
String role = "Role of the User";
IList<User> user = userService.GetUsersByRole(role); 
for(int i = 0; i < user.Count; i++) 
{
	Console.WriteLine("userName is " + user[i].GetUserName());
	Console.WriteLine("emailId is " + user[i].GetEmail());
	IList<String> roleList = user[i].GetRoleList();
	for(int j = 0; j < roleList.Count;j++) 
	{
		Console.WriteLine("roleList is " + roleList);
	}
}     
$role = "Role of the User";
$user = $userService->getUsersByRole($role); 
print_r("userName is " . $user[0]->getUserName());
print_r("emailId is " . $user[0]->getEmail());
$jsonResponse = $user[0]->toString(); 
Coming Soon
role = "Role of the User";
userList = userService.get_users_by_role(role); /* returns the User object. */
puts "userName is #{user.userName}";
puts "email is #{user.email}";
puts "firstName #{user.profile.firstName}";
userRoleList = user.roleList(); 
jsonResponse = user.to_s();  /* returns the response in JSON format. (as shown below)*/

var role:String = "Role of the User";   
userService.getUsersByRole(role, new callback() ); 
public class callback implements App42CallBack  
{   
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		trace("response is : " + response);  
	}  
}  
Coming Soon

Get All Users

Gets All users details.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
ArrayList<User> user = userService.getAllUsers(); 
for(int i = 0; i < user.size(); i++) 
{
	System.out.println("userName is " + user.get(i).getUserName());
	System.out.println("emailId is " + user.get(i).getEmail());
}
public class Callback : App42Callback  
{  
	userService.GetAllUsers(this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		IList<User> user = (IList<User>) response;  
		for(int i = 0; i < user.Count; i++) 
		{
			Console.WriteLine("userName is " + user[i].GetUserName());
			Console.WriteLine("emailId is " + user[i].GetEmail());
		}     
	}  
}  
NSArray *user = [userService getAllUsers]; 
NSLog(@"userName is %@" , [[user objectAtIndex:0] userName]);
NSLog(@"emailId is %@" ,  [[user objectAtIndex:0] emailId]);
NSString *jsonResponse =[[user objectAtIndex:0] toString]; 
Vector userList = userService.getAllUsers(); 
for(int i=0;i < userList.size();i++)  
{ 
	User uset = (User)userList.elementAt(i);  
	System.out.println("userName is " + uset.getUserName());
	System.out.println("emailId is " + uset.getEmail());
}         
ArrayList<User> user = userService.getAllUsers(); 
for(int i = 0; i < user.size(); i++) 
{
	System.out.println("userName is " + user.get(i).getUserName());
	System.out.println("emailId is " + user.get(i).getEmail());
}
userService.GetAllUsers(new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		IList<User> user = (IList<User>) response;  
		for(int i = 0; i < user.Count; i++) 
		{
			App42Log.Console("userName is " + user[i].GetUserName());
			App42Log.Console("emailId is " + user[i].GetEmail());
		}     
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var result ;  
userService.getAllUsers({  
success: function(object)
 {  
	var userObj = JSON.parse(object);
	result = userObj.app42.response.users.user;
	if(result.length == undefined)
	{
		console.log(result.userName)
	}
	else
	for(var i = 0;i<result.length;i++){
		console.log(result[i].userName)
	}
},  
error: function(error) {  
}  
});     
IList<User> user = userService.GetAllUsers(); 
for(int i = 0; i < user.Count; i++) 
{
	Console.WriteLine("userName is " + user[i].GetUserName());
	Console.WriteLine("emailId is " + user[i].GetEmail());
}             
$user = $userService->getAllUsers(); 
print_r("userName is " . $user[0]->getUserName());
print_r("emailId is " . $user[0]->getEmail());
$jsonResponse = $user[0]->toString(); 
class CApp42Callback : public IApp42Callback
{
	public:
	void onResult(App42Result* result)
	{
		IwDebugTraceLinePrintf("UserResult::body is %s", result->getBody().c_str());
	}
};
CApp42Callback* authUserCallback = NULL;
userService->GetAllUsers(authUserCallback);
UserService::Terminate();
if(authUserCallback)
{
	delete authUserCallback;
	authUserCallback = NULL;
}
user_list = user_service.get_all_users(); 
for user in user_list do
puts "userName is #{user.userName}";
puts "email is #{user.email}";
end
jsonResponse = user_list.to_s();
userService.getAllUsers(new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		trace("response is : " + response);  
	}  
}  
Coming Soon

Get All Users Count

Gets the count of all the users.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
App42Response response = userService.getAllUsersCount(); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
public class Callback : App42Callback  
{  
	userService.GetAllUsersCount(this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		App42Response response = (App42Response) response;     
		String jsonResponse = response.ToString();  
	}  
}  
App42Response *response = [userService getAllUsersCount]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];                             
App42Response response = userService.getAllUsersCount(); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
App42Response response = userService.getAllUsersCount(); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
userService.GetAllUsersCount(new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Log.Console("Success : " + response);
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
App42Response response = userService.GetAllUsersCount(); 
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString(); 
$response = $userService->getAllUsersCount(); 
$success = $respons->isResponseSuccess();
$jsonResponse = $respons->toString(); 
Coming Soon
response = user_service.get_all_users_count(); 
success = response.is_response_success();  
total_records = response.totalRecords();  
jsonResponse = response.to_s(); 
userService.getAllUsers(new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		trace("response is : " + response);  
	}  
}  
Coming Soon 

Get All Users Paging

Gets All users By Paging.

Required Parameters

max - Maximum number of records to be fetched. offset - From where the records are to be fetched

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
int max = 1;
int offset = 0 ;
ArrayList<User> user = userService.getAllUsers(max,offset); 
for(int i = 0; i < user.size(); i++) 
{
	System.out.println("userName is " + user.get(i).getUserName());
	System.out.println("emailId is " + user.get(i).getEmail());
}
public class Callback : App42Callback  
{  
	int max = 1;
	int offset = 0 ;
	userService.GetAllUsers(max,offset,this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		IList<User> user = (IList<User>) response;     
		for(int i = 0; i < user.Count; i++) 
		{
			Console.WriteLine("userName is " + user[i].GetUserName());
			Console.WriteLine("emailId is " + user[i].GetEmail());
		}      
	}  
}  
int max = 1;
int offset = 0 ;
NSArray *user = [userService getAllUsers:max offset:offset]; 
NSLog(@"userName is %@" , [[user objectAtIndex:0] userName]);
NSLog(@"emailId is %@" ,  [[user objectAtIndex:0] emailId]);
NSString *jsonResponse =[[user objectAtIndex:0] toString]; 
Integer max = new Integer(1);
Integer offset = new Integer(0);  
Vector userList = userService.getAllUsers(max,offset); 
for(int i=0;i < userList.size();i++)  
{ 
	User uset = (User)userList.elementAt(i);  
	System.out.println("userName is " + uset.getUserName());
	System.out.println("emailId is " + uset.getEmail());
}         
int max = 1;
int offset = 0 ;
ArrayList<User> user = userService.getAllUsers(max,offset); 
for(int i = 0; i < user.size(); i++) 
{
	System.out.println("userName is " + user.get(i).getUserName());
	System.out.println("emailId is " + user.get(i).getEmail());
}
int max = 1;
int offset = 0 ;
userService.GetAllUsers(max,offset,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		IList<User> user = (IList<User>) response;     
		for(int i = 0; i < user.Count; i++) 
		{
			App42Log.Console("userName is " + user[i].GetUserName());
			App42Log.Console("emailId is " + user[i].GetEmail());
		}      
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
int max = 1;
int offset = 0 ;
IList<User> user = userService.GetAllUsers(max,offset); 
for(int i = 0; i < user.Count; i++) 
{
	Console.WriteLine("userName is " + user[i].GetUserName());
	Console.WriteLine("emailId is " + user[i].GetEmail());
}             
$max = 1;
$offset = 0 ;
$user = $userService->getAllUsers(max,offset); 
print_r("userName is " . $user[0]->getUserName());
print_r("emailId is " . $user[0]->getEmail());
$jsonResponse = $user[0]->toString(); 
Coming Soon
max = 1;
offset = 0 ;
user_list = Array.new();
user_list = user_service.get_all_users_by_paging(max, offset); 
for user in user_list do
	puts "userName is #{user.userName}";
	puts "email is #{user.email}";
end
jsonResponse = user_list.to_s(); 
var max:int = 1;
var offset:int = 0;
userService.getAllUsersWithPaging(max,offset,new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		trace("response is : " + response);  
	}  
}  
Coming Soon

Get User By Emailid

Gets user details based on Email Id.

Required Parameters

emailId - EmailId of the user

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String emailId = "nick@shephertz.co.in";
User user = userService.getUserByEmailId(emailId); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
String jsonResponse = user.toString();    
public class Callback : App42Callback  
{  
	String emailId = "nick@shephertz.co.in";  
	userService.GetUserByEmailId(emailId, this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		User user = (User) response;     
		String jsonResponse = user.ToString();  
	}  
}  
NSString *emailId = @"nick@shephertz.co.in";
User *user = [userService getUserByEmailId:emailId]; 
NSLog(@"userName is %@" , user.userName);
NSLog(@"emailId is %@" ,  user.emailId);
NSString *jsonResponse = [user toString]; 
String emailId = "nick@shephertz.co.in";
User user = userService.getUserByEmailId(emailId); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
String jsonResponse = user.toString();   
String emailId = "nick@shephertz.co.in";
User user = userService.getUserByEmailId(emailId); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
String jsonResponse = user.toString();   
String emailId = "nick@shephertz.co.in";
userService.GetUserByEmailId(emailId, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Log.Console("Success : " + response);
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var emailId = "nick@shephertz.co.in";  
var result ;  
userService.getUserByEmailId(emailId,{  
success: function(object)
	{  
		var userObj = JSON.parse(object);  
		result = userObj.app42.response.users.user;
		console.log("userName is " + result.userName)
		console.log("emailId is " + result.email)
	},  
	error: function(error) {  
	}  
});     
String emailId = "nick@shephertz.co.in";
User user = userService.GetUserByEmailId(emailId); 
Console.WriteLine("userName is " + user.GetUserName());
Console.WriteLine("emailId is " + user.GetEmail());
String jsonResponse = user.ToString();         
$emailId = "nick@shephertz.co.in";
$user = $userService->getUserByEmailId($emailId); 
print_r("userName is " . $user->getUserName());
print_r("emailId is " . $user->getEmail());
$jsonResponse = $user->toString(); 
Coming Soon
email_id = "nick@shephertz.com";	
user = user_service.get_user_by_email_id(email_id); 
puts "userName is #{user.userName}";
puts "email is #{user.email}";
jsonResponse = user.to_s(); 
var emailId:String = "nick@shephertz.com";
userService.getUserByEmailId(emailId,new callback()); 
public class callback implements App42CallBack  
{   
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		trace("response is : " + response);  
	}  
}  
Coming Soon

Lock User

Locks the user based on the userName. Apps can use these feature to lock a user because of reasons specific to their usercase e.g. If payment not received and the App wants the user to be inactive.

Required Parameters

userName - UserName which should be unique for the App

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
User user = userService.lockUser(userName); 
System.out.println("userName is " + user.getUserName());
System.out.println("accountLocked is " + user.isAccountLocked());
String jsonResponse = user.toString();    
public class Callback : App42Callback  
{  
	String userName = "Nick";  
	userService.LockUser(userName, this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		User user = (User) response;     
		Console.WriteLine("userName is " + user.GetUserName());
		Console.WriteLine("accountLocked is " + user.IsAccountLocked()); 
	}  
}  
NSString *userName = @"Nick";
User *user = [userService lockUser:userName]; 
NSLog(@"userName is %@" , user.userName);
NSString *jsonResponse = [user toString]; 
String userName = "Nick";
User user = userService.lockUser(userName); 
System.out.println("userName is " + user.getUserName());
System.out.println("accountLocked is " + user.isAccountLocked());
String userName = "Nick";
User user = userService.lockUser(userName); 
System.out.println("userName is " + user.getUserName());
System.out.println("accountLocked is " + user.isAccountLocked());
String userName = "Nick";
userService.LockUser(userName, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		User user = (User) response;     
		App42Log.Console("userName is " + user.GetUserName());
		App42Log.Console("accountLocked is " + user.IsAccountLocked()); 
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available     
String userName = "Nick";
User user = userService.LockUser(userName); 
Console.WriteLine("userName is " + user.GetUserName());
Console.WriteLine("accountLocked is " + user.IsAccountLocked());
$userName = "Nick";
$user = $userService->lockUser($userName); 
print_r("userName is " . $user->getUserName());
$jsonResponse = $user->toString(); 
Coming Soon
user_name = "Nick";
user = user_service.lock_user(user_name); 
userName = user.userName();
jsonResponse = user.to_s(); 
var userName:String = "Nick";
userService.lockUser(userName,new callback()); 
public class callback implements App42CallBack  
{   
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}
	public function onSuccess(response:Object):void  
	{  
		var user:User = User(response);
		trace("userName is " + user.getUserName());
		trace("accountLocked is " + user.isAccountLocked());
	}  
}  
Coming Soon

Unlock User

Unlock the user based on the userName. Apps can use these feature to unlock a user because of reasons specific to their usercase e.g. If payment received and the App wants to the user to be active.

Required Parameters

userName - UserName which should be unique for the App

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
User user = userService.unlockUser(userName); 
System.out.println("userName is " + user.getUserName());
System.out.println("accountLocked is " + user.isAccountLocked());
public class Callback : App42Callback  
{  
	String userName = "Nick";  
	userService.UnlockUser(userName, this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		User user = (User) response;     
		Console.WriteLine("userName is " + user.GetUserName());
		Console.WriteLine("accountLocked is " + user.IsAccountLocked());
	}  
}  
NSString *userName = @"Nick";
User *user = [userService unlockUser:userName]; 
NSLog(@"userName is %@" , user.userName);
NSString *jsonResponse = [user toString]; 
String userName = "Nick";
User user = userService.unlockUser(userName); 
System.out.println("userName is " + user.getUserName());
System.out.println("accountLocked is " + user.isAccountLocked());
String userName = "Nick";
User user = userService.unlockUser(userName); 
System.out.println("userName is " + user.getUserName());
System.out.println("accountLocked is " + user.isAccountLocked());
String userName = "Nick";
userService.UnlockUser(userName, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		User user = (User) response;     
		Console.WriteLine("userName is " + user.GetUserName());
		Console.WriteLine("accountLocked is " + user.IsAccountLocked());
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available     
String userName = "Nick";
User user = userService.UnlockUser(userName); 
Console.WriteLine("userName is " + user.GetUserName());
Console.WriteLine("accountLocked is " + user.IsAccountLocked());
$userName = "Nick";
$user = $userService->unlockUser($userName); 
print_r("userName is " . $user->getUserName());
$jsonResponse = $user->toString(); 
Coming Soon

user_name = "Nick";
user = user_service.unlock_user(user_name); 
userName = user.userName();
jsonResponse = user.to_s(); 
var userName:String = "Nick";
userService.unlockUser(userName,new callback()); 
public class callback implements App42CallBack  
{   
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		var user:User = User(response);
		trace("userName is " + user.getUserName());
		trace("accountLocked is " + user.isAccountLocked());
	}  
}  
Coming Soon

Get Locked Users

Gets All the locked users details.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
ArrayList<User> user = userService.getLockedUsers(); 
for(int i = 0; i < user.size(); i++) 
{
	System.out.println("userName is " + user.get(i).getUserName());
	System.out.println("accountLocked is " + user.get(i).isAccountLocked());
}
public class Callback : App42Callback  
{  
	userService.GetLockedUsers(this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		IList<User> user = (IList<User>) response;     
		for(int i = 0; i < user.Count; i++) 
		{
			Console.WriteLine("userName is " + user[i].GetUserName());
			Console.WriteLine("accountLocked is " + user.IsAccountLocked());
		}      
	}  
}  
NSArray *user = [userService getLockedUsers]; 
NSLog(@"userName is %@" , [[user objectAtIndex:0] userName]);
NSString *jsonResponse =[[user objectAtIndex:0] toString]; 
Vector userList = userService.getLockedUsers(); 
for(int i=0;i < userList.size();i++)  
{ 
	User uset = (User)userList.elementAt(i);  
	System.out.println("userName is " + uset.getUserName());
	System.out.println("accountLocked is " + uset.isAccountLocked());
}           
ArrayList<User> user = userService.getLockedUsers(); 
for(int i = 0; i < user.size(); i++) 
{
	System.out.println("userName is " + user.get(i).getUserName());
	System.out.println("accountLocked is " + user.get(i).isAccountLocked());
}
userService.GetLockedUsers(new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		IList<User> user = (IList<User>) response;     
		for(int i = 0; i < user.Count; i++) 
		{
			App42Log.Console("userName is " + user[i].GetUserName());
			App42Log.Console("accountLocked is " + user.IsAccountLocked());
		}      
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
IList<User> user = userService.GetLockedUsers();    
for(int i = 0; i < user.Count; i++) 
{
	Console.WriteLine("userName is " + user[i].GetUserName());
	Console.WriteLine("accountLocked is " + user.IsAccountLocked());
}      
$user = $userService->getLockedUsers(); 
print_r("userName is " . $user[0]->getUserName());
$jsonResponse = $user[0]->toString(); 
Coming Soon
user_list = Array.new();
user_list = user_service.get_locked_users(); 
for user in user_list do
  puts "userName is #{user.userName}";
  puts "email is #{user.email}";
end
jsonResponse = user_list.to_s(); 
userService.getLockedUser(new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		trace("response is : " + response);  
	}  
}  
Coming Soon

Get Locked Users Count

Gets the count of all the locked users.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
App42Response response = userService.getLockedUsersCount(); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
public class Callback : App42Callback  
{  
	userService.GetLockedUsersCount(this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		App42Response response = (App42Response) response;     
		String jsonResponse = response.ToString();  
	}  
}  
App42Response *response = [userService getLockedUsersCount]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];                             
App42Response response = userService.getLockedUsersCount(); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
App42Response response = userService.getLockedUsersCount(); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
userService.GetLockedUsersCount(new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Log.Console("Success : " + response);
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
App42Response response = userService.GetLockedUsersCount(); 
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString(); 
$response = $userService->getLockedUsersCount(); 
$success = $respons->isResponseSuccess();
$jsonResponse = $respons->toString(); 
Coming Soon
response = user_service.get_locked_users_count(); 
success = response.is_response_success();  
total_records = response.totalRecords();  
jsonResponse = response.to_s(); 
userService.getLockedUsersCount(new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		trace("response is : " + response);  
	}  
}  
Coming Soon 

Get Locked Users Paging

Gets All the locked users details By paging.

max - Maximum number of records to be fetched. offset - From where the records are to be fetched

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
int max = 1;
int offset = 0 ;
ArrayList<User> user = userService.getLockedUsers(max,offset);   
for(int i = 0; i < user.size(); i++) 
{
	System.out.println("userName is " + user.get(i).getUserName());
	System.out.println("accountLocked is " + user.get(i).isAccountLocked());
}
public class Callback : App42Callback  
{  
	int max = 1;
	int offset = 0 ;
	userService.GetLockedUsers(max,offset,this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		IList<User> user = (IList<User>) response;     
		for(int i = 0; i < user.Count; i++) 
		{
			Console.WriteLine("userName is " + user[i].GetUserName());
			Console.WriteLine("accountLocked is " + user.IsAccountLocked());
		}      
	}  
}  
int max = 1;
int offset = 0 ;
NSArray *user = [userService getLockedUsers:max offset:offset]; 
NSLog(@"userName is %@" , [[user objectAtIndex:0] userName]);
NSLog(@"emailId is %@" ,  [[user objectAtIndex:0] emailId]);
NSString *jsonResponse =[[user objectAtIndex:0] toString]; 
Integer max = new Integer(1);
Integer offset = new Integer(0);  
Vector userList = userService.getLockedUsers(max,offset); 
for(int i=0;i < userList.size();i++)  
{ 
	User uset = (User)userList.elementAt(i);  
	System.out.println("userName is " + uset.getUserName());
	System.out.println("accountLocked is " + uset.isAccountLocked());
}           
int max = 1;
int offset = 0 ;
ArrayList<User> user = userService.getLockedUsers(max,offset);
for(int i = 0; i < user.size(); i++) 
{
	System.out.println("userName is " + user.get(i).getUserName());
	System.out.println("accountLocked is " + user.get(i).isAccountLocked());
}
int max = 1;
int offset = 0 ;
userService.GetLockedUsers(max,offset, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		IList<User> user = (IList<User>) response;     
		for(int i = 0; i < user.Count; i++) 
		{
			App42Log.Console("userName is " + user[i].GetUserName());
			App42Log.Console("accountLocked is " + user.IsAccountLocked());
		}      
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
int max = 1;
int offset = 0 ;
IList<User> user = userService.GetLockedUsers(max,offset);    
for(int i = 0; i < user.Count; i++) 
{
	Console.WriteLine("userName is " + user[i].GetUserName());
	Console.WriteLine("accountLocked is " + user.IsAccountLocked());
}      
$max = 1;
$offset = 0 ;
$user = $userService->getLockedUsers(max,offset); 
print_r("userName is " . $user[0]->getUserName());
print_r("emailId is " . $user[0]->getEmail());
$jsonResponse = $user[0]->toString(); 
Coming Soon
max = 1;
offset = 0;	
user_list = Array.new();
user_list = user_service.get_locked_users_by_paging(max, offset); 
for user in user_list do
  puts "userName is #{user.userName}";
  puts "email is #{user.email}";
  puts "firstName #{user.profile.firstName}";
end
jsonResponse = user_list.to_s(); 
var max:int = 1;
var offset:int = 0;
userService.getLockedUsersWithPaging(max,offset,new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		trace("response is : " + response);  
	}  
}  
Coming Soon

Get User By Profile Data

Gets the list of Users based on Profile Data.

Required Parameters

profileData - Profile Data key/value for which Users need to be retrieved

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
User.Profile profileData = new User().new Profile();
profileData.setFirstName("Nick");
profileData.setLastName("Gill");
ArrayList<User> user = userService.getUsersByProfileData(profileData); 
System.out.println("userName is " + user.get(0).getUserName());
System.out.println("emailId is " + user.get(0).getEmail());
String jsonResponse = user.get(0).toString();    
Coming Soon
User *userObj = [[User alloc]init];
Profile *profileData = [[Profile alloc]initWithUser:userObj];			
profileData.firstName = @"Nick";
profileData.lastName = @"Gill";
NSArray *user = [userService getUsersByProfileData:profileData]; 
NSLog(@"userName is %@" , [[user objectAtIndex:0] userName]);
NSLog(@"emailId is %@" ,  [[user objectAtIndex:0] emailId]);
NSString *jsonResponse =[[user objectAtIndex:0] toString]; 
User.Profile profileData = new User().new Profile();
profileData.setFirstName("Nick");
profileData.setLastName("Gill");
Vector user = userService.getUsersByProfileData(profileData); 
System.out.println("userName is " + ((User)user.elementAt(0)).getUserName());
System.out.println("emailId is " + ((User)user.elementAt(0)).getEmail());
String jsonResponse = ((User)user.elementAt(0)).toString();    
User.Profile profileData = new User().new Profile();
profileData.setFirstName("Nick");
profileData.setLastName("Gill");
ArrayList<User> user = userService.getUsersByProfileData(profileData); 
System.out.println("userName is " + user.get(0).getUserName());
System.out.println("emailId is " + user.get(0).getEmail());
String jsonResponse = user.get(0).toString();    
Coming Soon
Not Available
String userName = "Nick";						
String pwd = "********";
String emailId = "nick@shephertz.co.in";
User user = userService.CreateUser(userName, pwd, emailId);			
User.Profile profileData = new User.Profile(user);
profileData.SetFirstName("Nick");
profileData.SetLastName("Gill");
IList<User> user = userService.GetUsersByProfileData(profileData); 
Console.WriteLine("userName is " + user[0].GetUserName());
Console.WriteLine("emailId is " + user[0].GetEmail());
String jsonResponse = user[0].ToString();         
$userName = "Nick";						
$pwd = "********";
$emailId = "nick@shephertz.co.in";
$createUser = $userService->createUser($userName, $pwd, $emailId);					
$profileData = new Profile($createUser);
$profileData->setFirstName("Nick");
$profileData->setLastName("Gill");
$user = $userService->getUsersByProfileData(profileData); 
print_r("userName is " . $user[0]->getUserName());
print_r("emailId is " . $user[0]->getEmail());
$jsonResponse = $user[0]->toString(); 
Coming Soon
user_name = "Nick";						
pwd = "********";
emailId = "nick@shephertz.com";
profileData = App42::User::User::Profile.new();
profileData.firstName = "Nick";
profileData.lastName = "Gill";
user_list = user_service.get_user_by_profile_data(profileData); 
for user in user_list do
  puts "UserName is #{user.userName}";
  puts "EmailId is #{user.email}";
end
jsonResponse = user_list.to_s(); 
Coming Soon
Coming Soon

Reset User Password

Reset password for user based upon userName.

Required Parameters

userName - UserName which should be unique for the App

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
App42Response response = userService.resetUserPassword(userName); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
public class Callback : App42Callback  
{  
	String userName = "Nick"; 
	userService.ResetUserPassword(userName, this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		App42Response response = (App42Response) response;     
		String jsonResponse = response.ToString();  
	}  
}  
NSString *userName = @"Nick"; 
App42Response *response = [userService resetUserPassword:userName]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];                             
String userName = "Nick";
App42Response response = userService.resetUserPassword(userName); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String userName = "Nick";
App42Response response = userService.resetUserPassword(userName); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String userName = "Nick";
userService.ResetUserPassword(userName,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Log.Console("Success : " + response);
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick"; 
var result ;  
userService.resetUserPassword(userName,{  
success: function(object) 
	{  
		var userObj = JSON.parse(object);  
		result = userObj.app42.response.users.user;
		console.log("userName is " + result.userName)
	},  
	error: function(error) {
	}  
});   
String userName = "Nick";
App42Response response = userService.ResetUserPassword(userName); 
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString(); 
$userName = "Nick";
$response = $userService->resetUserPassword($userName); 
$success = $respons->isResponseSuccess();
$jsonResponse = $respons->toString(); 
Coming Soon
Coming Soon
Not Available
Coming Soon 

Reset User Password With Credential

Reset password for user based upon userName and new password which is to be reset.

Required Parameters

userName - UserName which should be unique for the App pwd - Password to be reset

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
String pwd   = "******";
App42Response response = userService.resetUserPassword(userName, pwd); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
public class Callback : App42Callback  
{  
	String userName = "Nick"; 
	String pwd   = "******";
	userService.ResetUserPassword(userName,pwd, this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		App42Response response = (App42Response) response;     
		String jsonResponse = response.ToString();  
	}  
}  
NSString *userName = @"Nick"; 
NSString *pwd = @"*******"; 
App42Response *response = [userService resetUserPassword:userName password:pwd]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];                             
String userName = "Nick";
String pwd   = "******";
App42Response response = userService.resetUserPassword(userName, pwd); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String userName = "Nick";
String pwd   = "******";
App42Response response = userService.resetUserPassword(userName, pwd); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String userName = "Nick";
String pwd   = "******";
userService.ResetUserPassword(userName, pwd,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Log.Console("Success : " + response);
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available 
String userName = "Nick";
String pwd   = "******";
App42Response response = userService.ResetUserPassword(userName, pwd); 
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString(); 
$userName = "Nick";
$pwd   = "*******";
$response = $userService->resetUserPassword($userName, $pwd); 
$success = $respons->isResponseSuccess();
$jsonResponse = $respons->toString(); 
Coming Soon
user_name = "Nick";
pwd = "******";	
response = user_service.reset_user_password(user_name,pwd); 
success = response.is_response_success();
jsonResponse = response.to_s(); 
var userName:String = "Nick";
var pwd:String = "*******";
userService.resetUserPassword(userName,pwd,new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		trace("response is : " + response);  
	}  
}  
Coming Soon 

Revoke Role

Revokes the specified role from the user.

Required Parameters

userName - UserName from whom the role has to be revoked role - Role that has to be revoked

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
String role   = "Admin";
App42Response response = userService.revokeRole(userName, role); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
public class Callback : App42Callback  
{  
	String userName = "Nick"; 
	String role   = "Admin";
	userService.RevokeRole(userName,role, this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		App42Response response = (App42Response) response;     
		String jsonResponse = response.ToString();  
	}  
}  
NSString *userName = @"Nick"; 
NSString *role = @"Admin"; 
App42Response *response = [userService revokeRole:userName role:role]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];                             
String userName = "Nick";
String role   = "Admin";
App42Response response = userService.revokeRole(userName, role); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String userName = "Nick";
String role   = "Admin";
App42Response response = userService.revokeRole(userName, role); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String userName = "Nick";
String role   = "Admin";
userService.RevokeRole(userName, role,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Log.Console("Success : " + response);
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available 
String userName = "Nick";
String role   = "Admin";
App42Response response = userService.RevokeRole(userName, role); 
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString(); 
$userName = "Nick";
$role   = "Admin";
$response = $userService->revokeRole($userName, $role); 
$success = $respons->isResponseSuccess();
$jsonResponse = $respons->toString(); 
Coming Soon
user_name = "Nick";
role = "admin";	
response = user_service.revoke_role(user_name,role); 
success = response.is_response_success();
jsonResponse = response.to_s();
var userName:String = "Nick";
var role:String  = "Admin";
userService.revokeRole(userName,role,new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		trace("response is : " + response);  
	}  
}  
Coming Soon 

Revoke All Roles

Revokes all the roles from the user.

Required Parameters

userName - UserName which should be unique for the App

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
App42Response response = userService.revokeAllRoles(userName); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
public class Callback : App42Callback  
{  
	String userName = "Nick"; 
	userService.RevokeAllRoles(userName, this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		App42Response response = (App42Response) response;     
		String jsonResponse = response.ToString();  
	}  
}  
NSString *userName = @"Nick"; 
App42Response *response = [userService revokeAllRoles:userName]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];                             
String userName = "Nick";
App42Response response = userService.revokeAllRoles(userName); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String userName = "Nick";
App42Response response = userService.revokeAllRoles(userName); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String userName = "Nick";
userService.RevokeAllRoles(userName,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Log.Console("Success : " + response);
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available 
String userName = "Nick";
App42Response response = userService.RevokeAllRoles(userName); 
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString(); 
$userName = "Nick";
$response = $userService->revokeAllRoles($userName); 
$success = $respons->isResponseSuccess();
$jsonResponse = $respons->toString(); 
Coming Soon
user_name = "Nick";
response = user_service.revoke_all_roles(user_name); 
success = response.is_response_success();
jsonResponse = response.to_s(); 
var userName:String = "Nick";
userService.revokeAllRoles(userName,new callback());  
public class callback implements App42CallBack  
{  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		trace("response is : " + response);  
	}  
}  
Coming Soon 

Update Email

Updates the User based on userName. Note: Only email can be updated. Username cannot be updated.

Required Parameters

userName - UserName which should be unique for the App emailId - Email address of the user

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
String emailId = "nick@shephertz.com";   
User user = userService.updateEmail(userName, emailId); 
System.out.println("userName is " + user.getUserName());
String jsonResponse = user.toString();    
public class Callback : App42Callback  
{  
	String userName = "Nick"; 
	String emailId = "nick@shephertz.com";
	userService.UpdateEmail(userName,emailId, this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		User user = (User) response;     
		String jsonResponse = user.ToString();  
	}  
}  
NSString *userName = @"Nick";
NSString *emailId = @"nick@shephertz.com";
User *user = [userService updateEmail:userName emailAddress:emailId]; 
NSLog(@"userName is %@" , user.userName);
NSString *jsonResponse = [user toString]; 
String userName = "Nick";
String emailId = "nick@shephertz.com";
User user = userService.updateEmail(userName, emailId); 
System.out.println("userName is " + user.getUserName());
String jsonResponse = user.toString();    
String userName = "Nick";
String emailId = "nick@shephertz.com";
User user = userService.updateEmail(userName, emailId); 
System.out.println("userName is " + user.getUserName());
String jsonResponse = user.toString();    
String userName = "Nick";
String emailId = "nick@shephertz.com";
userService.UpdateEmail(userName, emailId,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Log.Console("Success : " + response);
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
String userName = "Nick";
String emailId = "nick@shephertz.com";
User user = userService.UpdateEmail(userName, emailId); 
Console.WriteLine("userName is " + user.GetUserName());
String jsonResponse = user.ToString();         
$userName = "Nick";
$emailId = "nick@shephertz.com"'
$user = $userService->updateEmail($userName, $emailId); 
print_r("userName is " . $user->getUserName());
$jsonResponse = $user->toString(); 
Coming Soon
user_name = "Nick";	
email_id = "nick@shephertz.com";	
user = user_service.update_email(user_name, email_id); 
puts "userName is #{user.userName}";
puts "email is #{user.email}";
jsonResponse = user.to_s(); 
var userName:String = "Nick";
var emailId:String  = "nick@shephertz.com";
userService.updateEmail(userName,emailId,new callback()); 
public class callback implements App42CallBack  
{   
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		trace("response is : " + response);  
	}  
}  
Coming Soon 

Delete User

Deletes a particular user based on userName.

Required Parameters

userName - UserName which should be unique for the App

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String userName = "Nick";
App42Response response = userService.deleteUser(userName); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
public class Callback : App42Callback  
{  
	String userName = "Nick"; 
	userService.DeleteUser(userName, this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		App42Response response = (App42Response) response;     
		String jsonResponse = response.ToString();  
	}  
}  
NSString *userName = @"Nick"; 
App42Response *response = [userService deleteUser:userName]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];                             
String userName = "Nick";
App42Response response = userService.deleteUser(userName); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String userName = "Nick";
App42Response response = userService.deleteUser(userName); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String userName = "Nick";
userService.DeleteUser(userName,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Log.Console("Success : " + response);
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick"; 
var result ;  
userService.deleteUser(userName,{  
	success: function(object) 
	{  
		var userObj = JSON.parse(object);  
		result = userObj.app42.response.users.user;
		console.log("userName is " + result.userName)
	},  
	error: function(error) {  
	}  
});   
String userName = "Nick";
App42Response response = userService.DeleteUser(userName); 
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString(); 
$userName = "Nick";
$pwd   = "*******";
$response = $userService->deleteUser($userName); 
$success = $respons->isResponseSuccess();
$jsonResponse = $respons->toString(); 
Coming Soon
user_name = "Nick";
response = user_service.delete_user(user_name); 
success = response.is_response_success();
jsonResponse = response.to_s(); 
var userName:String = "Nick";
userService.deleteUser(userName,new callback()); 
public class callback implements App42CallBack  
{   
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		trace("response is : " + response);  
	}  
}  
Coming Soon 

Logout

Invalidate the session of user based on session id.

Required Parameters

sessionId - SessionId of the user which you have to logout.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
String sessionId = "<Enter_the_session_id>";
App42Response response = userService.logout(sessionId); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
public class Callback : App42Callback  
{  
	String sessionId = "<Enter_the_session_id>"; 
	userService.Logout(sessionId, this);  
	void App42Callback.OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message");  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		App42Response response = (App42Response) response;     
		String jsonResponse = response.ToString();  
	}  
}  
Coming Soon                         
String sessionId = "<Enter_the_session_id>";
App42Response response = userService.logout(sessionId); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String sessionId = "<Enter_the_session_id>";
App42Response response = userService.logout(sessionId); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String sessionId = "<Enter_the_session_id>";
userService.logout(sessionId,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Log.Console("Success : " + response);
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var sessionId = "<Enter_the_session_id>"; 
var result ;  
userService.logout(sessionId,{  
	success: function(object) 
	{  
		var userObj = JSON.parse(object);  
		result = userObj.app42.response.users.user;
		console.log("userName is " + result.userName)
	},  
	error: function(error) {  
	}  
});   
String sessionId = "<Enter_the_session_id>";
App42Response response = userService.Logout(sessionId); 
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString(); 
Coming Soon
Coming Soon
Coming Soon
var sessionId:String = "<Enter_the_session_id>";
userService.logout(sessionId,new callback()); 
public class callback implements App42CallBack  
{   
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
	public function onSuccess(response:Object):void  
	{  
		trace("response is : " + response);  
	}  
}  
Coming Soon 

Exception Handling

The functions available under User API can throw some exceptions in abnormal conditions. Example of the same has been given below. E.g. If App developer is creating a user with username which is already in database, the function will throw the App42Exception (as shown below) with message as “Bad Request” and the appErrorCode as “2001” and the details as “The request parameters are invalid. Username ‘Nick’ already exists”.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for J2ME
  • create User Api for Java
  • create User Api for Unity
  • create User Api for JS
  • create User Api for .Net
  • create User Api for PHP
  • create User Api for Marmalade
  •  create User Api for Ruby
  •  create User Api for Flash
 
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";	
try 
{  
	User user = userService.createUser(userName, pwd, emailId);  
} 
catch(App42Exception exception) 
{  
	int appErrorCode = exception.getAppErrorCode();  
	int httpErrorCode = exception.getHttpErrorCode();  
	if(appErrorCode == 2001)
	{
		// Handle here for Bad Request (The request parameters are invalid. Username 'Nick' already exists.)
	}
	else if(appErrorCode  == 2005)
	{
		// Handle here for Bad Request (The request parameters are invalid. User with emailId 'nick@shephertz.co.in' already exists.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	String jsonText = exception.getMessage();    
}                
public class Callback : App42Callback  
{  
String userName = "Nick";   
String pwd  = "*****";
String emailId = "nick@shephertz.co.in";
userService.CreateUser(userName,pwd,emailId, this);  
void App42Callback.OnException(App42Exception exception)  
{  
	int appErrorCode = exception.GetAppErrorCode();
	int httpErrorCode = exception.GetHttpErrorCode();
	if(appErrorCode == 2001)
	{
		// Handle here for Bad Request (The request parameters are invalid. Username 'Nick' already exists.)
	}
	else if(appErrorCode  == 2005)
	{
		// Handle here for Bad Request (The request parameters are invalid. User with emailId 'nick@shephertz.co.in' already exists.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	String jsonText = exception.GetMessage();  
	}  
	void App42Callback.OnSuccess(Object response)  
	{  
		User user = (User) response;
		String jsonResponse = user.ToString();  
	}  
}  
					
NSString *userName = @"Nick";
NSString *password = @"********";
NSString *emailId = @"nick@shephertz.co.in";
@try
{
	User *user = [userService createUser:userName password:password emailAddress:emailId];
} @catch(App42Exception *exception) 
{
	int appErrorCode = exception.appErrorCode;
	int httpErrorCode = exception.httpErrorCode;
	if(appErrorCode == 2001)
	{
		// Handle here for Bad Request (The request parameters are invalid. Username 'Nick' already exists.)
	}
	else if(appErrorCode  == 2005){
		// Handle here for Bad Request (The request parameters are invalid. User with emailId 'nick@shephertz.co.in' already exists.)
	}
	else if(appErrorCode == 1401){
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500){
		// handle here for Internal Server Error
	}
	NSString *jsonText = exception.reason; 	
}                        
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";	
try 
{  
User user = userService.createUser(userName, pwd, emailId);  
} 
catch(App42Exception exception) 
{  
	int appErrorCode = exception.getAppErrorCode();  
	int httpErrorCode = exception.getHttpErrorCode();  
	if(appErrorCode == 2001)
	{
		// Handle here for Bad Request (The request parameters are invalid. Username 'Nick' already exists.)
	}
	else if(appErrorCode  == 2005)
	{
		// Handle here for Bad Request (The request parameters are invalid. User with emailId 'nick@shephertz.co.in' already exists.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	String jsonText = exception.getMessage();    
}     
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";	
try 
{  
User user = userService.createUser(userName, pwd, emailId);  
} 
catch(App42Exception exception) 
{  
	int appErrorCode = exception.getAppErrorCode();  
	int httpErrorCode = exception.getHttpErrorCode();  
	if(appErrorCode == 2001)
	{
		// Handle here for Bad Request (The request parameters are invalid. Username 'Nick' already exists.)
	}
	else if(appErrorCode  == 2005)
	{
		// Handle here for Bad Request (The request parameters are invalid. User with emailId 'nick@shephertz.co.in' already exists.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	String jsonText = exception.getMessage();    
}     
Coming Soon
var userName = "Nick",
pws = "***********",
email = "nick@shephertz.co.in",
appErrorCode ;
userService.createUser(userName, pws, email,{
success: function(object) {
},
error: function(error) 
{
	var userObj = JSON.parse(error);
	appErrorCode = userObj.app42Fault.appErrorCode;
	if(appErrorCode == 2001)
	{
		// Handle here for Bad Request (The request parameters are invalid. Username 'Nick' already exists.)
	}
	else if(appErrorCode  == 2005)
	{
		// Handle here for Bad Request (The request parameters are invalid. User with emailId 'nick@shephertz.co.in' already exists.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
}
});
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";
try 
{
	User user = userService.CreateUser(userName, pwd, emailId);
}
catch(App42Exception exception) 
{
	int appErrorCode = exception.GetAppErrorCode();
	int httpErrorCode = exception.GetHttpErrorCode();
	if(appErrorCode == 2001)
	{
		// Handle here for Bad Request (The request parameters are invalid. Username 'Nick' already exists.)
	}
	else if(appErrorCode  == 2005)
	{
		// Handle here for Bad Request (The request parameters are invalid. User with emailId 'nick@shephertz.co.in' already exists.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	String jsonText = exception.GetMessage(); 	
}        
$userName = "Nick";
$pwd = "********";
$emailId = "nick@shephertz.co.in";
try
{
	$user = $userService->createUser($userName, $pwd, $emailId);
} catch(App42Exception $exception) 
{
	$appErrorCode =$exception->getAppErrorCode();
	$httpErrorCode = $exception->getHttpErrorCode();
	if($appErrorCode == 2001)
	{
		// Handle here for Bad Request (User by the name 'Nick' does not exist.)
	}
	else if($appErrorCode  == 2005){
		// Handle here for Bad Request (The request parameters are invalid. User with emailId 'nick@shephertz.co.in' already exists.)
	}
	else if($appErrorCode == 1401){
		// handle here for Client is not authorized
	}
	else if($appErrorCode == 1500){
		// handle here for Internal Server Error
	}
	$jsonText = $exception->getMessage(); 	
}
Coming Soon
user_name = "Nick";
pwd = "********";
email_id = "nick@shephertz.com";
begin
	user = user_service.create_user(user_name, pwd, email_id);
	rescue App42Exception => ex
	appErrorCode = ex.app_error_code;
	httpErrorCode = ex.http_error_code;
	if(appErrorCode == 2001)
		# Handle here for Bad Request (User by the name '<user_name>' does not exist.)
	elsif(appErrorCode  == 2005)
		# Handle here for Bad Request (The request parameters are invalid. User with emailId '<email_id>' already exists. )
	elsif(appErrorCode == 1401)
		# handle here for Client is not authorized
	else(appErrorCode == 1500)
		# handle here for Internal Server Error
	end
	jsonText = ex.getMessage(); 
end 
Coming Soon
Coming Soon

Error Codes

Functions in User API might throw exceptions with following HTTP and Application Error Codes (along with their descriptions):

1400 - BAD REQUEST - The Request parameters are invalid 1401 - UNAUTHORIZED - Client is not authorized 1500 - INTERNAL SERVER ERROR - Internal Server Error. Please try again 2000 - NOT FOUND - User by the name '@userName' does not exist. 2001 - BAD REQUEST - The request parameters are invalid. Username '@userName' already exists. 2002 - NOT FOUND - UserName/Password did not match. Authentication Failed. 2003 - BAD REQUEST - Old Password is not matching for user '@userName'. 2004 - NOT FOUND - User with the emailId '@emailId' does not exist. 2005 - BAD REQUEST - The request parameters are invalid. User with emailId '@emailId' already exists. 2006 - NOT FOUND - Users do not exist. 2007 - NOT FOUND - The number of users are less than the specified offset 2008 - NOT FOUND - The number of locked users are less than the specified offset 2009 - NOT FOUND - Users with the role '@role' do not exist. 2010 - NOT FOUND - No role found for the user '@userName'. 2011 - NOT FOUND - Role '@role' for the user '@userName' does not exist. 2012 - NOT FOUND - Roles for the user '@userName' do not exist.