Avatar Management Service

App42 Avatar Service allows you to manage avatars in your App.Using avatar management you can create your own avatar or import from Facebook and any other web media. You can also manage your avatar like change your current avatar or history of your previous avatars.

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");
Coming Soon
App42API::Initialize("API_KEY", "SECRET_KEY");
App42API.Initialize("API_KEY","SECRET_KEY");
App42API::initialize("API_KEY","SECRET_KEY");
Coming Soon
Coming Soon
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 AvatarService, buildAvatarService() 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
AvatarService avatarService = App42API.buildAvatarService(); 
AvatarService avatarService = App42API.BuildAvatarService();  
AvatarService *avatarService = [App42API buildAvatarService]; 
AvatarService avatarService = App42API.buildAvatarService(); 
AvatarService avatarService = App42API.buildAvatarService(); 
AvatarService avatarService = App42API.BuildAvatarService(); 
var avatarService  = new App42Avatar();
Coming Soon
AvatarService *avatarService = App42API::BuildAvatarService();
AvatarService avatarService = App42API.BuildAvatarService(); 
$avatarService = App42API::buildAvatarService();
Coming Soon
Coming Soon
var avatarService:AvatarService = App42API.buildAvatarService();
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.avatar.Avatar;
import com.shephertz.app42.paas.sdk.android.avatar.AvatarService;
using com.shephertz.app42.paas.sdk.windows;  
using com.shephertz.app42.paas.sdk.windows.avatar;   
#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.avatar.Avatar;
import com.shephertz.app42.paas.sdk.jme.avatar.AvatarService;
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.avatar.Avatar;
import com.shephertz.app42.paas.sdk.java.avatar.AvatarService;
using com.shephertz.app42.paas.sdk.csharp;  
using com.shephertz.app42.paas.sdk.csharp.avatar;  
<script type="text/javascript" src="App42-all-x.x.x.min.js">
Coming Soon
#include "App42API.h"
using com.shephertz.app42.paas.sdk.csharp;  
using com.shephertz.app42.paas.sdk.csharp.avatar;  
include_once '../App42Response.php';
include_once '../App42Exception.php';
include_once '../App42BadParameterException.php';
include_once '../App42NotFoundException.php';
include_once '../AvatarService.php';
include_once '../App42Log.php';
Coming Soon
Coming Soon
import com.shephertz.app42.paas.sdk.as3.App42Response;
import com.shephertz.app42.paas.sdk.as3.App42BadParameterException;
import com.shephertz.app42.paas.sdk.as3.App42NotFoundException;
import com.shephertz.app42.paas.sdk.as3.App42CallBack;
import com.shephertz.app42.paas.sdk.as3.App42Exception;
import com.shephertz.app42.paas.sdk.as3.App42API;
import com.shephertz.app42.paas.sdk.as3.avatar.Avatar;
import com.shephertz.app42.paas.sdk.as3.avatar.AvatarService;
Coming Soon

Create Avatar

Upload your own avatar.

Required Parameters

avatarName - Name of avatar to be created. userName - Name of the user who is creating avatar. filePath - The local path for the file. description - Description of the avatar.

  • 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 avatarName = "Shephertz Nick";
String userName = "Nick";
String filePath = "Your File Path";
String description = "My Profile Pic";
avatarService.createAvatar(avatarName,userName,filePath, description,new App42CallBack() {		
public void onSuccess(Object response)
{
	Avatar avatar = (Avatar)response;
	System.out.println("avatarName is :" + avatar.getName());  
	System.out.println("url is :" + avatar.getURL());  
	System.out.println("tinyUrl is :" + avatar.getTinyURL());  
	System.out.println("createdOn is :" + avatar.getCreatedOn());  
	System.out.println("Description is :"+avatar.getDescription());
	System.out.println("Is Current :"+avatar.isCurrent());
	System.out.println("UserName is :"+avatar.getUserName());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});
String avatarName = "Shephertz Nick";
String userName = "Nick";
String filePath = "Your File Path";
String description = "My Profile Pic";        
avatarService.CreateAvatar(avatarName, userName,filePath, description,new Callback());
public class Callback : App42Callback  
{  
	public void OnSuccess(Object response)  
	{  
		Avatar avatar = (Avatar) response;   
		Console.WriteLine("avatarName is :" + avatar.GetName());
		Console.WriteLine("url is :" + avatar.GetURL());
		Console.WriteLine("tinyUrl is :" + avatar.GetTinyURL());
		Console.WriteLine("createdOn is :" + avatar.GetCreatedOn());
		Console.WriteLine("Description is :"+avatar.GetDescription());
		Console.WriteLine("Is Current :"+avatar.IsCurrent());
		Console.WriteLine("UserName is :"+avatar.GetUserName());
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
NSString *avatarName = @"Shephertz Nick";
NSString *userName = @"Nick";
NSString *filePath = @"Your File Path";
NSString *description = @"My Profile Pic";
Avatar *avatar = [avatarService createAvatarWithName:avatarName userName:userName filePath:filePath description:description];
NSLog(@"AvatarName  %@",avatar.name);
NSLog(@"tinyUrl is  %@",avatar.tinyUrl);
NSLog(@"UserName is %@",avatar.userName);
NSLog(@"Is Current is %d",avatar.isCurrent);
String avatarName = "Shephertz Nick";
String userName = "Nick";
String filePath = "Your File Path";
String description = "My Profile Pic";
Avatar avatar =  avatarService.createAvatar(avatarName, userName,filePath, description);
System.out.println("avatarName is :" + avatar.getName());
System.out.println("url is :" + avatar.getURL());
System.out.println("tinyUrl is :" + avatar.getTinyURL());
System.out.println("createdOn is :" + avatar.getCreatedOn());
System.out.println("Description is :"+avatar.getDescription());
System.out.println("Is Current :"+avatar.isCurrent());
System.out.println("UserName is :"+avatar.getUserName());
String avatarName = "Shephertz Nick";
String userName = "Nick";
String filePath = "Your File Path";
String description = "My Profile Pic";
Avatar avatar =  avatarService.createAvatar(avatarName, userName,filePath, description);
System.out.println("avatarName is :" + avatar.getName());  
System.out.println("url is :" + avatar.getURL());  
System.out.println("tinyUrl is :" + avatar.getTinyURL());  
System.out.println("createdOn is :" + avatar.getCreatedOn());  
System.out.println("Description is :"+avatar.getDescription());
System.out.println("Is Current :"+avatar.isCurrent());
System.out.println("UserName is :"+avatar.getUserName());
String avatarName = "Shephertz Nick";
String userName = "Nick";
String filePath = "Your File Path";
String description = "My Profile Pic";
App42Log.SetDebug(true);    	//Prints output in your editor console
avatarService.CreateAvatar(avatarName, userName,filePath, description,new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Avatar avatar = (Avatar) response;  
		App42Log.Console("Avatar Name is : " + avatar.GetName());
		App42Log.Console("Url is : " + avatar.GetUrl());
		App42Log.Console("TinyUrl is : " + avatar.GetTinyUrl());
		App42Log.Console("CreatedOn is : " + avatar.GetCreatedOn());
		App42Log.Console("Description is :"+avatar.GetDescription());
		App42Log.Console("Is Current :"+avatar.IsCurrent());
		App42Log.Console("UserName is :"+avatar.GetUserName());
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var avatarName = "Shephertz Nick",
userName = "Nick",
filePath = document.getElementById("Your Input Type File Id");
file = filePath.files[0],
description = "My Profile Pic",
result;
avatarService.createAvatar(avatarName, userName,file, description,{  
	success: function(object) 
	{  
		var avatarObj = JSON.parse(object);  
		result = avatarObj.app42.response.avatars.avatar;
		console.log("avatarName is : " + result.name)
		console.log("url is : " + result.url)
		console.log("tinyUrl is : " + result.tinyUrl)
		console.log("createdOn is : " + result.createdOn)
		console.log("Description is :"+result.dscription);
		console.log("Is Current :"+result.isCurrent);
		console.log("UserName is :"+result.userName);
	},  
	error: function(error) 
	{ 
		console.log("Exception is : " + error)
	}  
});     
Coming Soon
const char* avatarName = "Shephertz Nick";
const char* userName = "Nick";
const char* filePath = "Your File Path";
const char* description = "My Profile Pic";
avatarService->CreateAvatar(avatarName, userName, filePath, description, this, app42callfuncND_selector(Sample_Class::onAvatarServiceRequestCompleted));

void Sample_Class::onAvatarServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42AvatarResponse *app42AvatarResponse = (App42AvatarResponse*)response;
    
    if(app42AvatarResponse->isSuccess)
    {
        printf("\ncode=%d",app42AvatarResponse->getCode());
        printf("\nisSuccess=%d",app42AvatarResponse->isSuccess);
        printf("\nResponse Body=%s",app42AvatarResponse->getBody().c_str());
        
        for(std::vector<App42Avatar>::iterator it = app42AvatarResponse->avatars.begin(); it != app42AvatarResponse->avatars.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n AvatarName=%s\n",it->name.c_str());
            printf("\n URL=%s\n",it->url.c_str());
            printf("\n CreatedOn=%s\n",it->createdOn.c_str());
            printf("\n Description=%s\n",it->description.c_str());
            printf("\n isCurrent=%d\n",it->isCurrent);
        }
    }
    else
    {
        printf("\nerrordetails:%s",app42AvatarResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42AvatarResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42AvatarResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42AvatarResponse->httpErrorCode);
    }
}

String avatarName = "Shephertz Nick";
String userName = "Nick";
String filePath = "Your File Path";
String description = "My Profile Pic";
Avatar avatar = avatarService.CreateAvatar(avatarName, userName,filePath, description);
Console.WriteLine("avatarName is :" + avatar.GetName());
Console.WriteLine("url is :" + avatar.GetURL());
Console.WriteLine("tinyUrl is :" + avatar.GetTinyURL());
Console.WriteLine("createdOn is :" + avatar.GetCreatedOn());
Console.WriteLine("Description is :"+avatar.GetDescription());
Console.WriteLine("Is Current :"+avatar.IsCurrent());
Console.WriteLine("UserName is :"+avatar.GetUserName());
$avatarName = "Shephertz Nick";
$userName = "Nick";
$filePath = "Your File Path";
$description = "My Profile Pic";
$avatar = $avatarService->createAvatar($avatarName, $userName, $filePath, $description);
print_r("Avatar name is :  " . $avatar->getName());
print_r("userName is :" . $avatar->getUserName());
print_r("url : " . $avatar->getURL());
print_r("tiny url : " . $avatar->getTinyURL());
print_r("created on : " .$avatar->getCreatedOn());
print_r("description : " . $avatar->getDescription());
print_r("Current is : " . $avatar->isCurrent());
Coming Soon
Coming Soon
Coming Soon
Coming Soon 

Create Avatar With Input Stream

Upload your own avatar with input stream.

Required Parameters

avatarName - Name of avatar to be created. userName - Name of the user who is creating avatar. inputStream - InputStream of the file to be creating avatar. description - Description of the avatar. fileExtension - Extention of the image. e.g:- GIF, PNG, JPG.

  • 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 avatarName = "Shephertz Nick";
String userName = "Nick";
InputStream inputStream = null; /* Get input stream from your source */  
String description = "My Profile Pic";
FileExtension fileExtension = FileExtension.GIF;
avatarService.createAvatar(avatarName,userName,filePath, description, fileExtension, new App42CallBack() {		
public void onSuccess(Object response)
{
	Avatar avatar = (Avatar)response;
	System.out.println("avatarName is :" + avatar.getName());  
	System.out.println("url is :" + avatar.getURL());  
	System.out.println("tinyUrl is :" + avatar.getTinyURL());  
	System.out.println("createdOn is :" + avatar.getCreatedOn());  
	System.out.println("Description is :"+avatar.getDescription());
	System.out.println("Is Current :"+avatar.isCurrent());
	System.out.println("UserName is :"+avatar.getUserName());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});
Coming Soon 
NSString *avatarName = @"Shephertz Nick";
NSString *userName = @"Nick";
NSString *filePath = @"Your File Path";
NSData *data = [NSData dataWithContentsOfFile:filePath];
NSString *description = @"My Profile Pic";
Avatar *avatar = [avatarServiceObject createAvatarFromFileDataWithName:avatarName userName:userName fileData:data description:description extension:PNG];

NSLog(@"AvatarName=%@",avatar.name);
NSLog(@"AvatarName  %@",avatar.name);
NSLog(@"tinyUrl is  %@",avatar.tinyUrl);
NSLog(@"UserName is %@",avatar.userName);
NSLog(@"Is Current is %d",avatar.isCurrent);
NSLog(@"Created On : %@",avatar.createdOn);
Coming Soon
String avatarName = "Shephertz Nick";
String userName = "Nick";
InputStream inputStream = null; /* Get input stream from your source */  
String description = "My Profile Pic";
FileExtension fileExtension = FileExtension.GIF;
Avatar avatar =  avatarService.createAvatar(avatarName, userName,inputStream, description,fileExtension);
System.out.println("avatarName is :" + avatar.getName());  
System.out.println("url is :" + avatar.getURL());  
System.out.println("tinyUrl is :" + avatar.getTinyURL());  
System.out.println("createdOn is :" + avatar.getCreatedOn());  
System.out.println("Description is :"+avatar.getDescription());
System.out.println("Is Current :"+avatar.isCurrent());
System.out.println("UserName is :"+avatar.getUserName());
Coming Soon
Coming Soon    
Coming Soon
const char* avatarName = "Shephertz Nick";
const char* userName = "Nick";
const char* description = "My Profile Pic";
unsigned char* inputStream = nullptr; /* Get input stream from your source */
int inputStreamSize =  <input_stream_size>;
FileExtension fileExtension = PNG;
avatarService->CreateAvatar(avatarName, userName, inputStream, fileDataLength, description, fileExtension, this, app42callfuncND_selector(Sample_Class::onAvatarServiceRequestCompleted));

void Sample_Class::onAvatarServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42AvatarResponse *app42AvatarResponse = (App42AvatarResponse*)response;
    
    if(app42AvatarResponse->isSuccess)
    {
        printf("\ncode=%d",app42AvatarResponse->getCode());
        printf("\nisSuccess=%d",app42AvatarResponse->isSuccess);
        printf("\nResponse Body=%s",app42AvatarResponse->getBody().c_str());
        
        for(std::vector<App42Avatar>::iterator it = app42AvatarResponse->avatars.begin(); it != app42AvatarResponse->avatars.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n AvatarName=%s\n",it->name.c_str());
            printf("\n URL=%s\n",it->url.c_str());
            printf("\n CreatedOn=%s\n",it->createdOn.c_str());
            printf("\n Description=%s\n",it->description.c_str());
            printf("\n isCurrent=%d\n",it->isCurrent);
        }
    }
    else
    {
        printf("\nerrordetails:%s",app42AvatarResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42AvatarResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42AvatarResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42AvatarResponse->httpErrorCode);
    }
}

String avatarName = "Shephertz Nick";
String userName = "Nick";
String filePath = "Your File Path";
String description = "My Profile Pic";
String fileExtension = FileExtension.GIF;
Avatar avatar = avatarService.CreateAvatar(avatarName, userName,filePath, description,fileExtension);
Console.WriteLine("avatarName is :" + avatar.GetName());
Console.WriteLine("url is :" + avatar.GetURL());
Console.WriteLine("tinyUrl is :" + avatar.GetTinyURL());
Console.WriteLine("createdOn is :" + avatar.GetCreatedOn());
Console.WriteLine("Description is :"+avatar.GetDescription());
Console.WriteLine("Is Current :"+avatar.IsCurrent());
Console.WriteLine("UserName is :"+avatar.GetUserName());
Not Available
Coming Soon
Coming Soon
Coming Soon
Coming Soon 

Create Avatar From Facebook

Import your avatar from Facebook based on giving access token.

Required Parameters

avatarName - Name of avatar to be created. userName - Name of the user who is creating an avatar. accessToken - Facebook Access Token that has been received after authorization. description - Description of the avatar.

  • 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 avatarName = "Shephertz Nick";
String userName = "Nick";
String accessToken = "<Enter Your Facebook Access Token>";
String description = "My Profile Pic";
avatarService.createAvatarFromFacebook(avatarName, userName, accessToken, description,new App42CallBack() {		
public void onSuccess(Object response)
{
	Avatar avatar = (Avatar)response;
	System.out.println("avatarName is :" + avatar.getName());  
	System.out.println("url is :" + avatar.getURL());  
	System.out.println("tinyUrl is :" + avatar.getTinyURL());  
	System.out.println("createdOn is :" + avatar.getCreatedOn());  
	System.out.println("Description is :"+avatar.getDescription());
	System.out.println("Is Current :"+avatar.isCurrent());
	System.out.println("UserName is :"+avatar.getUserName());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});
String avatarName = "Shephertz Nick";
String userName = "Nick";
String accessToken = "<Enter Your Facebook Access Token>";
String description = "My Profile Pic";		
avatarService.CreateAvatarFromFacebook(avatarName, userName,accessToken, description,new Callback());
public class Callback : App42Callback  
{  
	public void OnSuccess(Object response)  
	{  
		Avatar avatar = (Avatar) response;   
		Console.WriteLine("avatarName is :" + avatar.GetName());
		Console.WriteLine("url is :" + avatar.GetURL());
		Console.WriteLine("tinyUrl is :" + avatar.GetTinyURL());
		Console.WriteLine("createdOn is :" + avatar.GetCreatedOn());
		Console.WriteLine("Description is :"+avatar.GetDescription());
		Console.WriteLine("Is Current :"+avatar.IsCurrent());
		Console.WriteLine("UserName is :"+avatar.GetUserName());		
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
NSString *avatarName = @"Shephertz Nick";
NSString *userName = @"Nick";
NSString *accessToken  = @"<Enter Your Facebook Access Token>";
NSString *description = @"My Profile Pic";
Avatar *avatar = [avatarService createAvatarFromFacebookWithName:avatarName userName:userName accessToken:accessToken description:description];
NSLog(@"AvatarName  %@",avatar.name);
NSLog(@"tinyUrl is  %@",avatar.tinyUrl);
NSLog(@"UserName is %@",avatar.userName);
NSLog(@"Is Current is %d",avatar.isCurrent);
String avatarName = "Shephertz Nick";
String userName = "Nick";
String accessToken = "<Enter Your Facebook Access Token>";
String description = "My Profile Pic";
Avatar avatar =  avatarService.createAvatarFromFacebook(avatarName, userName,accessToken, description);
System.out.println("avatarName is :" + avatar.getName());
System.out.println("url is :" + avatar.getURL());
System.out.println("tinyUrl is :" + avatar.getTinyURL());
System.out.println("createdOn is :" + avatar.getCreatedOn());
System.out.println("Description is :"+avatar.getDescription());
System.out.println("Is Current :"+avatar.isCurrent());
System.out.println("UserName is :"+avatar.getUserName());
String avatarName = "Shephertz Nick";
String userName = "Nick";
String accessToken = "<Enter Your Facebook Access Token>";
String description = "My Profile Pic";
Avatar avatar =  avatarService.createAvatarFromFacebook(avatarName, userName,accessToken, description);
System.out.println("avatarName is :" + avatar.getName());  
System.out.println("url is :" + avatar.getURL());  
System.out.println("tinyUrl is :" + avatar.getTinyURL());  
System.out.println("createdOn is :" + avatar.getCreatedOn());  
System.out.println("Description is :"+avatar.getDescription());
System.out.println("Is Current :"+avatar.isCurrent());
System.out.println("UserName is :"+avatar.getUserName());
String avatarName = "Shephertz Nick";
String userName = "Nick";
String accessToken = "<Enter Your Facebook Access Token>";
String description = "My Profile Pic";
App42Log.SetDebug(true);        //Prints output in your editor console
avatarService.CreateAvatarFromFacebook(avatarName, userName,accessToken, description,new UnityCallBack());
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Avatar avatar = (Avatar) response;   
		App42Log.Console("Avatar Name is : " + avatar.GetName());
		App42Log.Console("Url is : " + avatar.GetUrl());
		App42Log.Console("TinyUrl is : " + avatar.GetTinyUrl());
		App42Log.Console("CreatedOn is : " + avatar.GetCreatedOn());
		App42Log.Console("Description is : " + avatar.GetDescription());
		App42Log.Console("Is Current :"+avatar.IsCurrent());
		App42Log.Console("UserName is :"+avatar.GetUserName());	
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var avatarName = "Shephertz Nick",
userName = "Nick",
accessToken = "<Enter Your Facebook Access Token>",
description = "My Profile Pic",
result;
avatarService.createAvatarFromFacebook(avatarName, userName,accessToken, description,{  
	success: function(object) 
	{  
		var avatarObj = JSON.parse(object);  
		result = avatarObj.app42.response.avatars.avatar;
		console.log("avatarName is : " + result.name)
		console.log("url is : " + result.url)
		console.log("tinyUrl is : " + result.tinyUrl)
		console.log("createdOn is : " + result.createdOn)
		console.log("Description is :"+result.description);
		console.log("Is Current :"+result.isCurrent);
		console.log("UserName is :"+result.userName);
	},  
	error: function(error) 
	{ 
		console.log("Exception is : " + error)
	}  
});     
Coming Soon
const char* avatarName = "Shephertz Nick";
const char* userName = "Nick";
const char* description = "My Profile Pic";
const char* accessToken = "<Enter Your Facebook Access Token>";
avatarService->CreateAvatarFromFacebook(avatarName, userName, accessToken, description, this, app42callfuncND_selector(Sample_Class::onAvatarServiceRequestCompleted));
void Sample_Class::onAvatarServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42AvatarResponse *app42AvatarResponse = (App42AvatarResponse*)response;
    
    if(app42AvatarResponse->isSuccess)
    {
        printf("\ncode=%d",app42AvatarResponse->getCode());
        printf("\nisSuccess=%d",app42AvatarResponse->isSuccess);
        printf("\nResponse Body=%s",app42AvatarResponse->getBody().c_str());
        
        for(std::vector<App42Avatar>::iterator it = app42AvatarResponse->avatars.begin(); it != app42AvatarResponse->avatars.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n AvatarName=%s\n",it->name.c_str());
            printf("\n URL=%s\n",it->url.c_str());
            printf("\n CreatedOn=%s\n",it->createdOn.c_str());
            printf("\n Description=%s\n",it->description.c_str());
            printf("\n isCurrent=%d\n",it->isCurrent);
        }
    }
    else
    {
        printf("\nerrordetails:%s",app42AvatarResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42AvatarResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42AvatarResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42AvatarResponse->httpErrorCode);
    }
}
String avatarName = "Shephertz Nick";
String userName = "Nick";
String accessToken = "<Enter Your Facebook Access Token>";
String description = "My Profile Pic";
Avatar avatar = avatarService.CreateAvatarFromFacebook(avatarName, userName,accessToken, description);
Console.WriteLine("avatarName is :" + avatar.GetName());
Console.WriteLine("url is :" + avatar.GetURL());
Console.WriteLine("tinyUrl is :" + avatar.GetTinyURL());
Console.WriteLine("createdOn is :" + avatar.GetCreatedOn());
Console.WriteLine("Description is :"+avatar.GetDescription());
Console.WriteLine("Is Current :"+avatar.IsCurrent());
Console.WriteLine("UserName is :"+avatar.GetUserName());
$avatarName = "Shephertz Nick";
$userName = "Nick";
$accessToken = "<Enter Your Facebook Access Token>";
$description = "My Profile Pic";
$avatar = $avatarService->createAvatarFromFacebook($avatarName, $userName, $accessToken, $description);
print_r("Avatar name is :  " . $avatar->getName());
print_r("userName is :" . $avatar->getUserName());
print_r("url : " . $avatar->getURL());
print_r("tiny url : " . $avatar->getTinyURL());
print_r("created on : " .$avatar->getCreatedOn());
print_r("description : " . $avatar->getDescription());
print_r("Current is : " . $avatar->isCurrent());
Coming Soon
Coming Soon
var avatarName:String = "Shephertz Nick";
var userName:String = "Nick";
var accessToken:String = "<Enter Your Facebook Access Token>";
var description:String = "My Profile Pic";
avatarService.createAvatarFromFacebook(avatarName,userName, accessToken, description,new callback());
class callback implements App42CallBack  
{  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
	public function onSuccess(response:Object):void  
	{  
		var avatar:Avatar = Avatar(response);
		trace("Avatar success is : "+response)	
		trace("Created On :"+avatar.getCreatedOn());
		trace("Description is :"+avatar.getDescription());
		trace("Avatar Name is:"+avatar.getName());
		trace("Tiny url :"+avatar.getTinyURL());
		trace("Is Current :"+avatar.IsCurrent());
		trace("UserName is :"+avatar.getUserName());
		trace("Url is :"+avatar.getURL());
	}
}
Coming Soon 

Create Avatar From Web URL

Create an avatar from any web media using a URL.

Required Parameters

avatarName - Name of avatar to be created. userName - Name of the user who is creating an avatar. webURL - Web URL of the photo which you want to create. description - Description of the avatar.

  • 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 avatarName = "Shephertz Nick";
String userName = "Nick";
String webURL = "<Enter the WebURL>";
String description = "My Profile Pic";
avatarService.createAvatarFromWebURL(avatarName, userName, webURL, description, new App42CallBack() {		
public void onSuccess(Object response) 
{
	Avatar avatar = (Avatar)response;
	System.out.println("avatarName is :" + avatar.getName());  
	System.out.println("url is :" + avatar.getURL());  
	System.out.println("tinyUrl is :" + avatar.getTinyURL());  
	System.out.println("createdOn is :" + avatar.getCreatedOn());  
	System.out.println("Description is :"+avatar.getDescription());
	System.out.println("Is Current :"+avatar.isCurrent());
	System.out.println("UserName is :"+avatar.getUserName());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());		
}
});
String avatarName = "Shephertz Nick";
String userName = "Nick";
String webURL = "<Enter the WebURL>";
String description = "My Profile Pic";		
avatarService.CreateAvatarFromWebURL(avatarName, userName,webURL, description,new Callback());
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Avatar avatar = (Avatar) response;   
		Console.WriteLine("avatarName is :" + avatar.GetName());
		Console.WriteLine("url is :" + avatar.GetURL());
		Console.WriteLine("tinyUrl is :" + avatar.GetTinyURL());
		Console.WriteLine("createdOn is :" + avatar.GetCreatedOn());
		Console.WriteLine("Description is :"+avatar.GetDescription());
		Console.WriteLine("Is Current :"+avatar.IsCurrent());
		Console.WriteLine("UserName is :"+avatar.GetUserName());
	}  
}  
NSString *avatarName = @"Shephertz Nick";
NSString *userName = @"Nick";
NSString *webUrl   = @"<Enter the WebURL>";
NSString *description = @"My Profile Pic";
Avatar *avatar = [avatarService createAvatarFromWebURLWithName:avatarName userName:userName webUrl:webUrl description:description];
NSLog(@"AvatarName  %@",avatar.name);
NSLog(@"tinyUrl is  %@",avatar.tinyUrl);
NSLog(@"UserName is %@",avatar.userName);
NSLog(@"Is Current is %d",avatar.isCurrent);
String avatarName = "Shephertz Nick";
String userName = "Nick";
String webURL = "<Enter the WebURL>";
String description = "My Profile Pic";
Avatar avatar = avatarService.createAvatarFromWebURL(avatarName, userName,webURL, description);
System.out.println("avatarName is :" + avatar.getName());  
System.out.println("url is :" + avatar.getURL());  
System.out.println("tinyUrl is :" + avatar.getTinyURL());  
System.out.println("createdOn is :" + avatar.getCreatedOn());  
System.out.println("Description is :"+avatar.getDescription());
System.out.println("Is Current :"+avatar.isCurrent());
System.out.println("UserName is :"+avatar.getUserName());
String avatarName = "Shephertz Nick";
String userName = "Nick";
String webURL = "<Enter the WebURL>";
String description = "My Profile Pic";
Avatar avatar =  avatarService.createAvatarFromWebURL(avatarName, userName,webURL, description);
System.out.println("avatarName is :" + avatar.getName());  
System.out.println("url is :" + avatar.getURL());  
System.out.println("tinyUrl is :" + avatar.getTinyURL());  
System.out.println("createdOn is :" + avatar.getCreatedOn());  
System.out.println("Description is :"+avatar.getDescription());
System.out.println("Is Current :"+avatar.isCurrent());
System.out.println("UserName is :"+avatar.getUserName());
String avatarName = "Shephertz Nick";
String userName = "Nick";
String webURL = "<Enter the WebURL>";
String description = "My Profile Pic";
App42Log.SetDebug(true);        //Prints output in your editor console
avatarService.CreateAvatarFromWebURL(avatarName, userName, webURL, description,new UnityCallBack());
public class UnityCallBack : App42CallBack
{
    public void OnSuccess(object response)
	{
		Avatar avatar = (Avatar) response;   
	    App42Log.Console("Avatar Name is : " + avatar.GetName());
		App42Log.Console("Url is : " + avatar.GetUrl());
		App42Log.Console("TinyUrl is : " + avatar.GetTinyUrl());
		App42Log.Console("CreatedOn is : " + avatar.GetCreatedOn());
		App42Log.Console("Description is : " + avatar.GetDescription());
		App42Log.Console("Is Current :"+avatar.IsCurrent());
		App42Log.Console("UserName is :"+avatar.GetUserName());	
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var avatarName = "Shephertz Nick",
userName = "Nick",
webURL = "<Enter the WebURL>",
description = "My Profile Pic",
result;
avatarService.createAvatarFromWebURL(avatarName, userName,webURL, description,{  
	success: function(object) 
	{  
		var avatarObj = JSON.parse(object);  
		result = avatarObj.app42.response.avatars.avatar;
		console.log("avatarName is : " + result.name)
		console.log("url is : " + result.url)
		console.log("tinyUrl is : " + result.tinyUrl)
		console.log("createdOn is : " + result.createdOn)
		console.log("Description is :"+result.description);
		console.log("Is Current :"+result.isCurrent);
		console.log("UserName is :"+result.userName);
	},  
	error: function(error) 
	{ 
		console.log("Exception is : " + error)
	}  
});     
Coming Soon
const char* avatarName = "Shephertz Nick";
const char* userName = "Nick";
const char* description = "My Profile Pic";
const char* webUrl = "<Enter the WebURL>";
avatarService->CreateAvatarFromWebURL(avatarName, userName, webUrl, description, this, app42callfuncND_selector(Sample_Class::onAvatarServiceRequestCompleted));
void Sample_Class::onAvatarServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42AvatarResponse *app42AvatarResponse = (App42AvatarResponse*)response;
    
    if(app42AvatarResponse->isSuccess)
    {
        printf("\ncode=%d",app42AvatarResponse->getCode());
        printf("\nisSuccess=%d",app42AvatarResponse->isSuccess);
        printf("\nResponse Body=%s",app42AvatarResponse->getBody().c_str());
        
        for(std::vector<App42Avatar>::iterator it = app42AvatarResponse->avatars.begin(); it != app42AvatarResponse->avatars.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n AvatarName=%s\n",it->name.c_str());
            printf("\n URL=%s\n",it->url.c_str());
            printf("\n CreatedOn=%s\n",it->createdOn.c_str());
            printf("\n Description=%s\n",it->description.c_str());
            printf("\n isCurrent=%d\n",it->isCurrent);
        }
    }
    else
    {
        printf("\nerrordetails:%s",app42AvatarResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42AvatarResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42AvatarResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42AvatarResponse->httpErrorCode);
    }
}
String avatarName = "Shephertz Nick";
String userName = "Nick";
String webURL = "<Enter the WebURL>";
String description = "My Profile Pic";
Avatar avatar = avatarService.CreateAvatarFromWebURL(avatarName, userName,webURL, description);
Console.WriteLine("avatarName is :" + avatar.GetName());
Console.WriteLine("url is :" + avatar.GetURL());
Console.WriteLine("tinyUrl is :" + avatar.GetTinyURL());
Console.WriteLine("createdOn is :" + avatar.GetCreatedOn());
Console.WriteLine("Description is :"+avatar.GetDescription());
Console.WriteLine("Is Current :"+avatar.IsCurrent());
Console.WriteLine("UserName is :"+avatar.GetUserName());
$avatarName = "Shephertz Nick";
$userName = "Nick";
$webURL = "<Enter the WebURL>";
$description = "My Profile Pic";
$avatar = $avatarService->createAvatar($avatarName, $userName, $webURL, $description);
print_r("Avatar name is :  " . $avatar->getName());
print_r("userName is :" . $avatar->getUserName());
print_r("url : " . $avatar->getURL());
print_r("tiny url : " . $avatar->getTinyURL());
print_r("created on : " .$avatar->getCreatedOn());
print_r("description : " . $avatar->getDescription());
print_r("Current is : " . $avatar->isCurrent());
Coming Soon
Coming Soon
var avatarName:String = "Shephertz Nick";
var userName:String = "Nick";
var webURL:String = "<Enter the WebURL>";
var description:String = "My Profile Pic";
avatarService.createAvatarFromWebURL(avatarName,userName,webUrl,description,new callback());
class callback implements App42CallBack  
{  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
	public function onSuccess(response:Object):void  
	{  
		var avatar:Avatar = Avatar(response);
		trace("Avatar success is : "+response)	
		trace("Created On :"+avatar.getCreatedOn());
		trace("Description is :"+avatar.getDescription());
		trace("Avatar Name is:"+avatar.getName());
		trace("Tiny url :"+avatar.getTinyURL());
		trace("Is Current :"+avatar.IsCurrent());
		trace("UserName is :"+avatar.getUserName());
		trace("Url is :"+avatar.getURL());
	}
} 
Coming Soon 

Get Avatar By Name

Get detail description of the avatar.

Required Parameters

avatarName - Name of the avatar which is to fetch. userName - Name of the user for which avatar is 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
String avatarName = "Shephertz Nick";
String userName = "Nick";
avatarService.getAvatarByName(avatarName,userName,new App42CallBack() {
public void onSuccess(Object response)
{
	Avatar avatar = (Avatar)response;
	System.out.println("avatarName is :" + avatar.getName());  
	System.out.println("url is :" + avatar.getURL());  
	System.out.println("tinyUrl is :" + avatar.getTinyURL());  
	System.out.println("createdOn is :" + avatar.getCreatedOn());  
	System.out.println("Description is :"+avatar.getDescription());
	System.out.println("Is Current :"+avatar.isCurrent());
	System.out.println("UserName is :"+avatar.getUserName());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String avatarName = "Shephertz Nick";
String userName = "Nick";
avatarService.GetAvatarByName(avatarName, userName,new Callback());
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Avatar avatar = (Avatar) response;   
		Console.WriteLine("avatarName is :" + avatar.GetName());
		Console.WriteLine("url is :" + avatar.GetURL());
		Console.WriteLine("tinyUrl is :" + avatar.GetTinyURL());
		Console.WriteLine("createdOn is :" + avatar.GetCreatedOn());
		Console.WriteLine("Description is :"+avatar.GetDescription());
		Console.WriteLine("Is Current :"+avatar.IsCurrent());
		Console.WriteLine("UserName is :"+avatar.GetUserName());
	}  
}  
NSString *avatarName = @"Shephertz Nick";
NSString *userName = @"Nick";
Avatar *avatar = [avatarService getAvatarByName:avatarName userName:userName];
NSLog(@"AvatarName  %@",avatar.name);
NSLog(@"tinyUrl is  %@",avatar.tinyUrl);
NSLog(@"UserName is %@",avatar.userName);
NSLog(@"Is Current is %d",avatar.isCurrent);
String avatarName = "Shephertz Nick";
String userName = "Nick";
Avatar avatar = avatarService.getAvatarByName(avatarName, userName);
System.out.println("avatarName is :" + avatar.getName());  
System.out.println("url is :" + avatar.getURL());  
System.out.println("tinyUrl is :" + avatar.getTinyURL());  
System.out.println("createdOn is :" + avatar.getCreatedOn());  
System.out.println("Description is :"+avatar.getDescription());
System.out.println("Is Current :"+avatar.isCurrent());
System.out.println("UserName is :"+avatar.getUserName());
String avatarName = "Shephertz Nick";
String userName = "Nick";
Avatar avatar =  avatarService.getAvatarByName(avatarName, userName);
System.out.println("avatarName is :" + avatar.getName());  
System.out.println("url is :" + avatar.getURL());  
System.out.println("tinyUrl is :" + avatar.getTinyURL());  
System.out.println("createdOn is :" + avatar.getCreatedOn());  
System.out.println("Description is :"+avatar.getDescription());
System.out.println("Is Current :"+avatar.isCurrent());
System.out.println("UserName is :"+avatar.getUserName());
String avatarName = "Shephertz Nick";
String userName = "Nick";
App42Log.SetDebug(true);        //Prints output in your editor console
avatarService.GetAvatarByName(avatarName, userName,new UnityCallBack());
public class UnityCallBack : App42CallBack
{
    public void OnSuccess(object response)
    {
		Avatar avatar = (Avatar) response;   
		App42Log.Console("Avatar Name is : " + avatar.GetName());
		App42Log.Console("Url is : " + avatar.GetUrl());
		App42Log.Console("TinyUrl is : " + avatar.GetTinyUrl());
		App42Log.Console("CreatedOn is : " + avatar.GetCreatedOn());
		App42Log.Console("Description is : " + avatar.GetDescription());
		App42Log.Console("Is Current :"+avatar.IsCurrent());
		App42Log.Console("UserName is :"+avatar.GetUserName());	
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var avatarName = "Shephertz Nick",
userName = "Nick",
result;
avatarService.getAvatarByName(avatarName, userName,{  
	success: function(object) 
	{  
		var avatarObj = JSON.parse(object);  
		result = avatarObj.app42.response.avatars.avatar;
		console.log("avatarName is : " + result.name)
		console.log("url is : " + result.url)
		console.log("tinyUrl is : " + result.tinyUrl)
		console.log("createdOn is : " + result.createdOn)
		console.log("Description is :"+result.description);
		console.log("Is Current :"+result.isCurrent);
		console.log("UserName is :"+result.userName);
	},  
	error: function(error) 
	{ 
		console.log("Exception is : " + error)
	}  
});     
Coming Soon
const char* avatarName = "Shephertz Nick";
const char* userName = "Nick";
avatarService->GetAvatarByName(avatarName, userName, this, app42callfuncND_selector(Sample_Class::onAvatarServiceRequestCompleted));
void Sample_Class::onAvatarServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42AvatarResponse *app42AvatarResponse = (App42AvatarResponse*)response;
    
    if(app42AvatarResponse->isSuccess)
    {
        printf("\ncode=%d",app42AvatarResponse->getCode());
        printf("\nisSuccess=%d",app42AvatarResponse->isSuccess);
        printf("\nResponse Body=%s",app42AvatarResponse->getBody().c_str());
        
        for(std::vector<App42Avatar>::iterator it = app42AvatarResponse->avatars.begin(); it != app42AvatarResponse->avatars.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n AvatarName=%s\n",it->name.c_str());
            printf("\n URL=%s\n",it->url.c_str());
            printf("\n CreatedOn=%s\n",it->createdOn.c_str());
            printf("\n Description=%s\n",it->description.c_str());
            printf("\n isCurrent=%d\n",it->isCurrent);
        }
    }
    else
    {
        printf("\nerrordetails:%s",app42AvatarResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42AvatarResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42AvatarResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42AvatarResponse->httpErrorCode);
    }
}

String avatarName = "Shephertz Nick";
String userName = "Nick";
Avatar avatar = avatarService.GetAvatarByName(avatarName, userName);
Console.WriteLine("avatarName is :" + avatar.GetName());
Console.WriteLine("url is :" + avatar.GetURL());
Console.WriteLine("tinyUrl is :" + avatar.GetTinyURL());
Console.WriteLine("createdOn is :" + avatar.GetCreatedOn());
Console.WriteLine("Description is :"+avatar.GetDescription());
Console.WriteLine("Is Current :"+avatar.IsCurrent());
Console.WriteLine("UserName is :"+avatar.GetUserName());
$avatarName = "Shephertz Nick";
$userName = "Nick";
$avatar = $avatarService->getAvatarByName($avatarName, $userName);
print_r("Avatar name is :  " . $avatar->getName());
print_r("userName is :" . $avatar->getUserName());
print_r("url : " . $avatar->getURL());
print_r("tiny url : " . $avatar->getTinyURL());
print_r("created on : " .$avatar->getCreatedOn());
print_r("description : " . $avatar->getDescription());
print_r("Current is : " . $avatar->isCurrent());
Coming Soon
Coming Soon
var avatarName:String = "Shephertz Nick";
var userName:String = "Nick";	
avatarService.getAvatarByName(avatarName,userName,new callback());
class callback implements App42CallBack  
{  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
	public function onSuccess(response:Object):void  
	{  
		var avatar:Avatar = Avatar(response);
		trace("Avatar success is : "+response)	
		trace("Created On :"+avatar.getCreatedOn());
		trace("Description is :"+avatar.getDescription());
		trace("Avatar Name is:"+avatar.getName());
		trace("Tiny url :"+avatar.getTinyURL());
		trace("Is Current :"+avatar.IsCurrent());
		trace("UserName is :"+avatar.getUserName());
		trace("Url is :"+avatar.getURL());
	}
}
Coming Soon 

Get All Avatars

View all avatars.

Required Parameters

userName - Name of the user who want to get all his avatars.

  • 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";
avatarService.getAllAvatars(userName, new App42CallBack() {
public void onSuccess(Object response) 
{
	ArrayList<Avatar> avatar = (ArrayList<Avatar>)response;
	for(int i=0;i<avatar.size();i++)
	{
	System.out.println("avatarName is :" + avatar.get(i).getName());  
	System.out.println("url is :" + avatar.get(i).getURL());  
	System.out.println("tinyUrl is :" + avatar.get(i).getTinyURL());  
	System.out.println("createdOn is :" + avatar.get(i).getCreatedOn());  
	System.out.println("Description is :"+avatar.get(i).getDescription());
	System.out.println("Is Current :"+avatar.get(i).isCurrent());
	System.out.println("UserName is :"+avatar.get(i).getUserName());
	}
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String userName = "Nick";
avatarService.GetAllAvatars(userName,new Callback());
public class Callback : App42Callback  
{   
	public void OnSuccess(Object response)  
	{ 
		IList<Avatar> avatar = (List<Avatar>) response; 
		for (int i = 0; i < avatar.Count; i++) 
		{
			Console.WriteLine("avatarName is :" + avatar[i].GetName());
			Console.WriteLine("url is :" + avatar[i].GetURL());
			Console.WriteLine("tinyUrl is :" + avatar[i].GetTinyURL());
			Console.WriteLine("createdOn is :" + avatar[i].GetCreatedOn());
			Console.WriteLine("Description is :"+avatar[i].getDescription());
			Console.WriteLine("Is Current :"+avatar[i].isCurrent());
			Console.WriteLine("UserName is :"+avatar[i].getUserName());
		}
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	} 
}  
NSString *userName = @"Nick";
NSArray  *avatarArray = [avatarService getAllAvatarsForUser:userName];
for(Avatar *avatar in avatarArray) 
{  
	NSLog(@"AvatarName  %@",avatar.name);
	NSLog(@"tinyUrl is  %@",avatar.tinyUrl);
	NSLog(@"UserName is %@",avatar.userName);
	NSLog(@"Is Current is %d",avatar.isCurrent);
}
String userName = "Nick";
Vector avatarList = avatarService.getAllAvatars(userName);
for(int i=0;i< avatarList.size();i++)
{
	Avatar avatar = (Avatar) avatarList.elementAt(i);
	System.out.println("avatarName is :" + avatar.getName());
	System.out.println("url is :" + avatar.getURL());
	System.out.println("tinyUrl is :" + avatar.getTinyURL());
	System.out.println("createdOn is :" + avatar.getCreatedOn());
	System.out.println("Description is :"+avatar.getDescription());
	System.out.println("Is Current :"+avatar.isCurrent());
	System.out.println("UserName is :"+avatar.getUserName());
}
String userName = "Nick";
ArrayList<Avatar> avatar = avatarService.getAllAvatars(userName);
for(int i=0;i<avatar.size();i++)
{
	System.out.println("avatarName is :" + avatar.get(i).getName());  
	System.out.println("url is :" + avatar.get(i).getURL());  
	System.out.println("tinyUrl is :" + avatar.get(i).getTinyURL());  
	System.out.println("createdOn is :" + avatar.get(i).getCreatedOn());  
	System.out.println("Description is :"+avatar.get(i).getDescription());
	System.out.println("Is Current :"+avatar.get(i).isCurrent());
	System.out.println("UserName is :"+avatar.get(i).getUserName());
}
String userName = "Nick";
App42Log.SetDebug(true);        //Prints output in your editor console
avatarService.GetAllAvatars(userName,new UnityCallBack());
public class UnityCallBack : App42CallBack
{
    public void OnSuccess(object response)
    {
    	IList<Avatar> avatarList = (IList<Avatar>) response;   
        for(int i=0; i < avatarList.Count; i++)
        {
			App42Log.Console("avatarName is :" + avatar[i].GetName());
			App42Log.Console("url is :" + avatar[i].GetURL());
			App42Log.Console("tinyUrl is :" + avatar[i].GetTinyURL());
			App42Log.Console("createdOn is :" + avatar[i].GetCreatedOn());
			App42Log.Console("Description is :"+avatar[i].getDescription());
			App42Log.Console("Is Current :"+avatar[i].isCurrent());
			App42Log.Console("UserName is :"+avatar[i].getUserName());
        }
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
result;
avatarService.getAllAvatars(userName,{  
	success: function(object) 
	{  
		var avatarObj = JSON.parse(object);  
		result = avatarObj.app42.response.avatars.avatar;
		if(result.length == undefined)
		{
			console.log("avatarName is : " + result.name)
			console.log("url is : " + result.url)
			console.log("tinyUrl is : " + result.tinyUrl)
			console.log("createdOn is : " + result.createdOn)
			console.log("Description is :"+result.description);
			console.log("Is Current :"+result.isCurrent);
			console.log("UserName is :"+result.userName);
		}
			else
			for(var i = 0;i<result.length;i++){
			console.log("avatarName is : " + result[i].name)
			console.log("url is : " + result[i].url)
			console.log("tinyUrl is : " + result[i].tinyUrl)
			console.log("createdOn is : " + result[i].createdOn)
			console.log("Description is :"+result[i].dscription);
			console.log("Is Current :"+result[i].isCurrent);
			console.log("UserName is :"+result[i].userName);
		}
	},  
	error: function(error) 
	{ 
		console.log("Exception is : " + error)
	}  
});     
Coming Soon
const char* userName = "Nick";
avatarService->GetAllAvatars(userName, this, app42callfuncND_selector(Sample_Class::onAvatarServiceRequestCompleted));
void Sample_Class::onAvatarServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42AvatarResponse *app42AvatarResponse = (App42AvatarResponse*)response;
    
    if(app42AvatarResponse->isSuccess)
    {
        printf("\ncode=%d",app42AvatarResponse->getCode());
        printf("\nisSuccess=%d",app42AvatarResponse->isSuccess);
        printf("\nResponse Body=%s",app42AvatarResponse->getBody().c_str());
        
        for(std::vector<App42Avatar>::iterator it = app42AvatarResponse->avatars.begin(); it != app42AvatarResponse->avatars.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n AvatarName=%s\n",it->name.c_str());
            printf("\n URL=%s\n",it->url.c_str());
            printf("\n CreatedOn=%s\n",it->createdOn.c_str());
            printf("\n Description=%s\n",it->description.c_str());
            printf("\n isCurrent=%d\n",it->isCurrent);
        }
    }
    else
    {
        printf("\nerrordetails:%s",app42AvatarResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42AvatarResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42AvatarResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42AvatarResponse->httpErrorCode);
    }
}

String userName = "Nick";
IList<Avatar> avatar = avatarService.GetAllAvatars(userName);
for (int i = 0; i < avatar.Count; i++) 
{
	Console.WriteLine("avatarName is :" + avatar[i].GetName());
	Console.WriteLine("url is :" + avatar[i].GetURL());
	Console.WriteLine("tinyUrl is :" + avatar[i].GetTinyURL());
	Console.WriteLine("createdOn is :" + avatar[i].GetCreatedOn());
	Console.WriteLine("Description is :"+avatar[i].getDescription());
	Console.WriteLine("Is Current :"+avatar[i].isCurrent());
	Console.WriteLine("UserName is :"+avatar[i].getUserName());
}
$userName = "Nick";
$avatar = $avatarService->getAllAvatars($userName);
foreach($avatar as $avatarList)
{
	print_r("Avatar name is :  " . $avatarList->getName());
	print_r("userName : " . $avatarList->getUserName());
	print_r("url : " . $avatarList->getURL());
	print_r("tiny url : " . $avatarList->getTinyURL());
	print_r("created on : " .$avatarList->getCreatedOn());
	print_r("description : " . $avatarList->getDescription());
	print_r("Current is : " . $avatarList->isCurrent());
}
Coming Soon
Coming Soon
var userName:String = "Nick";
avatarService.getAllAvatars(userName,new callback());
class callback implements App42CallBack  
{  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
	public function onSuccess(response:Object):void  
	{  
		if(response is Array)
		{
			trace("Avatar success is Array : "+response)	
			for(var i:int = 0;i < response.length;i++)
			{
				var avatar:Avatar = Avatar(response[i])
				trace("Created On"+avatar.getCreatedOn());
				trace("Description :"+avatar.getDescription());
				trace("Avatar Name"+avatar.getName());
				trace("Tiny url :"+avatar.getTinyURL());
				trace("Is Current :"+avatar.IsCurrent());
				trace("UserName "+avatar.getUserName());
				trace("URL is"+avatar.getURL());
			}
		}
	}
}
Coming Soon 

Get Current Avatar

View the latest avatar uploaded by user.

Required Parameters

userName - Name of the user for which current avatar is 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
String userName = "Nick";
avatarService.getCurrentAvatar(userName, new App42CallBack() {
public void onSuccess(Object response) 
{
	Avatar avatar = (Avatar)response;
	System.out.println("avatarName is :" + avatar.getName());  
	System.out.println("url is :" + avatar.getURL());  
	System.out.println("tinyUrl is :" + avatar.getTinyURL());  
	System.out.println("createdOn is :" + avatar.getCreatedOn());  
	System.out.println("Description is :"+avatar.getDescription());
	System.out.println("Is Current :"+avatar.isCurrent());
	System.out.println("UserName is :"+avatar.getUserName());
}
public void onException(Exception ex)
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String userName = "Nick";
avatarService.GetCurrentAvatar(userName,new Callback());
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Avatar avatar = (Avatar) response;   
		Console.WriteLine("avatarName is :" + avatar.GetName());
		Console.WriteLine("url is :" + avatar.GetURL());
		Console.WriteLine("tinyUrl is :" + avatar.GetTinyURL());
		Console.WriteLine("createdOn is :" + avatar.GetCreatedOn());
		Console.WriteLine("Description is :"+avatar.GetDescription());
		Console.WriteLine("Is Current :"+avatar.IsCurrent());
		Console.WriteLine("UserName is :"+avatar.GetUserName());
	}  
}  
NSString *userName = @"Nick";
Avatar  *avatar = [avatarService getCurrentAvatar:userName];
NSLog(@"AvatarName  %@",avatar.name);
NSLog(@"tinyUrl is  %@",avatar.tinyUrl);
NSLog(@"UserName is %@",avatar.userName);
NSLog(@"Is Current is %d",avatar.isCurrent);
String userName = "Nick";
Avatar avatar = avatarService.getCurrentAvatar(userName);
System.out.println("avatarName is :" + avatar.getName());  
System.out.println("url is :" + avatar.getURL());  
System.out.println("tinyUrl is :" + avatar.getTinyURL());  
System.out.println("createdOn is :" + avatar.getCreatedOn());  
System.out.println("Description is :"+avatar.getDescription());
System.out.println("Is Current :"+avatar.isCurrent());
System.out.println("UserName is :"+avatar.getUserName());
String userName = "Nick";
Avatar avatar =  avatarService.getCurrentAvatar(userName);
System.out.println("avatarName is :" + avatar.getName());  
System.out.println("url is :" + avatar.getURL());  
System.out.println("tinyUrl is :" + avatar.getTinyURL());  
System.out.println("createdOn is :" + avatar.getCreatedOn());  
System.out.println("Description is :"+avatar.getDescription());
System.out.println("Is Current :"+avatar.isCurrent());
System.out.println("UserName is :"+avatar.getUserName());
String userName = "Nick";
App42Log.SetDebug(true);        //Prints output in your editor console
avatarService.GetCurrentAvatar(userName, new UnityCallBack());
public class UnityCallBack : App42CallBack
{
    public void OnSuccess(object response)
    {
        Avatar avatar = (Avatar) response;  
	    App42Log.Console("Avatar Name is : " + avatar.GetName());
		App42Log.Console("Url is : " + avatar.GetUrl());
		App42Log.Console("TinyUrl is : " + avatar.GetTinyUrl());
		App42Log.Console("CreatedOn is : " + avatar.GetCreatedOn());
		App42Log.Console("Description is : " + avatar.GetDescription());
		App42Log.Console("Is Current :"+avatar.IsCurrent());
		App42Log.Console("UserName is :"+avatar.GetUserName());	
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
result;
avatarService.getCurrentAvatar(userName,{  
	success: function(object) 
	{  
		var avatarObj = JSON.parse(object);  
		result = avatarObj.app42.response.avatars.avatar;
		console.log("avatarName is : " + result.name)
		console.log("url is : " + result.url)
		console.log("tinyUrl is : " + result.tinyUrl)
		console.log("createdOn is : " + result.createdOn)
		console.log("Description is :"+result.description);
		console.log("Is Current :"+result.isCurrent);
		console.log("UserName is :"+result.userName);
	},  
	error: function(error) 
	{ 
		console.log("Exception is : " + error)
	}  
});     
Coming Soon
const char* userName = "Nick";
avatarService->GetCurrentAvatar(userName, this, app42callfuncND_selector(Sample_Class::onAvatarServiceRequestCompleted));
void Sample_Class::onAvatarServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42AvatarResponse *app42AvatarResponse = (App42AvatarResponse*)response;
    
    if(app42AvatarResponse->isSuccess)
    {
        printf("\ncode=%d",app42AvatarResponse->getCode());
        printf("\nisSuccess=%d",app42AvatarResponse->isSuccess);
        printf("\nResponse Body=%s",app42AvatarResponse->getBody().c_str());
        
        for(std::vector<App42Avatar>::iterator it = app42AvatarResponse->avatars.begin(); it != app42AvatarResponse->avatars.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n AvatarName=%s\n",it->name.c_str());
            printf("\n URL=%s\n",it->url.c_str());
            printf("\n CreatedOn=%s\n",it->createdOn.c_str());
            printf("\n Description=%s\n",it->description.c_str());
            printf("\n isCurrent=%d\n",it->isCurrent);
        }
    }
    else
    {
        printf("\nerrordetails:%s",app42AvatarResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42AvatarResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42AvatarResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42AvatarResponse->httpErrorCode);
    }
}
String userName = "Nick";
Avatar avatar = avatarService.GetCurrentAvatar(userName);
Console.WriteLine("avatarName is :" + avatar.GetName());
Console.WriteLine("url is :" + avatar.GetURL());
Console.WriteLine("tinyUrl is :" + avatar.GetTinyURL());
Console.WriteLine("createdOn is :" + avatar.GetCreatedOn());
Console.WriteLine("Description is :"+avatar.GetDescription());
Console.WriteLine("Is Current :"+avatar.IsCurrent());
Console.WriteLine("UserName is :"+avatar.GetUserName());
$userName = "Nick";
$avatar = $avatarService->getCurrentAvatar($userName);
print_r("Avatar name is :  " . $avatar->getName());
print_r("userName is :" . $avatar->getUserName());
print_r("url : " . $avatar->getURL());
print_r("tiny url : " . $avatar->getTinyURL());
print_r("created on : " .$avatar->getCreatedOn());
print_r("description : " . $avatar->getDescription());
print_r("Current is : " . $avatar->isCurrent());
Coming Soon
Coming Soon
var userName:String = "Nick";  
avatarService.getCurrentAvatar(userName,new callback());
class callback implements App42CallBack  
{  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
	public function onSuccess(response:Object):void  
	{  
		var avatar:Avatar = Avatar(response);
		trace("Avatar success is : "+response)	
		trace("Created On :"+avatar.getCreatedOn());
		trace("Description is :"+avatar.getDescription());
		trace("Avatar Name is:"+avatar.getName());
		trace("Tiny url :"+avatar.getTinyURL());
		trace("Is Current :"+avatar.IsCurrent());
		trace("UserName is :"+avatar.getUserName());
		trace("Url is :"+avatar.getURL());			
	}
}
Coming Soon 

Change Current Avatar

Change your current avatar from existing avatars in app.

Required Parameters

userName - Name of the user for which avatar is to update. avatarName - Name of the avatar to be 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 avatarName = "Shephertz Nick";
String userName = "Nick";
avatarService.changeCurrentAvatar(userName,avatarName, new App42CallBack() {
public void onSuccess(Object response) 
{
	Avatar avatar = (Avatar)response;
	System.out.println("avatarName is :" + avatar.getName());  
	System.out.println("url is :" + avatar.getURL());  
	System.out.println("tinyUrl is :" + avatar.getTinyURL());  
	System.out.println("createdOn is :" + avatar.getCreatedOn());  
	System.out.println("Description is :"+avatar.getDescription());
	System.out.println("Is Current :"+avatar.isCurrent());
	System.out.println("UserName is :"+avatar.getUserName());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String avatarName = "Shephertz Nick";
String userName = "Nick";
avatarService.ChangeCurrentAvatar(userName,avatarName,new Callback());
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Avatar avatar = (Avatar) response;   
		Console.WriteLine("avatarName is :" + avatar.GetName());
		Console.WriteLine("url is :" + avatar.GetURL());
		Console.WriteLine("tinyUrl is :" + avatar.GetTinyURL());
		Console.WriteLine("createdOn is :" + avatar.GetCreatedOn());
		Console.WriteLine("Description is :"+avatar.GetDescription());
		Console.WriteLine("Is Current :"+avatar.IsCurrent());
		Console.WriteLine("UserName is :"+avatar.GetUserName());
	}  
}  
NSString *avatarName = @"Shephertz Nick";
NSString *userName = @"Nick";
Avatar  *avatar = [avatarService changeCurrentAvatarWithName:avatarName forUser:userName];
NSLog(@"AvatarName  %@",avatar.name);
NSLog(@"tinyUrl is  %@",avatar.tinyUrl);
NSLog(@"UserName is %@",avatar.userName);
NSLog(@"Is Current is %d",avatar.isCurrent);
String avatarName = "Shephertz Nick";
String userName = "Nick";
Avatar avatar = avatarService.changeCurrentAvatar(userName,avatarName);
System.out.println("avatarName is :" + avatar.getName());  
System.out.println("url is :" + avatar.getURL());  
System.out.println("tinyUrl is :" + avatar.getTinyURL());  
System.out.println("createdOn is :" + avatar.getCreatedOn());  
System.out.println("Description is :"+avatar.getDescription());
System.out.println("Is Current :"+avatar.isCurrent());
System.out.println("UserName is :"+avatar.getUserName());
String avatarName = "Shephertz Nick";
String userName = "Nick";
Avatar avatar =  avatarService.changeCurrentAvatar(userName,avatarName);
System.out.println("avatarName is :" + avatar.getName());  
System.out.println("url is :" + avatar.getURL());  
System.out.println("tinyUrl is :" + avatar.getTinyURL());  
System.out.println("createdOn is :" + avatar.getCreatedOn());  
System.out.println("Description is :"+avatar.getDescription());
System.out.println("Is Current :"+avatar.isCurrent());
System.out.println("UserName is :"+avatar.getUserName());
String userName = "Nick";
String avatarName = "Shephertz Nick";
App42Log.SetDebug(true);        //Prints output in your editor console
avatarService.ChangeCurrentAvatar(userName,avatarName, new UnityCallBack());
public class UnityCallBack : App42CallBack
{
    public void OnSuccess(object response)
    {
        Avatar avatar = (Avatar) response;  
        App42Log.Console("Avatar Name is : " + avatar.GetName());
		App42Log.Console("Url is : " + avatar.GetUrl());
		App42Log.Console("TinyUrl is : " + avatar.GetTinyUrl());
		App42Log.Console("CreatedOn is : " + avatar.GetCreatedOn());
		App42Log.Console("Description is : " + avatar.GetDescription());
		App42Log.Console("Is Current :"+avatar.IsCurrent());
		App42Log.Console("UserName is :"+avatar.GetUserName());	
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var avatarName = "Shephertz Nick",
userName = "Nick",
result;
avatarService.changeCurrentAvatar(userName,avatarName,{  
	success: function(object) 
	{  
		var avatarObj = JSON.parse(object);  
		result = avatarObj.app42.response.avatars.avatar;
		console.log("avatarName is : " + result.name)
		console.log("url is : " + result.url)
		console.log("tinyUrl is : " + result.tinyUrl)
		console.log("createdOn is : " + result.createdOn)
		console.log("Description is :"+result.description);
		console.log("Is Current :"+result.isCurrent);
		console.log("UserName is :"+result.userName);	
	},  
	error: function(error) 
	{ 
		console.log("Exception is : " + error)
	}  
});     
Coming Soon
const char* avatarName = "Shephertz Nick";
const char* userName = "Nick";
avatarService->ChangeCurrentAvatar(avatarName, userName, this, app42callfuncND_selector(Sample_Class::onAvatarServiceRequestCompleted));
void Sample_Class::onAvatarServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42AvatarResponse *app42AvatarResponse = (App42AvatarResponse*)response;
    if(app42AvatarResponse->isSuccess)
    {
        printf("\ncode=%d",app42AvatarResponse->getCode());
        printf("\nisSuccess=%d",app42AvatarResponse->isSuccess);
        printf("\nResponse Body=%s",app42AvatarResponse->getBody().c_str());
        
        for(std::vector<App42Avatar>::iterator it = app42AvatarResponse->avatars.begin(); it != app42AvatarResponse->avatars.end(); ++it)
        {
            printf("\n UserName=%s",it->userName.c_str());
            printf("\n AvatarName=%s\n",it->name.c_str());
            printf("\n URL=%s\n",it->url.c_str());
            printf("\n CreatedOn=%s\n",it->createdOn.c_str());
            printf("\n Description=%s\n",it->description.c_str());
            printf("\n isCurrent=%d\n",it->isCurrent);
        }
    }
    else
    {
        printf("\nerrordetails:%s",app42AvatarResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42AvatarResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42AvatarResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42AvatarResponse->httpErrorCode);
    }
}
String avatarName = "Shephertz Nick";
String userName = "Nick";
Avatar avatar = avatarService.ChangeCurrentAvatar(userName,avatarName);
Console.WriteLine("avatarName is :" + avatar.GetName());
Console.WriteLine("url is :" + avatar.GetURL());
Console.WriteLine("tinyUrl is :" + avatar.GetTinyURL());
Console.WriteLine("createdOn is :" + avatar.GetCreatedOn());
Console.WriteLine("Description is :"+avatar.GetDescription());
Console.WriteLine("Is Current :"+avatar.IsCurrent());
Console.WriteLine("UserName is :"+avatar.GetUserName());
$avatarName = "Shephertz Nick";
$userName = "Nick";
$avatar = $avatarService->changeCurrentAvatar($userName,$avatarName);
print_r("Avatar name is :  " . $avatar->getName());
print_r("userName is :" . $avatar->getUserName());
print_r("url : " . $avatar->getURL());
print_r("tiny url : " . $avatar->getTinyURL());
print_r("created on : " .$avatar->getCreatedOn());
print_r("description : " . $avatar->getDescription());
print_r("Current is : " . $avatar->isCurrent());
Coming Soon
Coming Soon
var avatarName:String = "Shephertz Nick";  
var userName:String = "Nick";  
avatarService.changeCurrentAvatar(userName,avatarName,new callback());
class callback implements App42CallBack  
{  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
	public function onSuccess(response:Object):void  
	{  
		var avatar:Avatar = Avatar(response);
		trace("Avatar success is : "+response)	
		trace("Created On :"+avatar.getCreatedOn());
		trace("Description is :"+avatar.getDescription());
		trace("Avatar Name is:"+avatar.getName());
		trace("Tiny url :"+avatar.getTinyURL());
		trace("Is Current :"+avatar.IsCurrent());
		trace("UserName is :"+avatar.getUserName());
		trace("Url is :"+avatar.getURL());			
	}
} 
Coming Soon 

Update Avatar

Updates avatar name and description of existing avatars from app.

Required Parameters

avatarName - Name of the avatar for which you want to update. userName - Name of the user for which you want to update his avatar. newAvatarName - Name of the new avatar. description - Add New description about the avatar or put null to remain old.

  • 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 avatarName = "Shephertz Nick";
String userName = "Nick";
String newAvatarName = "Nick Avatar";
String description = "Description about the avatar";
avatarService.updateAvatar(avatarName, userName,newAvatarName, description,new App42CallBack() {		
public void onSuccess(Object response)
{
	Avatar avatar = (Avatar)response;
	System.out.println("avatarName is :" + avatar.getName());  
	System.out.println("url is :" + avatar.getURL());  
	System.out.println("tinyUrl is :" + avatar.getTinyURL());  
	System.out.println("createdOn is :" + avatar.getCreatedOn());  
	System.out.println("Description is :"+avatar.getDescription());
	System.out.println("Is Current :"+avatar.isCurrent());
	System.out.println("UserName is :"+avatar.getUserName());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());	
}
});
String avatarName = "Shephertz Nick";
String userName = "Nick";
String newAvatarName = "Nick Avatar";
String description = "Description about the avatar";
avatarService.UpdateAvatar(avatarName, userName, newAvatarName,  description, new Callback());
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		Avatar avatar = (Avatar) response;   
		Console.WriteLine("avatarName is :" + avatar.GetName());
		Console.WriteLine("URL is :" + avatar.GetURL());
		Console.WriteLine("tinyUrl is :" + avatar.GetTinyURL());
		Console.WriteLine("createdOn is :" + avatar.GetCreatedOn());
		Console.WriteLine("Description is :"+avatar.GetDescription());
		Console.WriteLine("Is Current :"+avatar.IsCurrent());
		Console.WriteLine("UserName is :"+avatar.GetUserName());
	}  
}  
Not Available
Not Available
String avatarName = "Shephertz Nick";
String userName = "Nick";
String newAvatarName = "Nick Avatar";
String description = "Description about the avatar";
Avatar avatar = avatarService.updateAvatar(avatarName, userName,newAvatarName, description);
System.out.println("avatarName is :" + avatar.getName());  
System.out.println("url is :" + avatar.getURL());  
System.out.println("tinyUrl is :" + avatar.getTinyURL());  
System.out.println("createdOn is :" + avatar.getCreatedOn());  
System.out.println("Description is :"+avatar.getDescription());
System.out.println("Is Current :"+avatar.isCurrent());
System.out.println("UserName is :"+avatar.getUserName());
String avatarName = "Shephertz Nick";
String userName = "Nick";
String newAvatarName = "Nick Avatar";
String description = "Description about the avatar";
App42Log.SetDebug(true);        //Prints output in your editor console
avatarService.UpdateAvatar(avatarName, userName, newAvatarName,  description, new UnityCallBack());
public class UnityCallBack : App42CallBack
{
    public void OnSuccess(object response)
    {
        Avatar avatar = (Avatar) response;  
        App42Log.Console("Avatar Name is : " + avatar.GetName());
		App42Log.Console("URL is : " + avatar.GetUrl());
		App42Log.Console("TinyUrl is : " + avatar.GetTinyUrl());
		App42Log.Console("CreatedOn is : " + avatar.GetCreatedOn());
		App42Log.Console("Description is : " + avatar.GetDescription());
		App42Log.Console("Is Current :"+avatar.IsCurrent());
		App42Log.Console("UserName is :"+avatar.GetUserName());	
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var avatarName = "Shephertz Nick",
userName = "Nick",
newAvatarName = "Nick Avatar",
description = "Description about the avatar",
result;
avatarService.updateAvatar(avatarName, userName,newAvatarName, descriptiopn,{
	success: function(object) {
		var avatarObj = JSON.parse(object);    
		result = avatarObj.app42.response.avatars.avatar;  
		console.log("avatarName is : " + result.name)  
		console.log("url is : " + result.url)  
		console.log("tinyUrl is : " + result.tinyUrl)  
		console.log("createdOn is : " + result.createdOn)  
		console.log("Description is :"+result.dscription);  
		console.log("Is Current :"+result.isCurrent);  
		console.log("UserName is :"+result.userName); 
	},
	error: function(error) {
	}
});   
Coming Soon
Not Available
String avatarName = "Shephertz Nick";
String userName = "Nick";
String newAvatarName = "Nick Avatar";
String description = "Description about the avatar";
Avatar avatar = avatarService.UpdateAvatar(avatarName, userName, newAvatarName,  description);
Console.WriteLine("avatarName is : " + avatar.GetName());
Console.WriteLine("URL is : " + avatar.GetURL());
Console.WriteLine("tinyUrl is : " + avatar.GetTinyURL());
Console.WriteLine("createdOn is : " + avatar.GetCreatedOn());
Console.WriteLine("Description is : "+avatar.GetDescription());
Console.WriteLine("Is Current :"+avatar.IsCurrent());
Console.WriteLine("UserName is : "+avatar.GetUserName());
$avatarName = "Shephertz Nick";
$userName = "Nick";
$newAvatarName = "Nick Avatar";
$description = "Description about the avatar";
$avatar = $avatarService->updateAvatar($avatarName , $userName, $newAvatarName,$description);			
print_r("Avatar name is :  " . $avatar->getName());
print_r("userName is :" . $avatar->getUserName());
print_r("url : " . $avatar->getURL());
print_r("tiny url : " . $avatar->getTinyURL());
print_r("created on : " .$avatar->getCreatedOn());
print_r("description : " . $avatar->getDescription());
print_r("Current is : " . $avatar->isCurrent());
Not Available
Not Available
var avatarName:String = "Shephertz Nick";
var userName:String = "Nick";
var newAvatarName:String = "Nick Avatar";
var description:String = "Description about the avatar";
avatarService.updateAvatar(avatarName,userName,newAvatarName,description,new callback());	
class callback implements App42CallBack  
{  
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception Message " + exception);  
	}  
	public function onSuccess(response:Object):void  
	{  
		var avatar:Avatar = Avatar(response);
		trace("Avatar success is : "+response)	
		trace("Created On :"+avatar.getCreatedOn());
		trace("Description is :"+avatar.getDescription());
		trace("Avatar Name is:"+avatar.getName());
		trace("Tiny url :"+avatar.getTinyURL());
		trace("Is Current :"+avatar.IsCurrent());
		trace("UserName is :"+avatar.getUserName());
		trace("Url is :"+avatar.getURL());
	}
}
Not Available

Delete Avatar By Name

Delete a particular avatar based on name.

Required Parameters

userName - Name of the user who want to delete his/her avatar. avatarName - Name of the avatar to be deleted.

  • 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 avatarName = "Shephertz Nick";
avatarService.deleteAvatarByName(userName,avatarName,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 avatarName = "Shephertz Nick";
avatarService.DeleteAvatarByName(userName, avatarName,  new Callback());
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		App42Response app42Response = (App42Response) response; 
		Console.WriteLine("App42Response is : "+app42Response.ToString());
	}  
}  
Not Available
Not Available
String userName = "Nick";
String avatarName = "Shephertz Nick";
App42Response app42Response = avatarService.deleteAvatarByName(userName,avatarName);
System.out.println("Resposne is : "+ app42Response);
String userName = "Nick";
String avatarName = "Shephertz Nick";
App42Log.SetDebug(true);        //Prints output in your editor console
avatarService.DeleteAvatarByName(userName, avatarName,  new UnityCallBack());
public class UnityCallBack : App42CallBack
{
    public void OnSuccess(object response)
    {
        App42Response app42Response = (App42Response) response; 
		App42Log.Console("App42Response is : "+app42Response.ToString());	
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",
avatarName = "Shephertz Nick",
result;
avatarService.deleteAvatarByName(userName, avatarName,{
	success: function(object) {
		var avatarObj = JSON.parse(object);
		result = avatarObj.app42.response.success;
		console.log("Response is "+result)
	},  
	error: function(error) {  
	}  
});
Coming Soon
Not Available
String userName = "Nick";
String avatarName = "Shephertz Nick";
App42Response app42Response = avatarService.DeleteAvatarByName(userName, avatarName);
Console.WriteLine("App42Response is : "+app42Response.ToString());	
$userName = "Nick";
$avatarName = "Shephertz Nick";
$response = $avatarService->deleteAvatarByName($userName,$avatarName);
print_r("Response is :  ".$response->toString());
$success = $response->isResponseSuccess();
$jsonResponse = $response->toString(); 
Not Available
Not Available
String userName = "Nick";
String avatarName = "Shephertz Nick";
avatarService.deleteAvatarByName(userName, avatarName, 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);  
	}  
} 
Not Available

Delete All Avatar

Delete all avatars of a particular user.

Required Parameters

userName - Name of the user who wants to delete his/her all avatars.

  • 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";
avatarService.deleteAllAvatars(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";
avatarService.DeleteAllAvatars(userName, new Callback());
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		App42Response app42Response = (App42Response) response; 
		Console.WriteLine("App42Response is : "+app42Response.ToString());
	}  
}  
Not Available
Not Available
String userName = "Nick";
App42Response app42Response = avatarService.deleteAllAvatars(userName);
System.out.println("Resposne is : "+ app42Response);
String userName = "Nick";
App42Log.SetDebug(true);        //Prints output in your editor console
avatarService.DeleteAllAvatars(userName, new UnityCallBack());
public class UnityCallBack : App42CallBack
{
    public void OnSuccess(object response)
    {
        App42Response app42Response = (App42Response) response; 
		App42Log.Console("App42Response is : "+app42Response.ToString());	
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
var userName = "Nick",
result;
avatarService.deleteAllAvatars(userName,{
	success: function(object) {
		var avatarObj = JSON.parse(object);
		result = avatarObj.app42.response.success;
		console.log("Response is "+result)
	},  
	error: function(error) {  
	}  
});   
Coming Soon
Not Available
String userName = "Nick";
App42Response app42Response = avatarService.DeleteAllAvatars(userName);
Console.WriteLine("App42Response is : "+app42Response.ToString());	
$userName = "Nick";
$response = $avatarService->deleteAllAvatars($userName);
print_r("Response is :  ".$response->toString());
$success = $response->isResponseSuccess();
$jsonResponse = $response->toString(); 
Not Available
Not Available
String userName = "Nick";
avatarService.deleteAllAvatars(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);  
	}  
} 
Not Available

Exception Handling

The functions available under Avatar 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 the avatar name that already exist in the database, the function will throw the App42Exception (as shown below) with the message as “Bad Request” and the appErrorCode as “4701” and the details as “The Request parameters are invalid. Avatar by the name ‘Shephertz 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 avatarName = "Shephertz Nick";
String userName = "Nick";
String filePath = "Your File Path";
String description = "My Profile Pic";		
avatarService.createAvatar(avatarName,userName,filePath, description, new App42CallBack() {		
public void onSuccess(Object response) 
{
	Avatar avatar = (Avatar)response;
	System.out.println("avatarName is :" + avatar.getName());  
	System.out.println("url is :" + avatar.getURL());  
	System.out.println("tinyUrl is :" + avatar.getTinyURL());  
	System.out.println("createdOn is :" + avatar.getCreatedOn());  
	System.out.println("Description is :"+avatar.getDescription());
	System.out.println("Is Current :"+avatar.isCurrent());
	System.out.println("UserName is :"+avatar.getUserName());
}

public void onException(Exception ex) 
{
	App42Exception exception = (App42Exception)ex;
	int appErrorCode = exception.getAppErrorCode();
	int httpErrorCode = exception.getHttpErrorCode();
	if(appErrorCode == 4701)
	{
	// Handle here for Bad Request (The Request parameters are invalid. Avatar by the name 'Shephertz Nick' 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 avatarName = "Shephertz Nick";
String userName = "Nick";
String filePath = "Your File Path";
String description = "My Profile Pic";	
avatarService.CreateAvatar(avatarName, userName,filePath, description,new Callback());
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
		int appErrorCode = exception.GetAppErrorCode();
		int httpErrorCode = exception.GetHttpErrorCode();
		if(appErrorCode == 4701)
		{
			// Handle here for Bad Request (The Request parameters are invalid. Avatar by the name 'Shephertz Nick' already exists.)
		}
		else if(appErrorCode == 1401)
		{
			// handle here for Client is not authorized
		}
		else if(appErrorCode == 1500)
		{
			// handle here for Internal Server Error
		}
		String jsonText = exception.GetMessage(); 
	}  
	public void OnSuccess(Object response)  
	{ 
		Avatar avatar = (Avatar) response;
		String jsonResponse = avatar.ToString();  
	} 
}  
NSString *avatarName = @"Shephertz Nick";
NSString *userName = @"Nick";
NSString *filePath = @"Your File Path";
NSString *description = @"My Profile Pic";
@try
{
	Avatar *avatar = [avatarService createAvatarWithName:avatarName userName:userName filePath:filePath description:description];
}
@catch(App42Exception exception) 
{
	int appErrorCode = exception.appErrorCode;
	int httpErrorCode = exception.httpErrorCode;
	if(appErrorCode == 4701)
	{
		// Handle here for Bad Request (The Request parameters are invalid. Avatar by the name 'Shephertz Nick' 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 avatarName = "Shephertz Nick";
String userName = "Nick";
String filePath = "Your File Path";
String description = "My Profile Pic";		
try
{
	Avatar avatar =  avatarService.createAvatar(avatarName, userName,filePath, description);
} 
catch(App42Exception exception)
{
	int appErrorCode = exception.getAppErrorCode();
	int httpErrorCode = exception.getHttpErrorCode();
	if(appErrorCode == 4701)
	{
		// Handle here for Bad Request (The Request parameters are invalid. Avatar by the name 'Shephertz Nick' 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 avatarName = "Shephertz Nick";
String userName = "Nick";
String filePath = "Your File Path";
String description = "My Profile Pic";		
try
{
	Avatar avatar =  avatarService.createAvatar(avatarName, userName,filePath, description);
} 
catch(App42Exception exception)
{
	int appErrorCode = exception.getAppErrorCode();
	int httpErrorCode = exception.getHttpErrorCode();
	if(appErrorCode == 4701)
	{
		// Handle here for Bad Request (The Request parameters are invalid. Avatar by the name 'Shephertz Nick' 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 avatarName = "Shephertz Nick";
String userName = "Nick";
String filePath = "Your File Path";
String description = "My Profile Pic";
App42Log.SetDebug(true);        //Prints output in your editor console
avatarService.CreateAvatar(avatarName, userName, filePath, description,new UnityCallBack());
public class UnityCallBack : App42CallBack
{
    
	public void OnException(Exception e)
	{
	    App42Exception exception = (App42Exception)e;
		int appErrorCode = exception.GetAppErrorCode();
    	int httpErrorCode = exception.GetHttpErrorCode();
		if(appErrorCode == 4701)
		{
			// Handle here for Bad Request (The Request parameters are invalid. Avatar by the name 'Shephertz Nick' already exists.)
		}
    		else if(appErrorCode == 1401)
		{
			// handle here for Client is not authorized
		}
		else if(appErrorCode == 1500)
		{
			// handle here for Internal Server Error
		}
		String jsonText = exception.GetMessage(); 
	}
	public void OnSuccess(object response)
	{  
		Avatar avatar = (Avatar) response;
		String jsonResponse = avatar.ToString();  
	}  
}
var avatarName = "Shephertz Nick",
userName = "Nick",
filePath = "Your File Path",
description = "My Profile Pic",	
appErrorCode;
avatarService.createAvatar(avatarName,userName,filePath, description,{
	success: function(object) {
	},
	error: function(error) {
		var avatarObj = JSON.parse(error);
		appErrorCode = avatarObj.app42Fault.appErrorCode;
		if(appErrorCode == 4701)
		{
			// Handle here for Bad Request (The Request parameters are invalid. Avatar by the name 'Shephertz Nick' 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
const char* avatarName = "Shephertz Nick";
const char* userName = "Nick";
const char* filePath = "Your File Path";
const char* description = "My Profile Pic";
avatarService->CreateAvatar(avatarName, userName, filePath, description, this, app42callfuncND_selector(Sample_Class::onAvatarServiceRequestCompleted));

void Sample_Class::onAvatarServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42AvatarResponse *app42AvatarResponse = (App42AvatarResponse*)response;
    
    if(app42AvatarResponse->isSuccess)
    {
        //Handle your success response here.
    }
    else
    {
        printf("\nerrordetails:%s",app42AvatarResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42AvatarResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42AvatarResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42AvatarResponse->httpErrorCode);
        
        int appErrorCode = app42AvatarResponse->appErrorCode;
	    int httpErrorCode = app42AvatarResponse->httpErrorCode;
		if(appErrorCode == 4701)
		{
			// Handle here for Bad Request (The Request parameters are invalid. Avatar by the name 'Shephertz Nick' already exists.)
		}
		else if(appErrorCode == 1401)
		{
			// handle here for Client is not authorized
		}
		else if(appErrorCode == 1500)
		{
			// handle here for Internal Server Error
		}
    }
}
String avatarName = "Shephertz Nick";
String userName = "Nick";
String filePath = "Your File Path";
String description = "My Profile Pic";		
try
{
	Avatar avatar =  avatarService.CreateAvatar(avatarName, userName,filePath, description);
} 
catch(App42Exception exception)
{
	int appErrorCode = exception.GetAppErrorCode();
	int httpErrorCode = exception.GetHttpErrorCode();
	if(appErrorCode == 4701)
	{
		// Handle here for Bad Request (The Request parameters are invalid. Avatar by the name 'Shephertz Nick' 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(); 
}        
$avatarName = "Shephertz Nick";
$userName = "Nick";
$filePath = "Your File Path";
$description = "My Profile Pic";	
try
{
	$response = $avatarService->createAvatar($avatarName, $userName,$filePath, $description);
} 
catch(App42Exception $ex) 
{
	$appErrorCode = $ex->getAppErrorCode();
	$httpErrorCode = $ex->getHttpErrorCode();
	if($appErrorCode == 4701)
	{
		// Handle here for Bad Request (The Request parameters are invalid. Avatar by the name 'Shephertz Nick' already exists.)
	}
	else if($appErrorCode == 1401){
		// handle here for Client is not authorized
	}
	else if($appErrorCode == 1500){
		// handle here for Internal Server Error
	}	
	$jsonText = $ex->getMessage(); 	
}   
Coming Soon
Coming Soon
var avatarName:String = "Shephertz Nick";  
var userName:String = "Nick";  
var accessToken:String = "<Enter Your Facebook Access Token>";  
var description:String = "My Profile Pic";  
avatarService.createAvatarFromFacebook(avatarName,userName, accessToken, description,new callback());  
class callback implements App42CallBack    
{   
	public function onException(exception:App42Exception):void    
	{  
		var appErrorCode:int = exception.getAppErrorCode();  
		var httpErrorCode:int = exception.getHttpErrorCode();  
		if(appErrorCode == 4701)
		{
			// Handle here for Bad Request (The Request parameters are invalid. Avatar by the name 'Shephertz Nick' already exists.)
		}
		else if(appErrorCode == 1401)
		{
			// handle here for Client is not authorized
		}
		else if(appErrorCode == 1500)
		{
			// handle here for Internal Server Error
		}
	}  	  
    public function onSuccess(response:Object):void    
    {    
        var avatar:Avatar = Avatar(response);  
        trace("resonse is: " + avatar) 
    }  
}
Coming Soon

Error Codes

Functions in Avatar 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 4701 - BAD REQUEST - The Request parameters are invalid. Avatar by the name '@avatarName' already exists. 4702 - NOT FOUND - User by the name '@userName' does not have any avatar. 4703 - NOT FOUND - User by the name '@userName' avatar '@avatarName'does not exists. 4704 - BAD REQUEST - The Facebook Access Credentials are invalid. + &lt;Received Facebook Exception Message&gt;. 4705 - BAD REQUEST - Given URL is invalid.