User Management Service

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 the functions available in a specific API, a developer has to initialize with App42API 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 Corona
  • create User Api for Cocos2DX
  • 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
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
App42API.Initialize("API_KEY","SECRET_KEY");
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
App42API.initialize("API_KEY","SECRET_KEY");
App42API.initialize("API_KEY","SECRET_KEY");
App42API.Initialize("API_KEY","SECRET_KEY");
App42.initialize("API_KEY","SECRET_KEY");
App42API:initialize("API_KEY","SECRET_KEY")
App42API::Initialize("APP_KEY", "SECRET_KEY");
App42API.Initialize("API_KEY","SECRET_KEY");
App42API::initialize("API_KEY","SECRET_KEY"); 
UserService::Initialize("API_KEY","SECRET_KEY");
api = App42RubyAPI::ServiceAPI.new("API_KEY","SECRET_KEY")
App42API.initialize("API_KEY","SECRET_KEY");
Coming Soon

Build Service

After initialization, developer needs to call the buildXXXService method on App42API 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 Corona
  • create User Api for Cocos2DX
  • 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 = App42API.buildUserService(); 
UserService userService = App42API.BuildUserService();  
UserService *userService = [App42API buildUserService]; 
UserService userService = App42API.buildUserService(); 
UserService userService = App42API.buildUserService(); 
UserService userService = App42API.BuildUserService();
var userService  = new App42User();
local userService  = App42API:buildUserService()
UserService *userService = App42API::BuildUserService();
UserService userService = App42API.BuildUserService(); 
$userService = App42API::buildUserService(); 
UserService* userService = UserService::getInstance();
user_service = api.build_user_service
var userService:UserService = App42API.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 Corona
  • create User Api for Cocos2DX
  • 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.App42API;
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.User.Profile;
import com.shephertz.app42.paas.sdk.android.user.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.App42API;
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.User.Profile;
import com.shephertz.app42.paas.sdk.jme.user.User.UserGender;
import com.shephertz.app42.paas.sdk.jme.user.UserService;
import com.shephertz.app42.paas.sdk.java.App42API;
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.User.Profile;
import com.shephertz.app42.paas.sdk.java.user.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>
local App42API = require("App42-Lua-API.App42API")
#include "App42API.h"
using com.shephertz.app42.paas.sdk.csharp;  
using com.shephertz.app42.paas.sdk.csharp.user;  
include_once '../UserService.php'; 
include_once '../App42Response.php';  
include_once '../App42Exception.php';   
include_once '../App42BadParameterException.php';  
include_once '../App42NotFoundException.php'; 
include_once '../App42Log.php';
#include "User/UserService.h"
#include "User/App42UserResult.h"
require 'App42_Ruby_API'
import com.shephertz.app42.paas.sdk.as3.App42API;
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.Profile;
import com.shephertz.app42.paas.sdk.as3.user.UserGender;
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. Note: Username and EmailId should be unique for the App.

Required Parameters

userName - Name of the user for whom the 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 Corona
  • create User Api for Cocos2DX
  • 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";    
userService.createUser( userName, pwd, emailId, new App42CallBack() {
public void onSuccess(Object response) 
{
	User user = (User)response;
	System.out.println("userName is " + user.getUserName());
	System.out.println("emailId is " + user.getEmail());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});   
String userName = "Nick";   
String pwd  = "********";
String emailId = "nick@shephertz.co.in";
userService.CreateUser(userName,pwd,emailId, new Callback());  
public class Callback : App42Callback  
{  	
	public void OnSuccess(Object response)  
	{  
		User user = (User) response;
		Console.WriteLine("userName is " + user.GetUserName());
		Console.WriteLine("emailId is " + user.GetEmail());     
		String jsonResponse = user.ToString();  
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
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";
App42Log.SetDebug(true);		//Print output in your editor console
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) {  
	}  
}); 
local userName  = "Nick"
local pwd = "********"
local emailId = "nick@shephertz.co.in"
local App42CallBack = {}
userService:createUser(userName,pwd,emailId,App42CallBack)
function App42CallBack:onSuccess(object)
	print("userName is "..object:getUserName())
	print("emailId is "..object:getEmail())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
const char* pwd = "*******";
const char* emailId = "nick@shephertz.co.in";
userService->CreateUser(userName, pwd, emailId,this,app42callfuncND_selector(Sample_Class::onUserRequestCompleted));
void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
            printf("\n SessionId=%s",it->sessionId.c_str());
            printf("\n isAccountLocked=%d",it->isAccountLocked);
            printf("\n CreatedOn=%s",it->createdOn.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

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;
}
userName = "Nick";
pwd = "********";
emailId = "nick@shephertz.com";
user = user_service.create_user(userName, 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 onSuccess(response:Object):void  
	{  
		var user:User = User(response); 
		trace("userName is " + user.getUserName());
		trace("emailId is " + user.getEmail());
	}  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
    Coming Soon 

Create User With Role

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

Required Parameters

userName - Name of the user for whom the 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 Corona
  • create User Api for Cocos2DX
  • 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"); 
userService.createUser(userName, pwd, emailId, roleList, new App42CallBack() {
public void onSuccess(Object response) 
{
	User user = (User)response;
	System.out.println("userName is " + user.getUserName());  
	System.out.println("emailId is " + user.getEmail());  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
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 Callback());
public class Callback : App42Callback  
{   
	public void OnSuccess(Object response)  
	{  
		User user = (User) response;   
		Console.WriteLine("userName is " + user.GetUserName());
		Console.WriteLine("emailId is " + user.GetEmail());  
		String jsonResponse = user.ToString();  
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
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"); 
App42Log.SetDebug(true);		//Print output in your editor console 
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       
Not Availabe
const char* userName = "Nick";
const char* pwd = "*******";
const char* emailId = "nick@shephertz.co.in";   
vector<string>roles;
roles.push_back("s_admin");
roles.push_back("s_manager");
roles.push_back("s_techlead");
userService->CreateUser(userName, pwd, emailId, roles, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
            printf("\n SessionId=%s",it->sessionId.c_str());
            printf("\n isAccountLocked=%d",it->isAccountLocked);
            printf("\n CreatedOn=%s",it->createdOn.c_str());
            //Fetching Roles
            std::vector<string>::iterator iit;
            for(iit=it->roleList.begin(); iit!=it->roleList.end(); ++iit)
            {
                printf("\n%s",iit->c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

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
userName = "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(userName,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.createUserWithRole(userName,pwd,emailId,roleList, new callback());  
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var user:User = User (response);     
		trace("userName is " + user.getUserName());
		trace("emailId is " + user.getEmail());
	}  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
Coming Soon

Create Or Update 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.This will always update the profile with the new value passed in profile object. Call to this method should have all the values you want to retain in user profile object, otherwise old values of the profile will get updated with null. Method only updates the profile of user, Passing email/password in the user object does not have any significance for this method call.

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 Corona
  • create User Api for Cocos2DX
  • 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);  
Profile profile = user.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");
userService.createOrUpdateProfile(userObj,new App42CallBack() {
public void onSuccess(Object response) 
{
	User user = (User)response;
	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 void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String userName = "Nick";   
String pwd  = "*****";
String emailId = "nick@shephertz.co.in";
bool flag  = true;
userService.CreateUser(userName,pwd,emailId, new Callback()); 
public class Callback : 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, requestCallback);
		}
		String jsonResponse = user.ToString();  
	} 
	public void OnException(App42Exception exception)  
	{  
	Console.WriteLine("Exception Message : " + exception);  
	}  	
}  
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;
App42Log.SetDebug(true);		//Print output in your editor console
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);
	}
}
var userName  = "Nick",
result ;
userService.setFirstName("Nick");
userService.setLastName("Gill");
userService.setOfficeLandLine("+1-1800-111-999");
userService.setCountry("USA");
userService.setCity("Houston");
userService.setMobile("+958901234571");
userService.createOrUpdateProfile(userName,{
success: function(object) 
{  
	var userObj = JSON.parse(object);  
	result = userObj.app42.response.users.user;
	console.log("userName is : " + result.userName)
	var profile = result.profile;
	console.log("firstName is : " + profile.firstName);
	console.log("lastName is : " + profile.lastName);
	
},  
error: function(error) {  
	}  
});        
Coming Soon
App42User user;
user.userName = "Nick";
App42UserProfile userProfile;
userProfile.firstName = "Nick";
userProfile.lastName = "Gill";
userProfile.setSex(App42UserProfile::MALE);
userProfile.city = "Houston";
userProfile.state = "Texas";
userProfile.pincode = "74193";
userProfile.country = "USA";
userProfile.mobile = "+1-1111-111-111";
userProfile.homeLandLine = "+1-2222-222-222";
userProfile.officeLandLine = "+1-33333-333-333";
user.profile = userProfile;
userService->createOrUpdateProfile(&user, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
            printf("\n isAccountLocked=%d",it->isAccountLocked);            
            //Fetching Profile Info
            printf("\n FirstName=%s",it->profile.firstName.c_str());
            printf("\n LastName=%s",it->profile.lastName.c_str());
            printf("\n Sex=%s",it->profile.getSex().c_str());
            printf("\n Date of Birth=%s",it->profile.dateOfBirth.c_str());
            printf("\n Line1=%s",it->profile.line1.c_str());
            printf("\n Line2=%s",it->profile.line2.c_str());
            printf("\n City=%s",it->profile.city.c_str());
            printf("\n State=%s",it->profile.state.c_str());
            printf("\n Pincode=%s",it->profile.pincode.c_str());
            printf("\n Country=%s",it->profile.country.c_str());
            printf("\n Mobile=%s",it->profile.mobile.c_str());
            printf("\n HomeLandLine=%s",it->profile.homeLandLine.c_str());
            printf("\n OfficeLandLine=%s",it->profile.officeLandLine.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

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());
$profileObj = $user->getProfile();
print_r("firstName is" . $profileObj->getFirstName());
print_r("City is" . $profileObj->getCity());
print_r("Country is" . $profileObj->getCountry());
$jsonResponse = $user->toString();   
Coming Soon
userName = "Nick";
pwd = "********";
emailId = "nick@shephertz.com";
user = user_service.createUser(userName, pwd, emailId);
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.emailId}";
puts "firstName #{userObj.profile.firstName}";
jsonResponse = userObj.to_s(); 
var userName:String = "Nick";   
var pwd:String  = "*****";
var bool:Boolean = true;
var emailId:String = "nick@shephertz.co.in";
userService.createUser(userName,pwd,emailId, new callback());  
public class callback implements App42CallBack  
{
	public function onSuccess(response:Object):void  
	{  
		var user:User = User (response);  
		if(bool) 
		{
			var profile:Profile = user.getProfile();
			profile.setFirstName("Nick");
			profile.setLastName("Gill");
			profile.setSex(UserGender.MALE);
			profile.setDateOfBirth(new 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");
			userService.createOrUpdateProfile(user,new callback());
			bool = false;
		}
		else{
			var profileObject:Profile = Profile(user.getProfile());
			trace("FirstName is : " + profileObject.getFirstName());
			trace("LastName is : " + profileObject.getLastName());
			trace("Sex is : " + profileObject.getSex());
			trace("DateOfBirth is : " + profileObject.getDateOfBirth());
			trace("City is : " + profileObject.getCity());
			trace("State is : " + profileObject.getState());
			trace("Pincode is : " + profileObject.getPincode());
			trace("Country is : " + profileObject.getCountry());
			trace("MobileNo is  : " + profileObject.getMobile());
			trace("HomeLandLineNo is : " + profileObject.getHomeLandLine());
			trace("OfficeLandLineNo is : " + profileObject.getOfficeLandLine());
		}
	}   
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	} 
}  
Coming Soon

Authenticate

Authenticate user based on username and password.

Required Parameters

userName - Username that you want to authenticate. pwd - Put the password that was filled when you create 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 Corona
  • create User Api for Cocos2DX
  • 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 = "********";   
userService.authenticate(userName , pwd, new App42CallBack() {
public void onSuccess(Object response)
{
	User user = (User)response;
	System.out.println("userName is " + user.getUserName());  
	System.out.println("sessionId is " + user.getSessionId());  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message : "+ex.getMessage());
}
});
String userName = "Nick";   
String pwd  = "*****";
userService.Authenticate(userName,pwd, new Callback()); 
public class Callback : App42Callback  
{  
	public void OnSuccess(Object response)  
	{  
		User user = (User) response;     
		Console.WriteLine("userName is : " + user.GetUserName());
		Console.WriteLine("sessionId is : " + user.GetSessionId());
	} 
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  	
}  
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 = "********";
App42Log.SetDebug(true);		//Print output in your editor console
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) {
	}  
}); 
local userName  = "Nick"
local pwd = "********"
local App42CallBack = {}
userService:authenticate(userName,pwd,App42CallBack)
function App42CallBack:onSuccess(object)
	print("userName is "..object:getUserName())
	print("session id is "..object:getSessionId())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
std::string userName = "Nick";
std::string pwd = "********";
userService->Authenticate(userName, pwd, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));
void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
            printf("\n SessionId=%s",it->sessionId.c_str());
            printf("\n isAccountLocked=%d",it->isAccountLocked);
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

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;
}
userName = "Nick";
pwd = "*******";
user = user_service.authenticate(userName, pwd); 
puts "UserName 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 onSuccess(response:Object):void  
	{  
		var user:User = User(response);
		trace("userName is " + user.getUserName());
		trace("sessionId is " + user.getSessionId());
	}  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}
Coming Soon 

Change User Password

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

Required Parameters

userName - User name for whom password has to be changed. 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 Corona
  • create User Api for Cocos2DX
  • 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   = "*******";	
userService.changeUserPassword(userName, oldPwd, newPwd,new App42CallBack() {
public void onSuccess(Object response) 
{
App42Response app42response = (App42Response)response;      
System.out.println("response is " + app42response) ;  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
}); 
 
String userName = "Nick"; 
String oldPwd   = "********";
String newPwd   = "*******";	
userService.ChangeUserPassword(userName,oldPwd,newPwd, new Callback());  
public class Callback : App42Callback  
{ 
	public void OnSuccess(Object response)  
	{  
		App42Response app42response = (App42Response) response;     
		String jsonResponse = app42response.ToString();  
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
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 app42response = userService.changeUserPassword(userName, oldPwd, newPwd); 
System.out.println("response is " + app42response) ; 
boolean  success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString(); 
String userName = "Nick";
String oldPwd   = "********";
String newPwd   = "*******";	
App42Log.SetDebug(true);		//Print output in your editor console
userService.ChangeUserPassword(userName, oldPwd, newPwd,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42response = (App42Response) response;     
		String jsonResponse = app42response.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) {
	}  
}); 
local userName  = "Nick"
local oldPwd   = "********"
local newPwd   = "*******"
local App42CallBack = {}
userService:changeUserPassword(userName,oldPwd,newPwd,App42CallBack)
function App42CallBack:onSuccess(object)
	print(object:getResponseSuccess())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
const char* oldPwd = "*******";
const char* newPwd = "1234567";
userService->ChangeUserPassword(userName, oldPwd, newPwd, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

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); 
print_r("Response is :  ".$response->toString());
$success = $response->isResponseSuccess();
$jsonResponse = $response->toString();
Coming Soon
userName = "Nick";
oldPwd = "********";
newPwd = "*******";
response = user_service.change_user_password(userName, oldPwd, newPwd); 
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 onSuccess(response:Object):void
	{  
		var response:App42Response = App42Response (response);
		trace("response is : " + response);
	}  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	} 
}  
Coming Soon 

Assign Roles

Assign Roles to the existing user.

Required Parameters

userName - Name of the user to whom the roles have to be assigned. roleList - List of roles 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 Corona
  • create User Api for Cocos2DX
  • 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"); 
userService.assignRoles(userName,roleList,new App42CallBack() {
public void onSuccess(Object response) 
{
	User user = (User)response;
	System.out.println("userName is " + user.getUserName());  
	for(int i = 0; i < user.getRoleList().size();i++)  
	{  
		System.out.println("roleList is " + user.getRoleList().get(i));  
	}  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message : " + ex.getMessage());
}
});
 
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 Callback()); 
public class Callback : App42Callback  
{   
	public void 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]);
		}
	}  
	public void OnException(App42Exception exception)  
	{  
		trace("Exception Message");  
	} 
}  
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 roles = user.getRoleList();   
for(int i=0;i < roles.size(); i++)  
{ 
	User role = (User)roles.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());  
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");  
App42Log.SetDebug(true);		//Print output in your editor console
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       
Not Available
const char* userName = "Nick";  
vector<string>roles;
roles.push_back("s_Manager");
userService->AssignRoles(userName, roles, this,app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            //Fetching Roles
            std::vector<string>::iterator iit;
            for(iit=it->roleList.begin(); iit!=it->roleList.end(); ++iit)
            {
                printf("\n%s",iit->c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

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());
$userRoleList = $user->getRoleList();
foreach($userRoleList as $roles)
{
	print_r("Role is " . $roles);
}
$jsonResponse = $user->toString(); 
Coming Soon
userName = "Nick";
roleList = Array.new();
roleList.push("Admin");
roleList.push("Manager");
roleList.push("Programmer");
roleList.push("Tester");
user = userService.assign_roles(userName,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 onSuccess(response:Object):void  
	{  
		var user:User = User(response);
		trace("userName is : " + user.getUserName());
		trace("emailId is : " + user.getEmail());
		for(var i:int=0;i<user.getRoleList().length;i++)
		{
			trace("roleList is " + user.getRoleList()[i]);		
		}
	}  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	} 
}  
Coming Soon

Get User

Get user details based on username.

Required Parameters

userName - Name of the user to retrieve.

  • 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 Corona
  • create User Api for Cocos2DX
  • 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";
userService.getUser(userName, new App42CallBack() {
public void onSuccess(Object response) 
{
	User user = (User)response;
	System.out.println("userName is :" + user.getUserName());  
	System.out.println("emailId is :" + user.getEmail());  
	System.out.println("First Name :"+user.getProfile().getFirstName());
	System.out.println("Last Name :"+user.getProfile().getLastName());
	System.out.println("D.O.B is:"+user.getProfile().getDateOfBirth());
	System.out.println("Sex is:"+user.getProfile().getSex());
	System.out.println("Mobile is:"+user.getProfile().getMobile());       
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});   
String userName = "Nick";  
userService.GetUser(userName, new Callback());  
public class Callback : App42Callback  
{  
	public void OnSuccess(Object response)  
	{  
		User user = (User) response;     
		Console.WriteLine("userName is " + user.GetUserName());
		Console.WriteLine("emailId is " + user.GetEmail()); 
		Console.WriteLine("First Name :" +user.GetProfile().GetFirstName());
		Console.WriteLine("Last Name : "+ user.GetProfile().GetLastName());
		Console.WriteLine("D.O.B is : " + user.GetProfile().GetDateOfBirth());
		Console.WriteLine("Sex is : " + user.GetProfile().GetSex());
		Console.WriteLine("Mobile is : " + user.GetProfile().GetMobile());
	} 
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
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()); 
System.out.println("First Name :"+user.getProfile().getFirstName());
System.out.println("Last Name :"+user.getProfile().getLastName());
System.out.println("D.O.B is:"+user.getProfile().getDateOfBirth());
System.out.println("Sex is:"+user.getProfile().getSex());
System.out.println("Mobile is:"+user.getProfile().getMobile());
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());  
System.out.println("First Name :"+user.getProfile().getFirstName());
System.out.println("Last Name :"+user.getProfile().getLastName());
System.out.println("D.O.B is:"+user.getProfile().getDateOfBirth());
System.out.println("Sex is:"+user.getProfile().getSex());
System.out.println("Mobile is:"+user.getProfile().getMobile());       
String jsonResponse = user.toString();   
String userName = "Nick";
App42Log.SetDebug(true);		//Print output in your editor console
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()); 
		App42Log.Console("First Name :" +user.GetProfile().GetFirstName());
		App42Log.Console("Last Name : "+ user.GetProfile().GetLastName());
		App42Log.Console("D.O.B is : " + user.GetProfile().GetDateOfBirth());
		App42Log.Console("Sex is : " + user.GetProfile().GetSex());
		App42Log.Console("Mobile is : " + user.GetProfile().GetMobile());
	}
	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) {  
	}  
});     
local userName  = "Nick"
local App42CallBack = {}
userService:getUser(userName,App42CallBack)
function App42CallBack:onSuccess(object)
	print("UserName is "..object:getUserName())
	print("Email id is "..object:getEmail())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
userService->GetUser(userName, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
            //Fetching Profile Info
            printf("\n FirstName=%s",it->profile.firstName.c_str());
            printf("\n LastName=%s",it->profile.lastName.c_str());
            printf("\n Sex=%s",it->profile.getSex().c_str());
            printf("\n Date of Birth=%s",it->profile.dateOfBirth.c_str());
            printf("\n Line1=%s",it->profile.line1.c_str());
            printf("\n Line2=%s",it->profile.line2.c_str());
            printf("\n City=%s",it->profile.city.c_str());
            printf("\n State=%s",it->profile.state.c_str());
            printf("\n Pincode=%s",it->profile.pincode.c_str());
            printf("\n Country=%s",it->profile.country.c_str());
            printf("\n Mobile=%s",it->profile.mobile.c_str());
            printf("\n HomeLandLine=%s",it->profile.homeLandLine.c_str());
            printf("\n OfficeLandLine=%s",it->profile.officeLandLine.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}
String userName = "Nick";
User user = userService.GetUser(userName); 
Console.WriteLine("userName is " + user.GetUserName());
Console.WriteLine("emailId is " + user.GetEmail()); 
Console.WriteLine("First Name :" +user.GetProfile().GetFirstName());
Console.WriteLine("Last Name : "+ user.GetProfile().GetLastName());
Console.WriteLine("D.O.B is : " + user.GetProfile().GetDateOfBirth());
Console.WriteLine("Sex is : " + user.GetProfile().GetSex());
Console.WriteLine("Mobile is : " + user.GetProfile().GetMobile());
String jsonResponse = user.ToString();         
$userName = "Nick";
$user = $userService->getUser($userName); 
print_r("userName is " . $user->getUserName());
print_r("emailId is " . $user->getEmail());
$profile = $user->getProfile();
print_r("firstName is " . $profile->getFirstName());
$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;
}
userName = "Nick";	
user = user_service.get_user(userName); 
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 onSuccess(response:Object):void  
	{  
		var user:User = User (response);
		trace("userName is " + user.getUserName());
		trace("emailId is " + user.getEmail());
	}    
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
Coming Soon

Get Roles By User

Get the assigned roles based on username.

Required Parameters

userName - Name of the User for whom roles have 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 Corona
  • create User Api for Cocos2DX
  • 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";
userService.getRolesByUser(userName,new App42CallBack() {
public void onSuccess(Object response) 
{
	User user = (User)response;
	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 void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
  
String userName = "Nick";  
userService.GetRolesByUser(userName, new Callback());  
public class Callback : App42Callback  
{
	public void 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]);
		}
	}
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}    
}  
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());       
Vector roles = user.getRoleList();   
for(int i=0;i < roles.size(); i++)  
{ 
	User role = (User)roles.elementAt(i);  
	System.out.println("role is " + role);
} 
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";
App42Log.SetDebug(true);		//Print output in your editor console
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   
Not Available
const char* userName = "Nick";
userService->GetRolesByUser(userName, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
            //Fetching Profile Info
            printf("\n FirstName=%s",it->profile.firstName.c_str());
            printf("\n LastName=%s",it->profile.lastName.c_str());
            printf("\n Sex=%s",it->profile.getSex().c_str());
            printf("\n Date of Birth=%s",it->profile.dateOfBirth.c_str());
            printf("\n Line1=%s",it->profile.line1.c_str());
            printf("\n Line2=%s",it->profile.line2.c_str());
            printf("\n City=%s",it->profile.city.c_str());
            printf("\n State=%s",it->profile.state.c_str());
            printf("\n Pincode=%s",it->profile.pincode.c_str());
            printf("\n Country=%s",it->profile.country.c_str());
            printf("\n Mobile=%s",it->profile.mobile.c_str());
            printf("\n HomeLandLine=%s",it->profile.homeLandLine.c_str());
            printf("\n OfficeLandLine=%s",it->profile.officeLandLine.c_str());
            //Fetching Roles
            std::vector<string>::iterator iit;
            for(iit=it->roleList.begin(); iit!=it->roleList.end(); ++iit)
            {
                printf("\n%s",iit->c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

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());
$userRoleList = $user->getRoleList();
foreach($userRoleList as $roles)
{
	print_r("Role is " . $roles);
}
$jsonResponse = $user->toString(); 
Coming Soon
userName = "Nick";
user = user_service.get_roles_by_user(userName); 
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 onSuccess(response:Object):void  
	{  
		var user:User = User (response);
		trace("userName is " + user.getUserName());
		for(var i:int=0;i<user.getRoleList().length;i++)
		{
			trace("roleList is " + user.getRoleList()[i]);		
		}
	}  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
Coming Soon

Get Users By Role

Get all the Users based on role.

Required Parameters

role - Role for whom 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 Corona
  • create User Api for Cocos2DX
  • 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";
userService.getUsersByRole(role,new App42CallBack() {				
public void onSuccess(Object response) 
{
	ArrayList<User> user = (ArrayList<User>)response;
	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("role is " + roleList.get(j));  
		} 
		System.out.println("First Name is " + user.get(i).getProfile().getFirstName());  
		System.out.println("Last Name is " + user.get(i).getProfile().getLastName());  
	}	 
}				
public void onException(Exception ex)
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
 
String role = "Role of the User";   
userService.GetUsersByRole(role, new Callback()); 
public class Callback : App42Callback  
{   
	public void 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("role is " + roleList[j]);
			}
		}     
	} 
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
NSString *role = @"Role of the User";
NSArray *user = [userService getUsersByRole:role]; 
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 user = (User)userList.elementAt(i);  
	System.out.println("userName is " + user.getUserName());
	System.out.println("emailId is " + user.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.get(j));  
	} 
	System.out.println("First Name is " + user.get(i).getProfile().getFirstName());  
	System.out.println("Last Name is " + user.get(i).getProfile().getLastName());  
}	 
String role = "Role of the User";
App42Log.SetDebug(true);		//Print output in your editor console
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("Role is " + roleList[j]);
			}
		}     
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
Not Available
const char* role = "Role of the User";
userService->GetUsersByRole(role, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));
void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d ",userResponse->getCode());
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {
        printf("\nTotalRecords=%d",userResponse->getTotalRecords());
        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
            //Fetching Roles
            std::vector<string>::iterator iit;
            for(iit=it->roleList.begin(); iit!=it->roleList.end(); ++iit)
            {
                printf("\n%s",iit->c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

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("Role is " + roleList[j]);
	}
}     
$role = "Role of the User";
$userResponse = $userService->getUsersByRole($role); 
foreach($userResponse as $user )
{
	print_r("userName is " . $user->getUserName());
	print_r("emailId is " .  $user->getEmail());
	print_r("Account Locked is " . $user->isAccountLocked());
	$profile = $user->getProfile();
	print_r("firstName is " . $profile->getFirstName());
}
$jsonResponse = $userResponse[0]->toString(); 
Coming Soon
role = "Role of the User";
userList = userService.get_users_by_role(role); 
puts "userName is #{user.userName}";
puts "email is #{user.email}";
puts "firstName #{user.profile.firstName}";
userRoleList = user.roleList(); 
jsonResponse = user.to_s();  
var role:String = "Role of the User";   
userService.getUsersByRole(role, new callback() ); 
public class callback implements App42CallBack  
{   
	public function onSuccess(response:Object):void  
	{  
		var user:User = User (response);
		trace("userName is " + user.getUserName());
		for(var i:int=0;i<user.getRoleList().length;i++)
		{
			trace("roleList is " + user.getRoleList()[i]);		
		}
	}   
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	} 
}  
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 Corona
  • create User Api for Cocos2DX
  • 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.getAllUsers(new App42CallBack() {
public void onSuccess(Object response) 
{
	ArrayList<User> user = (ArrayList<User>)response;
	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 void onException(Exception ex)
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
  
userService.GetAllUsers(new Callback()); 
public class Callback : App42Callback  
{ 
	public void 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());
		}     
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
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 user = (User)userList.elementAt(i);  
	System.out.println("userName is " + user.getUserName());
	System.out.println("emailId is " + user.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());  
}  	
App42Log.SetDebug(true);		//Print output in your editor console
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) {  
}  
});     
local App42CallBack = {}
userService:getAllUsers(App42CallBack)
function App42CallBack:onSuccess(object)
	if table.getn(object) >1 then 
		for i=1,table.getn(object) do
			print("UserName is "..object[i]:getUserName())
			print("Email id is "..object[i]:getEmail())
		end
	else
		print("UserName is "..object:getUserName())
		print("Email id is "..object:getEmail())
	end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
userService->GetAllUsers(this,app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
            //Fetching Profile Info
            printf("\n FirstName=%s",it->profile.firstName.c_str());
            printf("\n LastName=%s",it->profile.lastName.c_str());
            printf("\n Sex=%s",it->profile.getSex().c_str());
            printf("\n Date of Birth=%s",it->profile.dateOfBirth.c_str());
            printf("\n Line1=%s",it->profile.line1.c_str());
            printf("\n Line2=%s",it->profile.line2.c_str());
            printf("\n City=%s",it->profile.city.c_str());
            printf("\n State=%s",it->profile.state.c_str());
            printf("\n Pincode=%s",it->profile.pincode.c_str());
            printf("\n Country=%s",it->profile.country.c_str());
            printf("\n Mobile=%s",it->profile.mobile.c_str());
            printf("\n HomeLandLine=%s",it->profile.homeLandLine.c_str());
            printf("\n OfficeLandLine=%s",it->profile.officeLandLine.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

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());
}             
$userResponse = $userService->getAllUsers(); 
foreach($userResponse as $user )
{
	print_r("userName is " . $user->getUserName());
	print_r("emailId is " .  $user->getEmail());
	print_r("Account Locked is " . $user->isAccountLocked());
	$profile = $user->getProfile();
	print_r("firstName is " . $profile->getFirstName());
}
$jsonResponse = $userResponse[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 onSuccess(response:Object):void  
	{  
		var array:Array = res as Array;
		for(var i:int = 0;i < array.length;i++){
			var user:User = User(array[i])
			trace("userName is : " + user.getUserName());
			trace("emailId is : " +  user.getEmail());
		}
	}   
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
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 Corona
  • create User Api for Cocos2DX
  • 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.getAllUsersCount(new App42CallBack() {
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("Total Records : " + app42response.getTotalRecords()) ;
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
}); 
 
userService.GetAllUsersCount(new Callback());  
public class Callback : App42Callback  
{ 
	public void OnSuccess(Object response)  
	{  
		App42Response app42response = (App42Response) response; 
        Console.WriteLine("Total Records : " + app42response.GetTotalRecords()) ;		
		String jsonResponse = app42response.ToString();  
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
App42Response *response = [userService getAllUsersCount]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];                             
App42Response app42response = userService.getAllUsersCount(); 
System.out.println("Total Records : " + app42response.getTotalRecords()) ;
boolean  success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString(); 
App42Response app42response = userService.getAllUsersCount(); 
System.out.println("Total Records : " + app42response.getTotalRecords()) ;
boolean  success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString(); 
App42Log.SetDebug(true);		//Print output in your editor console
userService.GetAllUsersCount(new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42response = (App42Response) response; 
		App42Log.Console("TotalRecords is : " + app42response.GetTotalRecords());
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
local App42CallBack = {}
userService:getAllUsersCount(App42CallBack)
function App42CallBack:onSuccess(object)
	print("Total record is "..object:getTotalRecords())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
userService->GetAllUsersCount(this,app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {
        printf("\nTotalRecords=%d",userResponse->getTotalRecords());
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}
App42Response app42response = userService.GetAllUsersCount(); 
Boolean  success = app42response.IsResponseSuccess(); 
Console.WriteLine("Total Records : " + app42response.GetTotalRecords()) ;	
String jsonResponse = app42response.ToString(); 
$response = $userService->getAllUsersCount(); 
print_r("Total Records is " . $response->getTotalRecords());
$success = $response->isResponseSuccess();
$jsonResponse = $response->toString();
Coming Soon
response = user_service.get_all_users_count(); 
success = response.is_response_success();  
total_records = response.totalRecords();  
jsonResponse = response.to_s(); 
userService.getAllUsersCount(new callback());  
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var app42Response:App42Response = App42Response(response); 	
		trace("TotalRecords is : " + app42Response.getTotalRecords());
	}  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
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 Corona
  • create User Api for Cocos2DX
  • 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 ;
userService.getAllUsers(max, offset,new App42CallBack() {
public void onSuccess(Object response) 
{
	ArrayList<User> user = (ArrayList<User>)response;
	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());  
		System.out.println("First Name is " + user.get(i).getProfile().getFirstName());  
		System.out.println("Last Name is " + user.get(i).getProfile().getLastName());  
	}  	
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
  
int max = 1;
int offset = 0 ;
userService.GetAllUsers(max,offset,new Callback()); 
public class Callback : App42Callback  
{  
	public void 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());
		}      
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	} 
}  
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());  
	System.out.println("First Name is " + user.get(i).getProfile().getFirstName());  
	System.out.println("Last Name is " + user.get(i).getProfile().getLastName());  
} 
int max = 1;
int offset = 0 ;
App42Log.SetDebug(true);		//Print output in your editor console
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
local max = 5
local offset= 0
local App42CallBack = {}
userService:getAllUsersByPaging(max,offset,App42CallBack)
function App42CallBack:onSuccess(object)
	if table.getn(object) > 1 then
		for i=1,table.getn(object) do
			print("UserName is "..object[i]:getUserName())
			print("Email id is "..object[i]:getEmail())
		end
	else
		print("UserName is "..object:getUserName())
		print("Email id is "..object:getEmail())
	end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
int max = 1;
int offset = 0;
userService->GetAllUsers(max,offset,this,app42callfuncND_selector(Sample_Class::onUserRequestCompleted));
void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
            //Fetching Profile Info
            printf("\n FirstName=%s",it->profile.firstName.c_str());
            printf("\n LastName=%s",it->profile.lastName.c_str());
            printf("\n Sex=%s",it->profile.getSex().c_str());
            printf("\n Date of Birth=%s",it->profile.dateOfBirth.c_str());
            printf("\n Line1=%s",it->profile.line1.c_str());
            printf("\n Line2=%s",it->profile.line2.c_str());
            printf("\n City=%s",it->profile.city.c_str());
            printf("\n State=%s",it->profile.state.c_str());
            printf("\n Pincode=%s",it->profile.pincode.c_str());
            printf("\n Country=%s",it->profile.country.c_str());
            printf("\n Mobile=%s",it->profile.mobile.c_str());
            printf("\n HomeLandLine=%s",it->profile.homeLandLine.c_str());
            printf("\n OfficeLandLine=%s",it->profile.officeLandLine.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}
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 ;
$userResponse = $userService->getAllUsers(max,offset);  
foreach($userResponse as $user )
{
	print_r("userName is " . $user->getUserName());
	print_r("emailId is " .  $user->getEmail());
	print_r("Account Locked is " . $user->isAccountLocked());
	$profile = $user->getProfile();
	print_r("firstName is " . $profile->getFirstName());
}
$jsonResponse = $userResponse[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.getAllUsersByPaging(max,offset,new callback());  
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var array:Array = res as Array;
		for(var i:int = 0;i < array.length;i++){
			var user:User = User(array[i])
			trace("userName is : " + user.getUserName());
			trace("emailId is : " +  user.getEmail());
		}
	}  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
Coming Soon

Get User By Emailid

Gets user details based on Email Id.

Required Parameters

emailId - Email Id of the user whose detail is 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 Corona
  • create User Api for Cocos2DX
  • 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";
userService.getUserByEmailId(emailId,new App42CallBack() {
public void onSuccess(Object response) 
{
	User user = (User)response;
	System.out.println("userName is " + user.getUserName());  
	System.out.println("emailId is " + user.getEmail());  
	System.out.println("First Name is " + user.getProfile().getFirstName());  
	System.out.println("Last Name is " + user.getProfile().getLastName());  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});   
 
String emailId = "nick@shephertz.co.in";  
userService.GetUserByEmailId(emailId, new Callback());  
public class Callback : App42Callback  
{
	public void OnSuccess(Object response)  
	{  
		User user = (User) response;     
		String jsonResponse = user.ToString();  
	}   
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
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()); 
System.out.println("First Name is " + user.getProfile().getFirstName());  
System.out.println("Last Name is " + user.getProfile().getLastName());  
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());  
System.out.println("First Name is " + user.getProfile().getFirstName());  
System.out.println("Last Name is " + user.getProfile().getLastName());  
String jsonResponse = user.toString();   
App42Log.SetDebug(true);		//Print output in your editor console
String emailId = "nick@shephertz.co.in";
userService.GetUserByEmailId(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 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) {  
	}  
});     
local emailId = "nick@shephertz.co.in"
local App42CallBack = {}
userService:getUserByEmailId(emailId,App42CallBack)
function App42CallBack:onSuccess(object)
	print("UserName is "..object:getUserName())
	print("Email id is "..object:getEmail())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* emailId = "nick@shephertz.co.in";
userService->GetUserByEmailId(emailId, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
            //Fetching Profile Info
            printf("\n FirstName=%s",it->profile.firstName.c_str());
            printf("\n LastName=%s",it->profile.lastName.c_str());
            printf("\n Sex=%s",it->profile.getSex().c_str());
            printf("\n Date of Birth=%s",it->profile.dateOfBirth.c_str());
            printf("\n Line1=%s",it->profile.line1.c_str());
            printf("\n Line2=%s",it->profile.line2.c_str());
            printf("\n City=%s",it->profile.city.c_str());
            printf("\n State=%s",it->profile.state.c_str());
            printf("\n Pincode=%s",it->profile.pincode.c_str());
            printf("\n Country=%s",it->profile.country.c_str());
            printf("\n Mobile=%s",it->profile.mobile.c_str());
            printf("\n HomeLandLine=%s",it->profile.homeLandLine.c_str());
            printf("\n OfficeLandLine=%s",it->profile.officeLandLine.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

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());
$profile = $user->getProfile();
print_r("firstName is " . $profile->getFirstName());
$jsonResponse = $user->toString(); 
Coming Soon
emailId = "nick@shephertz.com";	
user = user_service.get_user_by_email_id(emailId); 
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 onSuccess(response:Object):void  
	{  
		var user:User = User(response); 
		trace("userName is " + user.getUserName());
		trace("emailId is " + user.getEmail());
	}    
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	} 
}  
Coming Soon

Lock User

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

Required Parameters

userName - Username that has to be locked.

  • 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 Corona
  • create User Api for Cocos2DX
  • 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";
userService.lockUser(userName, new App42CallBack() {
public void onSuccess(Object response)
 {
	User user = (User)response;
	System.out.println("userName is " + user.getUserName());  
	System.out.println("accountLocked is " + user.isAccountLocked());  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});  
 
String userName = "Nick";  
userService.LockUser(userName, new Callback());  
public class Callback : 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(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
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";
App42Log.SetDebug(true);		//Print output in your editor console
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     
local userName = "Nick"
local App42CallBack = {}
userService:lockUser(userName,App42CallBack)
function App42CallBack:onSuccess(object)
	print("UserName is "..object:getUserName())
	print(object:getAccountLocked())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
userService->LockUser(userName,this,app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n isAccountLocked=%d",it->isAccountLocked);
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}
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());
print_r("accountLocked is " . $user->isAccountLocked());
$jsonResponse = $user->toString(); 
Coming Soon
userName = "Nick";
user = user_service.lock_user(userName); 
userName = user.userName();
jsonResponse = user.to_s(); 
var userName:String = "Nick";
userService.lockUser(userName,new callback()); 
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var user:User = User(response);
		trace("userName is " + user.getUserName());
		trace("accountLocked is " + user.isAccountLocked());
	}   
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}
}  
Coming Soon

Unlock User

Unlock the previously locked user based on the username. Apps can use this feature to unlock a user because of reasons specific to their use case e.g., If payment received and the App wants to the user to be active.

Required Parameters

userName - Username that you want to unlock.

  • 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 Corona
  • create User Api for Cocos2DX
  • 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";
userService.unlockUser(userName, new App42CallBack() {
public void onSuccess(Object response) 
{
	User user = (User)response;
	System.out.println("userName is " + user.getUserName());  
	System.out.println("accountLocked is " + user.isAccountLocked());  
}
public void onException(Exception ex)
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
 
String userName = "Nick";  
userService.UnlockUser(userName, new Callback());  
public class Callback : 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(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	} 
}  
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";
App42Log.SetDebug(true);		//Print output in your editor console
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     
local userName = "Nick"
local App42CallBack = {}
userService:unlockUser(userName,App42CallBack)
function App42CallBack:onSuccess(object)
	print("UserName is "..object:getUserName())
	print(object:getAccountLocked())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
userService->UnlockUser(userName,this,app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n isAccountLocked=%d",it->isAccountLocked);
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}
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());
print_r("Account Locked is " . $user->isAccountLocked());
$jsonResponse = $user->toString();  
Coming Soon
userName = "Nick";
user = user_service.unlock_user(userName); 
userName = user.userName();
jsonResponse = user.to_s(); 
var userName:String = "Nick";
userService.unlockUser(userName,new callback()); 
public class callback implements App42CallBack  
{   
	public function onSuccess(response:Object):void  
	{  
		var user:User = User(response);
		trace("userName is " + user.getUserName());
		trace("accountLocked is " + user.isAccountLocked());
	}  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
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 Corona
  • create User Api for Cocos2DX
  • 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.getLockedUsers(new App42CallBack() {
public void onSuccess(Object response) 
{
	ArrayList<User> user = (ArrayList<User>)response
	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());  
		System.out.println("emailId is " + user.get(i).getEmail());  
		System.out.println("First Name is " + user.get(i).getProfile().getFirstName());  
		System.out.println("Last Name is " + user.get(i).getProfile().getLastName()); 
	}  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
 
userService.GetLockedUsers(new Callback()); 
public class Callback : App42Callback  
{  
	public void 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());
		}      
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
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());  
	System.out.println("emailId is " + user.get(i).getEmail());  
	System.out.println("First Name is " + user.get(i).getProfile().getFirstName());  
	System.out.println("Last Name is " + user.get(i).getProfile().getLastName()); 
}  
App42Log.SetDebug(true);		//Print output in your editor console
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[i].IsAccountLocked());
		}      
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
local App42CallBack = {}
userService:getLockedUsers(App42CallBack)
function App42CallBack:onSuccess(object)
	for i=1,table.getn(object) do
		print("UserName is "..object[i]:getUserName())
		print(object[i]:getAccountLocked())
	end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
userService->GetLockedUsers(this,app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
            printf("\n isAccountLocked=%d",it->isAccountLocked);
            //Fetching Profile Info
            printf("\n FirstName=%s",it->profile.firstName.c_str());
            printf("\n LastName=%s",it->profile.lastName.c_str());
            printf("\n Sex=%s",it->profile.getSex().c_str());
            printf("\n Date of Birth=%s",it->profile.dateOfBirth.c_str());
            printf("\n Line1=%s",it->profile.line1.c_str());
            printf("\n Line2=%s",it->profile.line2.c_str());
            printf("\n City=%s",it->profile.city.c_str());
            printf("\n State=%s",it->profile.state.c_str());
            printf("\n Pincode=%s",it->profile.pincode.c_str());
            printf("\n Country=%s",it->profile.country.c_str());
            printf("\n Mobile=%s",it->profile.mobile.c_str());
            printf("\n HomeLandLine=%s",it->profile.homeLandLine.c_str());
            printf("\n OfficeLandLine=%s",it->profile.officeLandLine.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}


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[i].IsAccountLocked());
}      
$userResponse = $userService->getLockedUsers(); 
foreach($userResponse as $user )
{
	print_r("userName is " . $user->getUserName());
	print_r("emailId is " .  $user->getEmail());
	print_r("Account Locked is " . $user->isAccountLocked());
	$profile = $user->getProfile();
	print_r("firstName is " . $profile->getFirstName());
}
$jsonResponse = $userResponse[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.getLockedUsers(new callback());  
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var array:Array = res as Array;
		for(var i:int = 0;i < array.length;i++){
			var user:User = User(array[i])
			trace("userName is : " + user.getUserName());
			trace("emailId is : " +  user.getEmail());
		}
	}  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
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 Corona
  • create User Api for Cocos2DX
  • 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.getLockedUsersCount(new App42CallBack() {
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("Total Records : " + app42response.getTotalRecords());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
}); 
 
userService.GetLockedUsersCount(new Callback()); 
public class Callback : App42Callback  
{ 
	public void OnSuccess(Object response)  
	{  
		App42Response app42response = (App42Response) response;     
		Console.WriteLine("Total Records : " + app42response.GetTotalRecords());     
		String jsonResponse = app42response.ToString();  
	}   
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
App42Response *response = [userService getLockedUsersCount]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];                             
App42Response response = userService.getLockedUsersCount();
System.out.println("Total Records : " + response.getTotalRecords()); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
App42Response app42response = userService.getLockedUsersCount(); 
System.out.println("Total Records : " + app42response.getTotalRecords());
boolean  success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString(); 
App42Log.SetDebug(true);		//Print output in your editor console
userService.GetLockedUsersCount(new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42response = (App42Response) response;     
		App42Log.Console("TotalRecords is : " + app42response.GetTotalRecords());  
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
local App42CallBack = {}
userService:getLockedUsersCount(App42CallBack)
function App42CallBack:onSuccess(object)
	print("Total Record is "..object:getTotalRecords())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
userService->GetLockedUsersCount(this,app42callfuncND_selector(Sample_Class::onUserRequestCompleted));
void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {
        printf("\nTotalRecords=%d",userResponse->getTotalRecords());
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}


App42Response response = userService.GetLockedUsersCount();   
Console.WriteLine("Total Records : " + response.GetTotalRecords());      
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString(); 
$response = $userService->getLockedUsersCount(); 
print_r("Total Records is " . $response->getTotalRecords());
$success = $response->isResponseSuccess();
$jsonResponse = $response->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 onSuccess(response:Object):void  
	{  
		var app42Response:App42Response = App42Response(response);
		trace("Totalrecords is : " + app42Response.getTotalRecords());
	}  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
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 Corona
  • create User Api for Cocos2DX
  • 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 ;
userService.getLockedUsers(max,offset,new App42CallBack() {		
public void onSuccess(Object response) 
{
	ArrayList<User> user = (ArrayList<User>)response;
	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 void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
 
int max = 1;
int offset = 0 ;
userService.GetLockedUsers(max,offset,new Callback());  
public class Callback : App42Callback  
{ 
	public void 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[i].IsAccountLocked());
		}      
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
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 user = (User)userList.elementAt(i);  
	System.out.println("userName is " + user.getUserName());
	System.out.println("accountLocked is " + user.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 ;
App42Log.SetDebug(true);		//Print output in your editor console
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[i].IsAccountLocked());
		}      
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available
local max = 5
local offset = 0
local App42CallBack = {}
userService:getLockedUsersWithPaging(max,offset,App42CallBack)
function App42CallBack:onSuccess(object)
	for i=1,table.getn(object) do
		print("UserName is "..object[i]:getUserName())
		print(object[i]:getAccountLocked())
	end
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
int max = 1;
int offset = 0;
userService->GetLockedUsers(max,offset,this,app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
            printf("\n isAccountLocked=%d",it->isAccountLocked);
            //Fetching Profile Info
            printf("\n FirstName=%s",it->profile.firstName.c_str());
            printf("\n LastName=%s",it->profile.lastName.c_str());
            printf("\n Sex=%s",it->profile.getSex().c_str());
            printf("\n Date of Birth=%s",it->profile.dateOfBirth.c_str());
            printf("\n Line1=%s",it->profile.line1.c_str());
            printf("\n Line2=%s",it->profile.line2.c_str());
            printf("\n City=%s",it->profile.city.c_str());
            printf("\n State=%s",it->profile.state.c_str());
            printf("\n Pincode=%s",it->profile.pincode.c_str());
            printf("\n Country=%s",it->profile.country.c_str());
            printf("\n Mobile=%s",it->profile.mobile.c_str());
            printf("\n HomeLandLine=%s",it->profile.homeLandLine.c_str());
            printf("\n OfficeLandLine=%s",it->profile.officeLandLine.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}
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[i].IsAccountLocked());
}      
$max = 1;
$offset = 0 ;
$userResponse = $userService->getLockedUsers(max,offset);    
foreach($userResponse as $user )
{
	print_r("userName is " . $user->getUserName());
	print_r("emailId is " .  $user->getEmail());
	print_r("Account Locked is " . $user->isAccountLocked());
	$profile = $user->getProfile();
	print_r("firstName is " . $profile->getFirstName());
}
$jsonResponse = $userResponse[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 onSuccess(response:Object):void  
	{  
		var array:Array = res as Array;
		for(var i:int = 0;i < array.length;i++){
			var user:User = User(array[i])
			trace("userName is : " + user.getUserName());
			trace("emailId is : " +  user.getEmail());
		}
	}  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
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 Corona
  • create User Api for Cocos2DX
  • 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");
userService.getUsersByProfileData(profileData,new App42CallBack() {
public void onSuccess(Object response) 
{
	ArrayList<User> user = (ArrayList<User>)response;
	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());  
		System.out.println("First Name is " + user.get(i).getProfile().getFirstName());  
		System.out.println("Last Name is " + user.get(i).getProfile().getLastName()); 
	}
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});   
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); 
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());  
	System.out.println("First Name is " + user.get(i).getProfile().getFirstName());  
	System.out.println("Last Name is " + user.get(i).getProfile().getLastName()); 
}
String jsonResponse = user.get(0).toString();    
Coming Soon
Not Available
Not Available
App42UserProfile userProfile;
userProfile.firstName = "Nick";
userProfile.lastName = "Gill";
userService->GetUsersByProfileData(&userProfile, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));
void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
            printf("\n isAccountLocked=%d",it->isAccountLocked);
            //Fetching Profile Info
            printf("\n FirstName=%s",it->profile.firstName.c_str());
            printf("\n LastName=%s",it->profile.lastName.c_str());
            printf("\n Sex=%s",it->profile.getSex().c_str());
            printf("\n Date of Birth=%s",it->profile.dateOfBirth.c_str());
            printf("\n Line1=%s",it->profile.line1.c_str());
            printf("\n Line2=%s",it->profile.line2.c_str());
            printf("\n City=%s",it->profile.city.c_str());
            printf("\n State=%s",it->profile.state.c_str());
            printf("\n Pincode=%s",it->profile.pincode.c_str());
            printf("\n Country=%s",it->profile.country.c_str());
            printf("\n Mobile=%s",it->profile.mobile.c_str());
            printf("\n HomeLandLine=%s",it->profile.homeLandLine.c_str());
            printf("\n OfficeLandLine=%s",it->profile.officeLandLine.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

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");
$userService->createOrUpdateProfile($createUser);
$userResonse = $userService->getUsersByProfileData($profileData); 
foreach($userResonse as $user )
{
	print_r("userName is " . $user->getUserName());
	print_r("emailId is " .  $user->getEmail());
	print_r("Account Locked is " . $user->isAccountLocked());
	$profile = $user->getProfile();
	print_r("firstName is " . $profile->getFirstName());
}
$jsonResponse = $userResonse[0]->toString(); 
Coming Soon
userName = "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 User password and send mail with password inside.

Required Parameters

userName - Username for whom password has 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 Corona
  • create User Api for Cocos2DX
  • 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";
userService.resetUserPassword(userName,new App42CallBack() {
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("response is " + app42response) ;  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
 
String userName = "Nick"; 
userService.ResetUserPassword(userName, new Callback());
public class Callback : App42Callback  
{ 	
	public void OnSuccess(Object response)  
	{  
		App42Response app42response = (App42Response) response;     
		String jsonResponse = app42response.ToString();  
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
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 app42response = userService.resetUserPassword(userName); 
System.out.println("response is " + app42response) ;  
boolean  success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString(); 
String userName = "Nick";
App42Log.SetDebug(true);		//Print output in your editor console
userService.ResetUserPassword(userName,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		var app42Response:App42Response = App42Response(response);
		App42Log.Console("app42Response is : " + app42Response);
	}
	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) {
	}  
});   
local userName  = "Nick"
local App42CallBack = {}
userService:resetUserPassword(userName,App42CallBack)
function App42CallBack:onSuccess(object)
	print(object:getResponseSuccess())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
user->ResetUserPassword(userName, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

String userName = "Nick";
App42Response response = userService.ResetUserPassword(userName); 
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString(); 
$userName = "Nick";
$response = $userService->resetUserPassword($userName); 
print_r("Response is : ".$response->toString());
$success = $response->isResponseSuccess();
$jsonResponse = $response->toString(); 
Coming Soon
Coming Soon
var userName:String = "Nick";
userService.resetAppUserPassword(userName,new callback());  
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var app42Response:App42Response = App42Response(response); 
		trace("response is : "+ app42Response); 
	} 
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}   
} 
Coming Soon 

Revoke Role

Revoke 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 Corona
  • create User Api for Cocos2DX
  • 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";
userService.revokeRole(userName, role,new App42CallBack() {	
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("response is " + app42response) ;  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
 
String userName = "Nick"; 
String role   = "Admin";
userService.RevokeRole(userName,role, new Callback()); 
public class Callback : App42Callback  
{  
	public void OnSuccess(Object response)  
	{  
		App42Response app42response = (App42Response) response;     
		String jsonResponse = app42response.ToString();  
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
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 app42response = userService.revokeRole(userName, role); 
System.out.println("response is " + app42response) ;  
boolean  success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString(); 
String userName = "Nick";
String role   = "Admin";
App42Log.SetDebug(true);		//Print output in your editor console
userService.RevokeRole(userName, role,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42response = (App42Response) response;     
		String jsonResponse = app42response.ToString();  
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available 
Not Available 
const char* userName = "Nick";
const char* role = "Admin";
userService->RevokeRole(userName, role, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));
void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d ",userResponse->getCode());
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {
        printf("\nTotalRecords=%d",userResponse->getTotalRecords());
        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            //Fetching Roles
            std::vector<string>::iterator iit;
            for(iit=it->roleList.begin(); iit!=it->roleList.end(); ++iit)
            {
                printf("\n%s",iit->c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

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); 
print_r("Response is :  ".$response->toString());
$success = $response->isResponseSuccess();
$jsonResponse = $response->toString(); 
Coming Soon
userName = "Nick";
role = "admin";	
response = user_service.revoke_role(userName,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 onSuccess(response:Object):void  
	{  
		var app42Response:App42Response = App42Response(response); 
		trace("response is : "+ app42Response); 
	}   
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
Coming Soon 

Revoke All Roles

Revokes all the roles from the user.

Required Parameters

userName - Name of the user from whom Roles have 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 Corona
  • create User Api for Cocos2DX
  • 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";
userService.revokeAllRoles(userName, new App42CallBack() {				
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("response is " + app42response) ;  
}
public void onException(Exception ex)
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
 
String userName = "Nick"; 
userService.RevokeAllRoles(userName, new Callback());  
public class Callback : App42Callback  
{ 
	public void OnSuccess(Object response)  
	{  
		App42Response app42response = (App42Response) response;     
		String jsonResponse = app42response.ToString();  
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
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 app42response = userService.revokeAllRoles(userName); 
System.out.println("response is " + app42response) ; 
boolean  success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString(); 
String userName = "Nick";
App42Log.SetDebug(true);		//Print output in your editor console
userService.RevokeAllRoles(userName,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42response = (App42Response) response;     
		String jsonResponse = app42response.ToString(); 
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Not Available 
Not Available 
const char* userName = "Nick";
userService->RevokeAllRoles(userName, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));
void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d ",userResponse->getCode());
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {
        printf("\nTotalRecords=%d",userResponse->getTotalRecords());
        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            //Fetching Roles
            std::vector<string>::iterator iit;
            for(iit=it->roleList.begin(); iit!=it->roleList.end(); ++iit)
            {
                printf("\n%s",iit->c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

String userName = "Nick";
App42Response response = userService.RevokeAllRoles(userName); 
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString(); 
$userName = "Nick";
$response = $userService->revokeAllRoles($userName); 
print_r("Response is :  ".$response->toString());
$success = $response->isResponseSuccess();
$jsonResponse = $response->toString(); 
Coming Soon
userName = "Nick";
response = user_service.revoke_all_roles(userName); 
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 onSuccess(response:Object):void  
	{  
		var app42Response:App42Response = App42Response(response); 
		trace("response is : "+ app42Response); 
	}  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
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 email id has to updated. emailId - New email id 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 Corona
  • create User Api for Cocos2DX
  • 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";   
userService.updateEmail(userName, emailId,new App42CallBack() {
public void onSuccess(Object response) 
{
	User user = (User)response;
	System.out.println("userName is " + user.getUserName());  
	System.out.println("Emailid is:"+user.getEmail());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});   
String userName = "Nick"; 
String emailId = "nick@shephertz.com";
userService.UpdateEmail(userName,emailId, new Callback());  
public class Callback : App42Callback  
{  
	public void OnSuccess(Object response)  
	{  
		User user = (User) response;     
		Console.WriteLine("userName is " + user.GetUserName());
		Console.WriteLine("emailId is " + user.GetEmail());
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
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());  
System.out.println("Emailid is:"+user.getEmail());
String jsonResponse = user.toString();    
String userName = "Nick";
String emailId = "nick@shephertz.com";
App42Log.SetDebug(true);		//Print output in your editor console
userService.UpdateEmail(userName, 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);
	}
}
Not Available
local userName  = "Nick"
local emailId = "nick@shephertz.com"
local App42CallBack = {}
userService:updateEmail(userName, emailId,App42CallBack)
function App42CallBack:onSuccess(object)
	print("UserName is "..object:getUserName())
	print("Email id is "..object:getEmail())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
const char* emailId = "nick@shephertz.com";
userService->UpdateEmail(userName,emailId, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

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());
print_r("Email Id is :" . $user->getEmail());
$jsonResponse = $user->toString(); 
Coming Soon
userName = "Nick";	
email_id = "nick@shephertz.com";	
user = user_service.update_email(userName, 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 onSuccess(response:Object):void  
	{  
		var user:User = User(response);     
		trace("userName is " + user.getUserName());
		trace("emailId is " + user.getEmail()); 
	}   
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);
	}  
}  
Coming Soon 

Delete User

Delete a particular user based on username. Note: From this method, you can only soft delete the user. If you want to delete the user permanently, that can be done in two ways 1. Delete from appHQ console management. 2. Set the “deletePermanent” flag true in otherMetaHeaders. See <Delete User Permanent> .

Required Parameters

userName - Username that you want to delete.

  • 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 Corona
  • create User Api for Cocos2DX
  • 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";
userService.deleteUser(userName,new App42CallBack() {		
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("response is " + app42response) ;  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message " + ex.getMessage());
}
}); 
 
String userName = "Nick"; 
userService.DeleteUser(userName, new Callback());  
public class Callback : App42Callback  
{ 
	public void OnSuccess(Object response)  
	{  
		App42Response app42response = (App42Response) response;     
		String jsonResponse = app42response.ToString();  
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
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 app42response = userService.deleteUser(userName);
System.out.println("response is " + app42response) ;   
boolean  success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString(); 
String userName = "Nick";
App42Log.SetDebug(true);		//Print output in your editor console
userService.DeleteUser(userName,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42response = (App42Response) response;    
		App42Log.Console("response is " + app42response) 
	}
	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) {  
	}  
});   
local userName  = "Nick"
local App42CallBack = {}
userService:deleteUser(userName,App42CallBack)
function App42CallBack:onSuccess(object)
	print(object:getResponseSuccess())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
userService->DeleteUser(userName, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

String userName = "Nick";
App42Response response = userService.DeleteUser(userName); 
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString(); 
$userName = "Nick";
$response = $userService->deleteUser($userName); 
print_r("Response is :  ".$response->toString());
$success = $response->isResponseSuccess();
$jsonResponse = $response->toString(); 
Coming Soon
userName = "Nick";
response = user_service.delete_user(userName); 
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 onSuccess(response:Object):void  
	{  
		var app42response :App42Response= App42Response(response);    
		trace("response is " + app42response) 
	}   
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
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 Corona
  • create User Api for Cocos2DX
  • 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>";
userService.logout(sessionId,new App42CallBack() {
public void onSuccess(Object response)
{
	App42Response app42response = (App42Response)response;      
	System.out.println("response is " + app42response) ;  
}
public void onException(Exception ex)
{
	System.out.println("Exception Message " + ex.getMessage());
}
});
 
String sessionId = "<Enter_the_session_id>"; 
userService.Logout(sessionId, new Callback());  
public class Callback : App42Callback  
{	
	public void OnSuccess(Object response)  
	{  
		App42Response app42response = (App42Response) response;     
		String jsonResponse = app42response.ToString();  
	}   
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  

}  
NSString *sessionId = @"<Enter_the_session_id>";
App42Response *response = [userServiceObject logout:sessionId];
BOOL success = response.isResponseSuccess;
NSString *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>";
App42Response app42response = userService.logout(sessionId); 
System.out.println("response is " + app42response) ; 
boolean  success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString(); 
String sessionId = "<Enter_the_session_id>";
App42Log.SetDebug(true);		//Print output in your editor console
userService.logout(sessionId,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42response = (App42Response) response;     
		String jsonResponse = app42response.ToString();  
	}
	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) {  
	}  
});   
local sessionId = "<Enter_the_session_id>"
local App42CallBack = {}
userService:logout(sessionId,App42CallBack)
function App42CallBack:onSuccess(object)
	print(object:getResponseSuccess())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* sessionId = "78724aea-3c8d-43a0-98d9-84df215ba510";
userService->Logout(sessionId, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));
void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    { }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

String sessionId = "<Enter_the_session_id>";
App42Response response = userService.Logout(sessionId); 
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString(); 
$sessionId = "<Enter_the_session_id>";
$response = $userService->logout($sessionId); 
print_r("Response is :  ".$response->toString());
$success = $response->isResponseSuccess();
$jsonResponse = $response->toString();
Coming Soon
Coming Soon
var sessionId:String = "<Enter_the_session_id>";
userService.logout(sessionId,new callback()); 
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var app42response :App42Response= App42Response(response);    
		trace("response is " + app42response) 
	}   
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
Coming Soon 

Delete User Permanent

Delete a particular user based on username. Note: This will delete your user permanently.

Required Parameters

userName - Username that you want to delete.

  • 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 Corona
  • create User Api for Cocos2DX
  • 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";
HashMap<String, String> otherMetaHeaders = new HashMap<String, String>();
otherMetaHeaders.put("deletePermanent", "true");
userService.setOtherMetaHeaders(otherMetaHeaders);
userService.deleteUser(userName,new App42CallBack() {		
public void onSuccess(Object response) 
{
	App42Response app42response = (App42Response)response;      
	System.out.println("response is " + app42response) ;  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message " + ex.getMessage());
}
}); 
 
String userName = "Nick"; 
Dictionary<String, String> otherMetaHeaders = new Dictionary<String, String>();
otherMetaHeaders.Add("deletePermanent", "true");
userService.SetOtherMetaHeaders(otherMetaHeaders);
userService.DeleteUser(userName, new Callback());  
public class Callback : App42Callback  
{ 
	public void OnSuccess(Object response)  
	{  
		App42Response app42response = (App42Response) response;     
		String jsonResponse = app42response.ToString();  
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
} 
NSString *userName = @"Nick"; 
NSMutableDictionary *otherMetaHeaders = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"true",@"deletePermanent", nil];
[userService setOtherMetaHeaders:otherMetaHeaders];
App42Response *response = [userService deleteUser:userName]; 
NSString *success = response.isResponseSuccess;
NSString *jsonResponse = [response toString];                                
String userName = "Nick";
HashMap<String, String> otherMetaHeaders = new HashMap<String, String>();
otherMetaHeaders.put("deletePermanent", "true");
userService.setOtherMetaHeaders(otherMetaHeaders);
App42Response response = userService.deleteUser(userName); 
boolean  success = response.isResponseSuccess();
String jsonResponse = response.toString(); 
String userName = "Nick";
HashMap<String, String> otherMetaHeaders = new HashMap<String, String>();
otherMetaHeaders.put("deletePermanent", "true");
userService.setOtherMetaHeaders(otherMetaHeaders);
App42Response app42response = userService.deleteUser(userName);
System.out.println("response is " + app42response) ;   
boolean  success = app42response.isResponseSuccess();
String jsonResponse = app42response.toString(); 
String userName = "Nick";
App42Log.SetDebug(true);		//Print output in your editor console
Dictionary<String, String> otherMetaHeaders = new Dictionary<String, String>();
otherMetaHeaders.Add("deletePermanent", "true");
userService.SetOtherMetaHeaders(otherMetaHeaders);
userService.DeleteUser(userName,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42response = (App42Response) response;    
		App42Log.Console("response is " + app42response) 
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick"; 
var result ;  
var otherMetaHeaders = {deletePermanent:true};                               
userService.setOtherMetaHeaders(otherMetaHeaders);
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) {  
	}  
});   
local userName  = "Nick"
local App42CallBack = {}
local otherMetaHeaders = {};
otherMetaHeaders.deletePermanent= "true";
userService:setOtherMetaHeaders(otherMetaHeaders);
userService:deleteUser(userName,App42CallBack)
function App42CallBack:onSuccess(object)
	print(object:getResponseSuccess())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
map<string,string>otherMetaHeaders;
otherMetaHeaders["deletePermanent"] = "true";
userService->setOtherMetaHeaders(otherMetaHeaders);
userService->DeleteUser(userName, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));
void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

String userName = "Nick";
Dictionary<String, String> otherMetaHeaders = new Dictionary<String, String>();
otherMetaHeaders.Add("deletePermanent", "true");
userService.SetOtherMetaHeaders(otherMetaHeaders);
App42Response response = userService.DeleteUser(userName); 
Boolean  success = response.IsResponseSuccess();
String jsonResponse = response.ToString();
$userName = "Nick";
$pwd   = "*******";
$otherMetaHeaders = array();
$otherMetaHeaders['deletePermanent'] ="true";
$userService->setOtherMetaHeaders($otherMetaHeaders);
$response = $userService->deleteUser($userName); 
print_r("Response is :  ".$response->toString());
$success = $response->isResponseSuccess();
$jsonResponse = $response->toString(); 
Coming Soon
Coming Soon
var userName:String = "Nick";
var otherMetaHeaders:Dictionary = new Dictionary();
otherMetaHeaders["deletePermanent"] = "true";
userService.setOtherMetaHeaders(otherMetaHeaders);
userService.deleteUser(userName,new callback()); 
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var app42response :App42Response= App42Response(response);    
		trace("response is " + app42response) 
	}   
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
Coming Soon 

Authenticate With Email

Authenticate user based on EmailId and password.

Required Parameters

emailId - EmailId of the user. pwd - Put the password that was filled when you create 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 Corona
  • create User Api for Cocos2DX
  • 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";   
String pwd = "********";  
HashMap<String, String> otherMetaHeaders = new HashMap<String, String>();
otherMetaHeaders.put("emailAuth", "true");
userService.setOtherMetaHeaders(otherMetaHeaders); 
userService.authenticate(emailId , pwd, new App42CallBack() {
public void onSuccess(Object response)
{
	User user = (User)response;
	System.out.println("userName is " + user.getUserName());  
	System.out.println("sessionId is " + user.getSessionId());  
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message : "+ex.getMessage());
}
});
String emailId = "nick@shephertz.co.in";   
String pwd  = "*****";
Dictionary<String, String> otherMetaHeaders = new Dictionary<String, String>();
otherMetaHeaders.Add("emailAuth", "true");
userService.SetOtherMetaHeaders(otherMetaHeaders);
userService.Authenticate(emailId,pwd, new Callback()); 
public class Callback : App42Callback  
{  
	public void OnSuccess(Object response)  
	{  
		User user = (User) response;     
		Console.WriteLine("userName is : " + user.GetUserName());
		Console.WriteLine("sessionId is : " + user.GetSessionId());
	} 
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  	
}  
NSString *userName = @"Nick";
NSString *pwd = @"********";
NSMutableDictionary *otherMetaHeaders = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"true",@"emailAuth", nil];
[userService setOtherMetaHeaders:otherMetaHeaders];
User *user = [userService authenticate:userName password:pwd]; 
NSLog(@"userName is %@" , user.userName);
NSLog(@"sessionId is %@" ,  user.sessionId);
String emailId = "nick@shephertz.co.in"; 
String pwd = "********";   
HashMap<String, String> otherMetaHeaders = new HashMap<String, String>();
otherMetaHeaders.put("emailAuth", "true");
userService.setOtherMetaHeaders(otherMetaHeaders); 
User user = userService.authenticate(emailId, pwd); 
System.out.println("userName is " + user.getUserName());
System.out.println("sessionId is " + user.getSessionId());
String emailId = "nick@shephertz.co.in"; 
String pwd = "********";   
HashMap<String, String> otherMetaHeaders = new HashMap<String, String>();
otherMetaHeaders.put("emailAuth", "true");
userService.setOtherMetaHeaders(otherMetaHeaders); 
User user = userService.authenticate(emailId, pwd); 
System.out.println("userName is " + user.getUserName());  
System.out.println("sessionId is " + user.getSessionId());  
String emailId = "nick@shephertz.co.in"; 
String pwd = "********";
App42Log.SetDebug(true);		//Print output in your editor console
Dictionary<String, String> otherMetaHeaders = new Dictionary<String, String>();
otherMetaHeaders.Add("emailAuth", "true");
userService.SetOtherMetaHeaders(otherMetaHeaders);
userService.Authenticate(emailId, 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 emailId = "nick@shephertz.co.in"; 
var pwd = "*********";  
var result ;  
var otherMetaHeaders = {emailAuth:true};                               
userService.setOtherMetaHeaders(otherMetaHeaders); 
userService.authenticate(emailId, 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) {
	}  
}); 
local emailId = "nick@shephertz.co.in"; 
local pwd = "********"
local App42CallBack = {}
local otherMetaHeaders = {};
otherMetaHeaders.emailAuth= "true";
userService:setOtherMetaHeaders(otherMetaHeaders);
userService:authenticate(emailId,pwd,App42CallBack)
function App42CallBack:onSuccess(object)
	print("userName is "..object:getUserName())
	print("session id is "..object:getSessionId())
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* pwd = "*******";
const char* emailId = "nick@shephertz.com";  
map<string,string>otherMetaHeaders;
otherMetaHeaders["emailAuth"] = "true";
userService->setOtherMetaHeaders(otherMetaHeaders);  
userService->Authenticate(emailId, pwd, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));

void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
            printf("\n SessionId=%s",it->sessionId.c_str());
            printf("\n isAccountLocked=%d",it->isAccountLocked);
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

String emailId = "nick@shephertz.co.in"; 
String pwd = "********";
Dictionary<String, String> otherMetaHeaders = new Dictionary<String, String>();
otherMetaHeaders.Add("emailAuth", "true");
userService.SetOtherMetaHeaders(otherMetaHeaders);
User user = userService.Authenticate(emailId, pwd); 
Console.WriteLine("userName is " + user.GetUserName());
Console.WriteLine("sessionId is " + user.GetSessionId());
String jsonResponse = user.ToString();         
$emailId = "nick@shephertz.co.in"; 
$pwd = "********";
$otherMetaHeaders = array();
$otherMetaHeaders['emailAuth'] ="true";
$userService->setOtherMetaHeaders($otherMetaHeaders);
$user = $userService->authenticate($emailId, $pwd); 
print_r("userName is " . $user->getUserName());
print_r("sessionId is " . $user->getSessionId());
$jsonResponse = $user->toString(); 
Coming Soon
Coming Soon
var emailId:String = "nick@shephertz.co.in";   
var pwd:String  = "*****";
var otherMetaHeaders:Dictionary = new Dictionary();
otherMetaHeaders["emailAuth"] = "true";
userService.setOtherMetaHeaders(otherMetaHeaders);
userService.authenticate(emailId,pwd, new callback());  
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var user:User = User(response);
		trace("userName is " + user.getUserName());
		trace("sessionId is " + user.getSessionId());
	}  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}
Coming Soon 

Saving additional Data along with User

Save additional data of user along with while creating a new user. One can fetch these saved information back by getting user. See <Fetch Additional data of User> .

Required Parameters

collectionName - Name of collection under which JSON doc needs to be saved. jsonDoc - Target JSON document to be saved.

  • 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 Corona
  • create User Api for Cocos2DX
  • 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";
String dbName = "<Your_DataBase_Name>"; 
String collectionName = "<Your_Collection_Name>"; 
JSONObject jsonDoc = new JSONObject();
jsonDoc.put("name","John");
jsonDoc.put("age",20); 
App42API.setDbName(dbName);  
userService.addJSONObject( collectionName, jsonDoc);
userService.createUser( userName, pwd, emailId, new App42CallBack() {
public void onSuccess(Object response) 
{
	User user = (User)response;
	System.out.println("userName is " + user.getUserName());
	System.out.println("emailId is " + user.getEmail());
	for(int i=0;i<user.getJsonDocList().size();i++)
	{
		System.out.println("updated at = "+ user.getJsonDocList().get(i).getUpdatedAt());
		System.out.println("created at = "+ user.getJsonDocList().get(i).getCreatedAt());
		System.out.println("doc id is = "+ user.getJsonDocList().get(i).getDocId());
		System.out.println("json doc  is = "+ user.getJsonDocList().get(i).getJsonDoc());	
	}
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});   
String userName = "Nick";   
String pwd  = "********";
String emailId = "nick@shephertz.co.in";
String dbName = "<Your_DataBase_Name>"; 
String collectionName = "<Your_Collection_Name>"; 
JObject jsonDoc = new JObject();
jsonDoc.Add("name","John");
jsonDoc.Add("age",20);
App42API.SetDbName(dbName);  
userService.AddJSONObject(collectionName, jsonDoc);
userService.CreateUser(userName,pwd,emailId, new Callback());  
public class Callback : App42Callback  
{  	
	public void 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.GetJsonDocList().Count; i++)
		{
			Console.WriteLine("updated at = "+ user.GetJsonDocList()[i].GetUpdatedAt());
			Console.WriteLine("created at = "+ user.GetJsonDocList()[i].GetCreatedAt());
			Console.WriteLine("doc id is = "+ user.GetJsonDocList()[i].GetDocId());
			Console.WriteLine("json doc  is = "+ user.GetJsonDocList()[i].GetJsonDoc());	
		}			
		String jsonResponse = user.ToString();  
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}
NSString *userName = @"Nick";
NSString *password = @"*******";
NSString *email = @"nick@shephertz.co.in";
NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>";
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:@"John",@"name",@"20",@"age", nil];
[App42API setDbName:dbName];
[userService addUserInfo:userInfo  collectionName:collectionName];
User *user = [userService createUser:userName password:password emailAddress:email];
NSLog(@"User Name=%@",user.userName);
NSLog(@"Email = %@",user.email);
NSLog(@"SessionId = %@",user.sessionId);
for (JSONDocument *doc in user.jsonDocArray)
{
    NSLog(@"CreatedAt=%@",doc.createdAt);
    NSLog(@"UpdatedAt=%@",doc.updatedAt);
    NSLog(@"DocId=%@",doc.docId);
    NSLog(@"Doc=%@",doc.jsonDoc);
} 
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";
String dbName = "<Your_DataBase_Name>"; 
String collectionName = "<Your_Collection_Name>"; 
JSONObject jsonDoc = new JSONObject();
jsonDoc.put("name","John");
jsonDoc.put("age",20); 
App42API.setDbName(dbName);  
userService.addJSONObject( collectionName, jsonDoc);    
User user = userService.createUser(userName, pwd, emailId); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
for(int i=0;i<user.getJsonDocList().size();i++)
{
	User.JSONDocument jsonDocument = (User.JSONDocument)user.getJsonDocList().elementAt(i);
	System.out.println("updated at = "+ jsonDocument.getUpdatedAt());
	System.out.println("created at = "+ jsonDocument.getCreatedAt());
	System.out.println("doc id is = "+ jsonDocument.getDocId());
	System.out.println("json doc  is = "+ jsonDocument.getJsonDoc());	
}
String jsonResponse = user.toString(); 
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";
String dbName = "<Your_DataBase_Name>"; 
String collectionName = "<Your_Collection_Name>"; 
JSONObject jsonDoc = new JSONObject();
jsonDoc.put("name","John");
jsonDoc.put("age",20); 
App42API.setDbName(dbName);  
userService.addJSONObject( collectionName, jsonDoc);    
User user = userService.createUser(userName, pwd, emailId); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
for(int i=0;i<user.getJsonDocList().size();i++)
{
	System.out.println("updated at = "+ user.getJsonDocList().get(i).getUpdatedAt());
	System.out.println("created at = "+ user.getJsonDocList().get(i).getCreatedAt());
	System.out.println("doc id is = "+ user.getJsonDocList().get(i).getDocId());
	System.out.println("json doc  is = "+ user.getJsonDocList().get(i).getJsonDoc());	
}
String jsonResponse = user.toString();  
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";
String dbName = "<Your_DataBase_Name>"; 
String collectionName = "<Your_Collection_Name>"; 
Dictionary<string, object> jsonDoc = new Dictionary<string, object> ();
jsonDoc.Add("name","John");
jsonDoc.Add("age",20);
App42API.SetDbName(dbName);  
userService.AddJSONObject(collectionName, jsonDoc);    
App42Log.SetDebug(true);		//Print output in your editor console
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());
		for(int i=0; i<user.GetJsonDocList().Count; i++)
		{
			App42Log.Console("updated at = "+ user.GetJsonDocList()[i].GetUpdatedAt());
			App42Log.Console("created at = "+ user.GetJsonDocList()[i].GetCreatedAt());
			App42Log.Console("doc id is = "+ user.GetJsonDocList()[i].GetDocId());
			App42Log.Console("json doc  is = "+ user.GetJsonDocList()[i].GetJsonDoc());	
		}		
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick";  
var pwd = "*********";  
var emailId = "nick@shephertz.co.in";  
var result ;
var dbName = "<Your_DataBase_Name>";
var collectionName = "<Your_Collection_Name>";
var jsonDoc = new Object();
jsonDoc.name = "Nick";
jsonDoc.type = "30";
App42.setDbName(dbName);            
userService.addJSONObject(collectionName,jsonDoc);
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)		
		console.log("Created At : "+result.jsonDoc._$createdAt)
		console.log("Updated At : "+result.jsonDoc._$updatedAt);
		console.log("Doc Id is : "+result.jsonDoc._id.$oid);
		console.log("Owner is : "+result.jsonDoc._$owner.owner);		
	},  
	error: function(error) {  
	}  
}); 
local userName  = "Nick"
local pwd = "********"
local emailId = "nick@shephertz.co.in"
local dbName = "<Your_DataBase_Name>"
local collectionName = "<Your_Collection_Name>" 
local jsonDoc = {}
jsonDoc.name =  "John"
jsonDoc.age = 20
local App42CallBack = {}
App42API:setDbName(dbName);
userService:addJSONObject( collectionName, jsonDoc);
userService:createUser(userName,pwd,emailId,App42CallBack)
function App42CallBack:onSuccess(object)
	print("userName is "..object:getUserName())
	print("emailId is "..object:getEmail())
	print("getDocId is "..object:getJsonDocList():getDocId())
	print("getCreatedAt  is "..object:getJsonDocList():getCreatedAt());  
	print("getUpdatedAt is "..object:getJsonDocList():getUpdatedAt());  
	print("Doclist Name is "..JSON:encode(object:getJsonDocList():getJsonDoc()));
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
const char* pwd = "*******";
const char* emailId = "nick@shephertz.co.in";
App42Object* app42Object = new App42Object();
app42Object->setObject("name", "John");
app42Object->setObject("age", "20");
const char* dbName = "<Enter_the_dbName>";
const char* collectionName = "<Your_Collection_Name>";
App42API::setDbName(dbName);
userService->AddUserInfo(object, collectionName);
userService->CreateUser(userName, pwd, emailId,this,app42callfuncND_selector(TestUserService::onUserRequestCompleted));
void TestUserService::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d",userResponse->getCode());
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());

            std::vector<JSONDocument>::iterator jsonDoc;
            for(jsonDoc=it->jsonDocArray.begin(); jsonDoc!=it->jsonDocArray.end(); ++jsonDoc)
            {
                printf("\n CreatedAt=%s",jsonDoc->getCreatedAt().c_str());
                printf("\n DocId=%s",jsonDoc->getDocId().c_str());
                printf("\n Event=%s",jsonDoc->getEvent().c_str());
                printf("\n Owner=%s",jsonDoc->getOwner().c_str());
                printf("\n UpdatedAt=%s",jsonDoc->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",jsonDoc->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";
String dbName = "<Your_DataBase_Name>"; 
String collectionName = "<Your_Collection_Name>"; 
Dictionary<string, object> jsonDoc = new Dictionary<string, object> ();
jsonDoc.Add("name","John");
jsonDoc.Add("age",20);
App42API.SetDbName(dbName);  
userService.AddJSONObject(collectionName, jsonDoc);    
User user = userService.CreateUser(userName, pwd, emailId); 
Console.WriteLine("userName is " + user.GetUserName());
Console.WriteLine("emailId is " + user.GetEmail());
for(int i=0; i<user.GetJsonDocList().Count; i++)
{
	Console.WriteLine("updated at = "+ user.GetJsonDocList()[i].GetUpdatedAt());
	Console.WriteLine("created at = "+ user.GetJsonDocList()[i].GetCreatedAt());
	Console.WriteLine("doc id is = "+ user.GetJsonDocList()[i].GetDocId());
	Console.WriteLine("json doc  is = "+ user.GetJsonDocList()[i].GetJsonDoc());	
}			
String jsonResponse = user.ToString();       
$userName = "Nick";
$pwd = "********";
$emailId = "nick@shephertz.co.in";
$dbName = "<Your_DataBase_Name>";
$collectionName = "<Your_Collection_Name>"; 
App42API::setDbName($dbName);
$jsonDoc = new JSONObject();
$jsonDoc->put("name", "John");      
$jsonDoc->put("age", 20);      
$userService->addJSONObject( $collectionName, $jsonDoc);
$user = $userService->createUser($userName, $pwd, $emailId); 
print_r("userName is " . $user->getUserName());
print_r("emailId is " . $user->getEmail());
$jsonDocList = $user->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId().PHP_EOL);
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc().PHP_EOL);
	print_r("updated at is : " . $jsonDoc->getUpdatedAt().PHP_EOL);
	print_r("created At is : " . $jsonDoc->getCreatedAt().PHP_EOL);
	print_r("Owner is : " . $jsonDoc->getOwner().PHP_EOL);
}
$jsonResponse = $user->toString(); 
Coming Soon
Coming Soon
var userName:String = "Nick";   
var pwd:String  = "*****";
var emailId:String = "nick@shephertz.co.in";
var dbName:String = "<Your_DataBase_Name>";
var collectionName:String = "<Your_Collection_Name>"; 
var jsonDoc:Object = new Object;
jsonDoc.name = "John";
jsonDoc.age = 30;
App42API.setDbName(dbName);
userService.addJSONObject( collectionName, jsonDoc);
userService.createUser(userName,pwd,emailId, new callback());  
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var user:User = User(response); 
		var jsonDoc:JSONDocument = new JSONDocument(); 
		trace("userName is " + user.getUserName());
		trace("emailId is " + user.getEmail());
		var jsonDocsList:Array = user.getJsonDocList();
		for(var t:int=0; t < jsonDocsList.length;t++)
		{
			jsonDoc = JSONDocument(jsonDocsList[t]);
			trace("Doc ID is in get user : : "+ jsonDoc.getDocId());
			trace("CreatedAt is : " + jsonDoc.getCreatedAt());
			trace("UpdatedAt is :  " + jsonDoc.getUpdatedAt());
			trace("JsonDoc is :  " + jsonDoc.getJsonDoc());		
		}
	}  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
Coming Soon 

Fetch Additional data of User

Fetches additional data of user in JSON format. One can pass query object while fetching desired records of user. Null value of query object will return all records of User in given collection.

Required Parameters

userName - Name of the user to retrieve.

  • 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 Corona
  • create User Api for Cocos2DX
  • 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 key1 = "name";   
String value1 = "John";
Query query = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to John
App42API.setDbName("<Enter_the_dbName>");
userService.setQuery("<Your_Collection_Name>", query);
userService.getUser(userName, new App42CallBack() {
public void onSuccess(Object response) 
{
	User user = (User)response;
	System.out.println("userName is " + user.getUserName());
	System.out.println("emailId is " + user.getEmail());
	for(int i=0;i<user.getJsonDocList().size();i++)
	{
		System.out.println("updated at = "+ user.getJsonDocList().get(i).getUpdatedAt());
		System.out.println("created at = "+ user.getJsonDocList().get(i).getCreatedAt());
		System.out.println("doc id is = "+ user.getJsonDocList().get(i).getDocId());
		System.out.println("json doc  is = "+ user.getJsonDocList().get(i).getJsonDoc());	
	}
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
}); 
String userName = "Nick"; 
String key1 = "name";   
String value1 = "John";
Query query = QueryBuilder.Build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to John
App42API.SetDbName("<Enter_the_dbName>");
userService.SetQuery("<Your_Collection_Name>", query);  
userService.GetUser(userName, new Callback());  
public class Callback : App42Callback  
{  	
	public void 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.GetJsonDocList().Count; i++)
		{
			Console.WriteLine("updated at = "+ user.GetJsonDocList()[i].GetUpdatedAt());
			Console.WriteLine("created at = "+ user.GetJsonDocList()[i].GetCreatedAt());
			Console.WriteLine("doc id is = "+ user.GetJsonDocList()[i].GetDocId());
			Console.WriteLine("json doc  is = "+ user.GetJsonDocList()[i].GetJsonDoc());	
		}			
		String jsonResponse = user.ToString();  
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}
NSString *userName = @"Nick";
NSString *key = @"name";
NSString *value = @"John";

NSString *dbName = @"<Your_DataBase_Name>";
NSString *collectionName = @"<Your_Collection_Name>";

Query *query = [QueryBuilder buildQueryWithKey:key value:value andOperator:APP42_OP_EQUALS];

[App42API setDbName:dbName];
[userService setQuery:collectionName metaInfoQuery:query];

User *user = [userService getUser:userName];

NSLog(@"User Name=%@",user.userName);
NSLog(@"Email = %@",user.email);
NSLog(@"SessionId = %@",user.sessionId);
for (JSONDocument *doc in user.jsonDocArray)
{
    NSLog(@"CreatedAt=%@",doc.createdAt);
    NSLog(@"UpdatedAt=%@",doc.updatedAt);
    NSLog(@"DocId=%@",doc.docId);
    NSLog(@"Doc=%@",doc.jsonDoc);
}

String userName = "Nick";  
String key1 = "name";   
String value1 = "John";
Query query = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to John
App42API.setDbName("<Enter_the_dbName>");
userService.setQuery("<Your_Collection_Name>", query);  
User user = userService.getUser(userName); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
for(int i=0;i<user.getJsonDocList().size();i++)
{
	User.JSONDocument jsonDocument = (User.JSONDocument)user.getJsonDocList().elementAt(i);
	System.out.println("updated at = "+ jsonDocument.getUpdatedAt());
	System.out.println("created at = "+ jsonDocument.getCreatedAt());
	System.out.println("doc id is = "+ jsonDocument.getDocId());
	System.out.println("json doc  is = "+ jsonDocument.getJsonDoc());	
}
String jsonResponse = user.toString();   
String userName = "Nick";  
String key1 = "name";   
String value1 = "John";
Query query = QueryBuilder.build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to John
App42API.setDbName("<Enter_the_dbName>");
userService.setQuery("<Your_Collection_Name>", query); 
User user = userService.getUser(userName); 
User user = userService.createUser(userName, pwd, emailId); 
System.out.println("userName is " + user.getUserName());
System.out.println("emailId is " + user.getEmail());
for(int i=0;i<user.getJsonDocList().size();i++)
{
	System.out.println("updated at = "+ user.getJsonDocList().get(i).getUpdatedAt());
	System.out.println("created at = "+ user.getJsonDocList().get(i).getCreatedAt());
	System.out.println("doc id is = "+ user.getJsonDocList().get(i).getDocId());
	System.out.println("json doc  is = "+ user.getJsonDocList().get(i).getJsonDoc());	
}
String userName = "Nick";   
String key1 = "name";   
String value1 = "John";
Query query = QueryBuilder.Build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to John
App42API.SetDbName("<Enter_the_dbName>");
userService.SetQuery("<Your_Collection_Name>", query);   
App42Log.SetDebug(true);		//Print output in your editor console
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());
		for(int i=0; i<user.GetJsonDocList().Count; i++)
		{
			App42Log.Console("updated at = "+ user.GetJsonDocList()[i].GetUpdatedAt());
			App42Log.Console("created at = "+ user.GetJsonDocList()[i].GetCreatedAt());
			App42Log.Console("doc id is = "+ user.GetJsonDocList()[i].GetDocId());
			App42Log.Console("json doc  is = "+ user.GetJsonDocList()[i].GetJsonDoc());	
		}		
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
Coming Soon    
local userName  = "Nick"
local key1 = "name"   
local value1 = "John"
local query = queryBuilder:build(key1, value1, Operator.EQUALS)  
App42API:setDbName("<Enter_the_dbName>");
userService:setQuery("<Your_Collection_Name>",query);
local App42CallBack = {}
userService:getUser(userName,App42CallBack)
function App42CallBack:onSuccess(object)
	print("userName is "..object:getUserName())
	print("emailId is "..object:getEmail())
	print("getDocId is "..object:getJsonDocList():getDocId())
	print("getCreatedAt  is "..object:getJsonDocList():getCreatedAt());  
	print("getUpdatedAt is "..object:getJsonDocList():getUpdatedAt());  
	print("Doclist Name is "..JSON:encode(object:getJsonDocList():getJsonDoc()));
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
const char* key = "name";
const char* value = "John";
Query* query = QueryBuilder::BuildQuery(key, value, APP42_OP_EQUALS);
const char* dbName = "<Enter_the_dbName>";
const char* collectionName = "<Your_Collection_Name>";
App42API::setDbName(dbName);
userService->setQuery(collectionName, query);
userService->GetUser(userName, this, app42callfuncND_selector(TestUserService::onUserRequestCompleted));
void TestUserService::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d",userResponse->getCode());
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());

            std::vector<JSONDocument>::iterator jsonDoc;
            for(jsonDoc=it->jsonDocArray.begin(); jsonDoc!=it->jsonDocArray.end(); ++jsonDoc)
            {
                printf("\n CreatedAt=%s",jsonDoc->getCreatedAt().c_str());
                printf("\n DocId=%s",jsonDoc->getDocId().c_str());
                printf("\n Event=%s",jsonDoc->getEvent().c_str());
                printf("\n Owner=%s",jsonDoc->getOwner().c_str());
                printf("\n UpdatedAt=%s",jsonDoc->getUpdatedAt().c_str());
                printf("\n JsonDoc=%s\n",jsonDoc->getJsonDoc().c_str());
            }
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

String userName = "Nick"; 
String key1 = "name";   
String value1 = "John";
Query query = QueryBuilder.Build(key1, value1, Operator.EQUALS); // Build query q1 for key1 equal to name and value1 equal to John
App42API.SetDbName("<Enter_the_dbName>");
userService.SetQuery("<Your_Collection_Name>", query);   
User user = userService.GetUser(userName); 
Console.WriteLine("userName is " + user.GetUserName());
Console.WriteLine("emailId is " + user.GetEmail());
for(int i=0; i<user.GetJsonDocList().Count; i++)
{
	Console.WriteLine("updated at = "+ user.GetJsonDocList()[i].GetUpdatedAt());
	Console.WriteLine("created at = "+ user.GetJsonDocList()[i].GetCreatedAt());
	Console.WriteLine("doc id is = "+ user.GetJsonDocList()[i].GetDocId());
	Console.WriteLine("json doc  is = "+ user.GetJsonDocList()[i].GetJsonDoc());	
}			
String jsonResponse = user.ToString(); 
$userName = "Nick"; 
$key1 = "name";   
$value1 = "John";
$queryBuilder = new QueryBuilder();
App42API::setDbName("<Enter_the_dbName>");
$query = $queryBuilder->build($key1, $value1, Operator::EQUALS);  // Build query q1 for key1 equal to name and value1 equal to John
$userService->setQuery("<Your_Collection_Name>", $query);
$user = $userService->getUser($userName); 
print_r("userName is " . $user->getUserName());
print_r("emailId is " . $user->getEmail());
$jsonDocList = $user->getJsonDocList();
foreach( $jsonDocList as $jsonDoc )
{
	print_r("docId is : " . $jsonDoc->getDocId().PHP_EOL);
	print_r("jsonDocs is : " . $jsonDoc->getJsonDoc().PHP_EOL);
	print_r("updated at is : " . $jsonDoc->getUpdatedAt().PHP_EOL);
	print_r("created At is : " . $jsonDoc->getCreatedAt().PHP_EOL);
	print_r("Owner is : " . $jsonDoc->getOwner().PHP_EOL);
}
$jsonResponse = $user->toString(); 
Coming Soon
Coming Soon 
var userName:String = "Nick";  
var key1:String = "name";
var value1:String = "John";
App42API.setDbName("<Enter_the_dbName>");
var query:Query = QueryBuilder.build(key1, value1, Operator.EQUALS);
userService.setQuery( "<Your_Collection_Name>", query);
userService.getUser(userName, new callback()); 
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var user:User = User(response); 
		var jsonDoc:JSONDocument = new JSONDocument(); 
		trace("userName is " + user.getUserName());
		trace("emailId is " + user.getEmail());
		var jsonDocsList:Array = user.getJsonDocList();
		for(var t:int=0; t < jsonDocsList.length;t++)
		{
			jsonDoc = JSONDocument(jsonDocsList[t]);
			trace("Doc ID is in get user : : "+ jsonDoc.getDocId());
			trace("CreatedAt is : " + jsonDoc.getCreatedAt());
			trace("UpdatedAt is :  " + jsonDoc.getUpdatedAt());
			trace("JsonDoc is :  " + jsonDoc.getJsonDoc());		
		}
	}  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
}  
Not Available

Create User With Profile

This function allows you to create a User session for the specified Usere and add his profile. Note: Username and EmailId should be unique for the App.

Required Parameters

userName - Name of the user for whom the user session is to be created. pwd - Password for the user. emailId - EmailId of the user. profile - Add all the values that you want to retain in user profile object

  • 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 Corona
  • create User Api for Cocos2DX
  • 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";
Profile profile = new User().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");
userService.createUserWithProfile(userName, pwd ,emailId, profile,new App42CallBack() {
public void onSuccess(Object response) 
{
	User user = (User)response;
	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 void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
Coming Soon
Coming Soon
Coming Soon
String userName = "Nick";					
String pwd = "********";
String emailId = "nick@shephertz.co.in";
Profile profile = new User().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.createUserWithProfile(userName, pwd,emailId, profile);
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()); 
Coming Soon
Coming Soon    
Coming Soon
const char* userName = "Nick";
const char* password = "*********";
const char* email = "nick@shephertz.co.in";
App42UserProfile userProfile;
userProfile.firstName = "Nick";
userProfile.lastName = "Gill";
userProfile.setSex(App42UserProfile::MALE);
userProfile.dateOfBirth = "";
userProfile.city = "Houston";
userProfile.state = "Texas";
userProfile.pincode = "74193";
userProfile.country = "USA";
userProfile.mobile = "+1-1111-111-111";
userProfile.homeLandLine = "+1-2222-222-222";
userProfile.officeLandLine = "+1-33333-333-333";
userService->CreateUserWithProfile(userName, password, email, &userProfile, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));
void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d ",userResponse->getCode());
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
            printf("\n SessionId=%s",it->sessionId.c_str());
            printf("\n isAccountLocked=%d",it->isAccountLocked);
            printf("\n CreatedOn=%s",it->createdOn.c_str());
            printf("\n Password=%s",it->password.c_str());
            //Fetching Profile Info
            printf("\n FirstName=%s",it->profile.firstName.c_str());
            printf("\n LastName=%s",it->profile.lastName.c_str());
            printf("\n Sex=%s",it->profile.getSex().c_str());
            printf("\n Date of Birth=%s",it->profile.dateOfBirth.c_str());
            printf("\n Line1=%s",it->profile.line1.c_str());
            printf("\n Line2=%s",it->profile.line2.c_str());
            printf("\n City=%s",it->profile.city.c_str());
            printf("\n State=%s",it->profile.state.c_str());
            printf("\n Pincode=%s",it->profile.pincode.c_str());
            printf("\n Country=%s",it->profile.country.c_str());
            printf("\n Mobile=%s",it->profile.mobile.c_str());
            printf("\n HomeLandLine=%s",it->profile.homeLandLine.c_str());
            printf("\n OfficeLandLine=%s",it->profile.officeLandLine.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}
Coming Soon
$userName = "Nick";
$pwd = "********";
$emailId = "nick@shephertz.co.in";
$user = new User();
$profile = new Profile($user);
$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->createUserWithProfile($userName, $pwd, $emailId, $profile);
print_r("userName is " . $user->getUserName());
print_r("emailId is " . $user->getEmail());
$profileObj = $user->getProfile();
print_r("firstName is" . $profileObj->getFirstName());
print_r("City is" . $profileObj->getCity());
print_r("Country is" . $profileObj->getCountry());
Coming Soon
Coming Soon 
var userName:String = "Nick"; 
var pwd:String  = "*****";
var emailId:String = "nick@shephertz.co.in";
var date:Date = new Date(); 
var profile:Profile  =new Profile();
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");
userService.createUserWithProfile(userName,pwd,emailId,profile,new callback());
public class callback implements App42CallBack  {  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message"+ excption.getMessage());  
	}  
	public function onSuccess(response:Object):void  
	{  
			var user:User = User(response);
			trace("User Name :"+user.getUserName());		
			trace("Email Id:"+user.getEmail());
			trace("First Name is :"+user.getProfile().getFirstName());
			trace("City is :"+user.getProfile().getCity());
			trace("Country is :"+user.getProfile().getCountry());
	}  
}
Not Available

Get Users By Group

This function will allow you to find the list of user data.

Required Parameters

userList - List of user for which you want to find the data.

  • 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 Corona
  • create User Api for Cocos2DX
  • 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<String> userList = new ArrayList<String>();
userList.add("Username");
userService.getUsersByGroup(userList,new App42CallBack() {
public void onSuccess(Object response) 
{
	ArrayList<User> user = (ArrayList<User>)response;
	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());  
		System.out.println("First Name is " + user.get(i).getProfile().getFirstName());  
		System.out.println("Last Name is " + user.get(i).getProfile().getLastName());  
	}  	
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
Coming Soon
Coming Soon
Coming Soon
ArrayList<String> userList = new ArrayList<String>();
userList.add("Username");
ArrayList<User> user = userService.getUsersByGroup(userList);
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());  
	System.out.println("First Name is " + user.get(i).getProfile().getFirstName());  
	System.out.println("Last Name is " + user.get(i).getProfile().getLastName());  
} 
Coming Soon
Coming Soon    
Coming Soon
vector<string>users;
users.push_back("John");
users.push_back("Nick");
userService->GetUsersByGroup(users, this, app42callfuncND_selector(Sample_Class::onUserRequestCompleted));
void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d ",userResponse->getCode());
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {        
        for(std::vector<App42User>::iterator it = userResponse->users.begin(); it != userResponse->users.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n Email=%s",it->email.c_str());
            printf("\n SessionId=%s",it->sessionId.c_str());
            printf("\n isAccountLocked=%d",it->isAccountLocked);
            printf("\n CreatedOn=%s",it->createdOn.c_str());
            printf("\n Password=%s",it->password.c_str());
            //Fetching Profile Info
            printf("\n FirstName=%s",it->profile.firstName.c_str());
            printf("\n LastName=%s",it->profile.lastName.c_str());
            printf("\n Sex=%s",it->profile.getSex().c_str());
            printf("\n Date of Birth=%s",it->profile.dateOfBirth.c_str());
            printf("\n Line1=%s",it->profile.line1.c_str());
            printf("\n Line2=%s",it->profile.line2.c_str());
            printf("\n City=%s",it->profile.city.c_str());
            printf("\n State=%s",it->profile.state.c_str());
            printf("\n Pincode=%s",it->profile.pincode.c_str());
            printf("\n Country=%s",it->profile.country.c_str());
            printf("\n Mobile=%s",it->profile.mobile.c_str());
            printf("\n HomeLandLine=%s",it->profile.homeLandLine.c_str());
            printf("\n OfficeLandLine=%s",it->profile.officeLandLine.c_str());
        }
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
    }
}

Coming Soon
$userList = array();
array_push($userList, "Username");
$userResponse = $userService->getUsersByGroup($userList);
foreach($userResponse as $user )
{
	print_r("userName is " . $user->getUserName());
	print_r("emailId is " .  $user->getEmail());
	$profile = $user->getProfile();
	print_r("firstName is " . $profile->getFirstName());
}
Coming Soon
Coming Soon 
var userList:Array = new Array();
userList.push("Username");
userService.getUsersByGroup(userList,new callback());
public class callback implements App42CallBack  {  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message"+ excption.getMessage());  
	}  
	public function onSuccess(response:Object):void  
	{  
		for(var i:int = 0;i < response.length;i++){
			var user:User = User(response[i])
		trace("User Name :"+user.getUserName());		
		trace("Email Id:"+user.getEmail());
		trace("First Name is :"+user.getProfile().getFirstName());
		trace("City is :"+user.getProfile().getCity());
		trace("Country is :"+user.getProfile().getCountry());
		}
	}  
}
Not Available

Exception Handling

The functions available under User API can throw some exceptions in abnormal conditions. An Example of the same has been given below. E.g. If an App developer is creating a user with a username which is already in the database, the function will throw the App42Exception (as shown below) with the 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 Corona
  • create User Api for Cocos2DX
  • 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";	
userService.createUser( userName, pwd, emailId, new App42CallBack() {
public void onSuccess(Object response) 
{
	User user = (User)response;
	System.out.println("userName is " + user.getUserName());
	System.out.println("emailId is " + user.getEmail());
}
public void onException(Exception ex) 
{
	App42Exception exception = (App42Exception)ex;
	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";
userService.CreateUser(userName,pwd,emailId, new Callback());  
public class Callback : App42Callback  
{ 
	public void OnSuccess(Object response)  
	{  
		User user = (User) response;
		String jsonResponse = user.ToString();  
	}
	public void 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();  
	}    
}  
					
NSString *userName = @"Nick";
NSString *pwd = @"********";
NSString *emailId = @"nick@shephertz.co.in";
@try
{
	User *user = [userService createUser:userName password:pwd 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();    
}     
String userName = "Nick";
String pwd = "********";
String emailId = "nick@shephertz.co.in";
App42Log.SetDebug(true);		//Print output in your editor console
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)
	{	
		App42Exception exception = (App42Exception)e;
		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
		}
	}
}
var userName = "Nick",
pwd = "***********",
emailId = "nick@shephertz.co.in",
appErrorCode ;
userService.createUser(userName, pwd, emailId,{
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
	}
}
});
local userName = "Nick"
local pwd = "********"
local emailId = "nick@shephertz.co.in"
local App42CallBack = {}
userService:createUser(userName, pwd, emailId,App42CallBack)
function App42CallBack:onSuccess(object)
	print("Response Success is "..object:getResponseSuccess())
end
function App42CallBack:onException(exception)
	local appErrorCode = exception:getAppErrorCode()
	if appErrorCode == 2001 then
		-- Handle here for Bad Request (The request parameters are invalid. Username 'Nick' already exists.)
	elseif appErrorCode  == 2005 then
		-- Handle here for Bad Request (The request parameters are invalid. User with emailId 'nick@shephertz.co.in' already exists.)
	elseif appErrorCode == 1401 then
		-- handle here for Client is not authorized
	elseif appErrorCode == 1500 then
		-- handle here for Internal Server Error
	end
end
const char* userName = "Nick";
const char* pwd = "*******";
const char* emailId = "nick@shephertz.co.in";
userService->CreateUser(userName, pwd, emailId,this,app42callfuncND_selector(Sample_Class::onUserRequestCompleted));
void Sample_Class::onUserRequestCompleted(App42CallBack *sender, void *response)
{
    App42UserResponse *userResponse = (App42UserResponse*)response;
    printf("\ncode=%d...=%d",userResponse->getCode(),userResponse->isSuccess);
    printf("\nResponse Body=%s",userResponse->getBody().c_str());
    if (userResponse->isSuccess)
    {
        //Handle success response here
    }
    else
    {
        printf("\nerrordetails:%s",userResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",userResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",userResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",userResponse->httpErrorCode);
        if(userResponse->appErrorCode == 2001)
	 	{
			// Handle here for Bad Request (The request parameters are invalid. Username 'Nick' already exists.)
		}
		else if(userResponse->appErrorCode  == 2005)
		{
			// Handle here for Bad Request (The request parameters are invalid. User with emailId 'nick@shephertz.co.in' already exists.)
		}
		else if(userResponse->appErrorCode == 1401)
		{
			// handle here for Client is not authorized
		}
		else if(userResponse->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
userName = "Nick";
pwd = "********";
emailId = "nick@shephertz.com";
begin
	user = user_service.create_user(userName, pwd, emailId);
	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 '<userName>' does not exist.)
	elsif(appErrorCode  == 2005)
		# Handle here for Bad Request (The request parameters are invalid. User with emailId '<emailId>' 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 
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 onSuccess(response:Object):void  
	{  
		var user :User= User(response);    
		trace("user is " + user) 
	}  
	public function onException(exception:App42Exception):void  
	{  
		var appErrorCode:int = exception.getAppErrorCode();  
		var httpErrorCode:int = 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
		}
	}  	
}  
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.