Social Integration Service

Social connect with Facebook, Twitter, LinkedIn etc to post, update, invite, fetch, refer etc.

Import Statement
  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for Swift
  • 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.social.Social;
import com.shephertz.app42.paas.sdk.android.social.SocialService;
using com.shephertz.app42.paas.sdk.windows;  
using com.shephertz.app42.paas.sdk.windows.social;   
#import "Shephertz_App42_iOS_API/Shephertz_App42_iOS_API.h"   
#import "Shephertz_App42_iOS_API/Shephertz_App42_iOS_API.h"
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.social.Social;
import com.shephertz.app42.paas.sdk.java.social.SocialService;
using com.shephertz.app42.paas.sdk.csharp;  
using com.shephertz.app42.paas.sdk.csharp.social;
<script type="text/javascript" src="App42-all-x.x.x.min.js">
local App42API = require("App42-Lua-API.App42API")
#include "App42API.h"
using com.shephertz.app42.paas.sdk.csharp;  
using com.shephertz.app42.paas.sdk.csharp.social;  
 
include_once '../App42Response.php';  
include_once '../App42Exception.php';  
include_once '../App42BadParameterException.php';  
include_once '../App42NotFoundException.php'; 
include_once '../SocialService.php';
include_once '../App42Log.php';   
#include "App42API.h"
require 'App42_Ruby_API'
import com.shephertz.app42.paas.sdk.as3.App42API;
import com.shephertz.app42.paas.sdk.as3.App42Response;
import com.shephertz.app42.paas.sdk.as3.App42Exception;
import com.shephertz.app42.paas.sdk.as3.App42BadParameterException;
import com.shephertz.app42.paas.sdk.as3.App42NotFoundException;
import com.shephertz.app42.paas.sdk.as3.social.Social;
import com.shephertz.app42.paas.sdk.as3.social.SocialService;
Not Available
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.social.Social;
import com.shephertz.app42.paas.sdk.jme.social.SocialService;
Initialize

In order to use the various functions available in a specific API, the developer has to initialize with App42API by passing the apiKey and the secretKey which will become available 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 Swift
  • 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.initializeWithAPIKey("API_KEY", andSecretKey:"SECRET_KEY")        
App42API.initialize("API_KEY","SECRET_KEY");
App42API.Initialize("API_KEY","SECRET_KEY");
App42.initialize("API_KEY","SECRET_KEY");
App42API:initialize("API_KEY","SECRET_KEY");
App42API::Initialize("API_KEY", "SECRET_KEY");
App42API.Initialize("API_KEY","SECRET_KEY");
App42API::initialize("API_KEY","SECRET_KEY"); 
App42API::Initialize("API_KEY", "SECRET_KEY");
api = App42::ServiceAPI.new("API_KEY","SECRET_KEY")   
App42API.initialize("API_KEY","SECRET_KEY");
Coming Soon
App42API.initialize("API_KEY","SECRET_KEY");
Build Service

After initialization, the developer will have to call the buildXXXService method on App42API to get the instance of the particular API that they wish to build. For example, to build an instance of Social Service, buildSocialService() method needs to be called.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for Swift
  • 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
SocialService socialService = App42API.buildSocialService(); 
SocialService socialService = App42API.BuildSocialService();  
SocialService *socialService = [App42API buildSocialService]; 
let socialService = App42API.buildSocialService as! SocialService
SocialService socialService = App42API.buildSocialService(); 
SocialService socialService = App42API.BuildSocialService(); 
var socialService  = new App42Social();
local socialService  = App42API:buildSocialService()
SocialService *socialService = App42API::BuildSocialService();
SocialService socialService = App42API.BuildSocialService(); 
$socialService = App42API::buildSocialService();
SocialService *socialService = App42API::BuildSocialService();
social_service = api.build_social_service()
var socialService:SocialService = App42API.buildSocialService(); 
Not Available
SocialService socialService = App42API.buildSocialService(); 
Update Facebook Status

Update the Facebook status of the specified user.

Required Parameters

userName - Name of the user for whom the status needs to be updated. status - Status that has to be updated.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for Swift
  • 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 status = "Nick is using the App42 API";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
socialService.updateFacebookStatus(userName, status, new App42CallBack() {
public void onSuccess(Object response) 
{
	Social social  = (Social)response;
	System.out.println("userName is " + social.getUserName());  
	System.out.println("status is " + social.getStatus()); 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});       
String userName = "Nick";                  
String status = "Nick is using the App42 API";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService();
socialService.UpdateFacebookStatus(userName, status, new Callback());  
public class Callback : App42Callback  
{   
	public void OnSuccess(Object response)  
	{  
		Social social = (Social) response;    
		Console.WriteLine("userName is" + social.GetUserName()); 
		Console.WriteLine("status is" + social.GetStatus()); 
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	} 
}  
	
NSString *userName = @"Nick";                 
NSString *status = @"Nick is using the App42 API";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
SocialService *socialService = [App42API buildSocialService]; 
[socialService updateFacebookStatus:userName status:status completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		Social *social =  (Social*)responseObj;
		NSLog(@"userName is %@",social.userName);
		NSLog(@"status is %@",social.status);
		NSString *jsonResponse = [social toString];
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
let userName = "Nick"                 
let status = "Nick is using the App42 API"
App42API.initializeWithAPIKey("API_KEY", andSecretKey: "SECRET_KEY")
let socialService = App42API.buildSocialService as! SocialService
socialService?.updateFacebookStatus(userName, status:status,completionBlock:{ (success, response, exception) -> Void in 
	if (success)
	{
		let social = response as! Social
		NSLog("userName is %@",social.userName)
		NSLog("status is %@",social.status)
		NSLog("Response String is %@", social.strResponse)
	}
	else
	{
		NSLog("%@", exception.reason!)
        NSLog("%d", exception.appErrorCode)
        NSLog("%d", exception.httpErrorCode)
        NSLog("%@", exception.userInfo!)
	}
})
String userName = "Nick";                 
String status = "Nick is using the App42 API";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
Social social = socialService.updateFacebookStatus(userName, status); 
System.out.println("userName is " + social.getUserName());  
System.out.println("status is " + social.getStatus()); 
String jsonResponse = social.toString();    
String userName = "Nick";                
String status = "Nick is using the App42 API";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
App42Log.SetDebug(true);		//Print output in your editor console
socialService.UpdateFacebookStatus(userName, status, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Social social = (Social) response;    
		App42Log.Console("userName is" + social.GetUserName()); 
		App42Log.Console("status is" + social.GetStatus()); 
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",              
status = "Nick is using the App42 API",
social ;
App42.initialize("API_KEY","SECRET_KEY");
var socialService  = new App42Social();
socialService.updateFacebookStatus(userName, status,{
	success: function(object) {
	var response = JSON.parse(object);  
		social = response.app42.response.social;
		console.log("userName is " + social.userName)
		console.log("status is " + social.status)
	},
	error: function(error) {
	}
});
local userName = "Nick"
local status = "Nick is using the App42 API"
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local socialService  = App42API:buildSocialService()
socialService:updateFacebookStatus(userName, status,App42CallBack)
function App42CallBack:onSuccess(object)
	print("userName is " ..object:getUserName()); 
	print("status is " ..object:getStatus());     
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
const char* status = "Nick is using the App42 API";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->UpdateFacebookStatus(userName, status, app42callback(Sample_Class::onSocialServiceRequestCompleted, this));
void Sample_Class::onSocialServiceRequestCompleted(void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
        printf("\nUserName=%s",app42SocialResponse->social.getUserName().c_str());
        printf("\nStatus=%s",app42SocialResponse->social.getStatus().c_str());
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
String userName = "Nick";                
String status = "Nick is using the App42 API";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
Social social = socialService.UpdateFacebookStatus(userName, status); 
Console.WriteLine("userName is" + social.GetUserName()); 
Console.WriteLine("status is" + social.GetStatus()); 
String jsonResponse = social.ToString();         
$userName = "Nick";              
$status = "Nick is using the App42 API";
App42API::initialize("API_KEY","SECRET_KEY");
$socialService = App42API::buildSocialService();
$social = $socialService->updateFacebookStatus($userName, $status); 
Print_r("userName is" . $social->getUserName());
Print_r("status is" . $social->getStatus());
$jsonResponse = $social->toString();
const char* userName = "Nick";
const char* status = "Nick is using the App42 API";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->UpdateFacebookStatus(userName, status, this, app42callfuncND_selector(Sample_Class::onSocialServiceRequestCompleted));
void Sample_Class::onSocialServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
        printf("\nUserName=%s",app42SocialResponse->social.getUserName().c_str());
        printf("\nStatus=%s",app42SocialResponse->social.getStatus().c_str());
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
user_name = "Nick";
status = "Nick is using the App42 API";					
api = App42::ServiceAPI.new("API_KEY","SECRET_KEY")  
social_service = api.build_social_service()
social = social_service.update_facebook_status(user_name, status);
puts "userName is #{social.user_name}";
json_response = social.to_s();
var userName:String = "Nick";                  
var status:String = "Nick is using the App42 API";
App42API.initialize("API_KEY","SECRET_KEY");
var socialService:SocialService = App42API.buildSocialService(); 
socialService.updateFacebookStatus(userName,status, new callback());  
public class callback implements App42CallBack  
{   
	public function onSuccess(response:Object):void  
	{  
		var social:Social = Social(response);
		trace("userName is " + social.getUserName());
		trace("status is " + social.getStatus());
	}  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	} 
}  
Not Available
String userName = "Nick";                       
String status = "Nick is using the App42 API";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
Social social = socialService.updateFacebookStatus(userName, status); 
System.out.println("userName is " + social.getUserName());
System.out.println("fb Access Token is " + social.getStatus());
String jsonResponse = social.toString();    
Get Facebook Friends Of User

This function returns a list of Facebook friends of the specified user by accessing their Facebook account. That user first has to link their app account to their Facebook profile.

Required Parameters

userName - Name of the user whose Facebook friends has to be retrieved.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for Swift
  • 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";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
socialService.getFacebookFriendsFromLinkUser(userName, new App42CallBack() {
public void onSuccess(Object response) 
{
	Social social  = (Social)response;
	System.out.println("userName is " + social.getUserName());
	for(int i =0; i < social.getFriendList().size();i++)
	{
		System.out.println("Installed is : " + social.getFriendList().get(i).getInstalled());
		System.out.println("Id is : " + social.getFriendList().get(i).getId());
		System.out.println("Picture is :" + social.getFriendList().get(i).getPicture());
		System.out.println("Name is : " + social.getFriendList().get(i).getName());
	}
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});     
String userName = "Nick";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService();
socialService.GetFacebookFriendsFromLinkUser(userName, new Callback());  
public class Callback : App42Callback  
{  
	public void OnSuccess(Object response)  
	{  
		Social social = (Social) response;    
		Console.WriteLine("userName is" + social.GetUserName());
		for(int i =0; i < social.GetFriendList().Count;i++)
		{
			Console.WriteLine("Installed is : " + social.GetFriendList()[i].GetInstalled());
			Console.WriteLine("Id is : " + social.GetFriendList()[i].GetId());
			Console.WriteLine("Name is : " + social.GetFriendList()[i].GetName());
		}     
	} 
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}   
}  
	
NSString *userName = @"Nick";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
SocialService *socialService = [App42API buildSocialService]; 
[socialService getFacebookFriendsFromLinkUser:userName completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		Social *social =  (Social*)responseObj;
		NSLog(@"UserName = %@",social.userName);
		for (Friends *friend in social.friendsList)
		{
			NSLog(@"Name=%@",friend.name);
			NSLog(@"Picture=%@",friend.picture);
			NSLog(@"Id=%@",friend.friendId);
			NSLog(@"Installed=%d",friend.installed);
		}
		NSString *jsonResponse = [social toString];
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
let  userName = "Nick"
App42API.initializeWithAPIKey("API_KEY", andSecretKey: "SECRET_KEY")
let socialService = App42API.buildSocialService as! SocialService
socialService?.getFacebookFriendsFromLinkUser(userName,completionBlock:{ (success, response, exception) -> Void in 
	if (success)
	{
		let social = response as! Social
		NSLog("UserName = %@",social.userName);
		for friend in social.friendsList
		{
			NSLog("Name=%@",friend.name)
			NSLog("Picture=%@",friend.picture)
			NSLog("Id=%@",friend.friendId)
			NSLog("Installed=%d",friend.installed)
		}
		NSLog("Response String is %@", social.strResponse)
	}
	else
	{
		NSLog("%@", exception.reason!)
        NSLog("%d", exception.appErrorCode)
        NSLog("%d", exception.httpErrorCode)
        NSLog("%@", exception.userInfo!)
	}
})
String userName = "Nick";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
Social social = socialService.getFacebookFriendsFromLinkUser(userName); 
System.out.println("userName is " + social.getUserName());
for(int i =0; i < social.getFriendList().size();i++)
{
	System.out.println("Installed is : " + social.getFriendList().get(i).getInstalled());
	System.out.println("Id is : " + social.getFriendList().get(i).getId());
	System.out.println("Picture is :" + social.getFriendList().get(i).getPicture());
	System.out.println("Name is : " + social.getFriendList().get(i).getName());
}    
String userName = "Nick";   
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
socialService.GetFacebookFriendsFromLinkUser(userName, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Social social = (Social) response;    
		App42Log.Console("userName is" + social.GetUserName());
		for(int i =0; i < social.GetFriendList().Count;i++)
		{
			App42Log.Console("Installed is : " + social.GetFriendList()[i].GetInstalled());
			App42Log.Console("Id is : " + social.GetFriendList()[i].GetId());
			App42Log.Console("Name is : " + social.GetFriendList()[i].GetName());
		}     
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",    
social;
App42.initialize("API_KEY","SECRET_KEY");
var socialService  = new App42Social();
socialService.getFacebookFriendsFromLinkUser(userName,{
	success: function(object) {
	var response = JSON.parse(object);  
		social = response.app42.response.social;
		console.log("userName is " + social.userName)
	},
	error: function(error) {
	}
});
local userName = "Nick"
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local socialService  = App42API:buildSocialService()
socialService:getFacebookFriendsFromLinkUser(userName,App42CallBack)
function App42CallBack:onSuccess(object)
	print("userName is " ..object:getUserName()); 
	for m=1,table.getn(object:getFriendList()) do
		print(object:getFriendList()[m]:getInstalled())
		print("Id is : " ..object:getFriendList()[m]:getId());  
		print("Picture is :" ..object:getFriendList()[m]:getPicture());  
		print("Name is : " ..object:getFriendList()[m]:getName());  
	end    
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->GetFacebookFriendsFromLinkUser(userName, app42callback(Sample_Class::onSocialServiceRequestCompleted, this));
void Sample_Class::onSocialServiceRequestCompleted(void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
        printf("\nUserName=%s",app42SocialResponse->social.getUserName().c_str());        
        /**
         * Getting friends
         */
        vector<App42Friend> friends = app42SocialResponse->friendsList;
        for(std::vector<App42Friend>::iterator it = friends.begin(); it != friends.end(); ++it)
        {
            printf("\nFriendId=%s",it->getFriendId().c_str());
            printf("\nName=%s\n",it->getName().c_str());
            printf("\nPictureUrl=%s\n",it->getPicture().c_str());
            printf("\nInstalled=%d\n",it->getInstalled());
        }
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
String userName = "Nick";   
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
Social social = socialService.GetFacebookFriendsFromLinkUser(userName);   
Console.WriteLine("userName is" + social.GetUserName());
for(int i =0; i < social.GetFriendList().Count;i++)
{
	Console.WriteLine("Installed is : " + social.GetFriendList()[i].GetInstalled());
	Console.WriteLine("Id is : " + social.GetFriendList()[i].GetId());
	Console.WriteLine("Name is : " + social.GetFriendList()[i].GetName());
}     
$userName = "Nick";
App42API::initialize("API_KEY","SECRET_KEY");
$socialService = App42API::buildSocialService();
$social = $socialService->getFacebookFriendsFromLinkUser($userName); 
print_r("userName is" . $social->getUserName());
$friendList = $social->getFriendslist();
foreach ($friendList as $friends) 
{
	print_r("Friend Name : ".$friends->getName());
	print_r("Id : ".$friends->getId());
	print_r("Picture is : ".$friends->getPicture());
	print_r("Installed is : " . $friends->getInstalled());
}
$jsonResponse = $social->toString();
const char* userName = "Nick";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->GetFacebookFriendsFromLinkUser(userName, this, app42callfuncND_selector(Sample_Class::onSocialServiceRequestCompleted));
void Sample_Class::onSocialServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
        printf("\nUserName=%s",app42SocialResponse->social.getUserName().c_str());        
        /**
         * Getting friends
         */
        vector<App42Friend> friends = app42SocialResponse->friendsList;
        for(std::vector<App42Friend>::iterator it = friends.begin(); it != friends.end(); ++it)
        {
            printf("\nFriendId=%s",it->getFriendId().c_str());
            printf("\nName=%s\n",it->getName().c_str());
            printf("\nPictureUrl=%s\n",it->getPicture().c_str());
            printf("\nInstalled=%d\n",it->getInstalled());
        }
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
Not Available
var userName:String = "Nick";  
App42API.initialize("API_KEY","SECRET_KEY");
var socialService:SocialService = App42API.buildSocialService(); 
socialService.getFacebookFriendsFromLinkUser(userName, new callback());  
public class callback implements App42CallBack  
{   
	public function onSuccess(response:Object):void  
	{  
		var social:Social = Social(response);
		trace("userName is " + social.getUserName());
		if(social.getFriendList().length > 0){
			for(var i:int=0;i<social.getFriendList().length;i++){
				trace("Name is : " + Friends(social.getFriendList()[i]).getName());
				trace("Id is " + Friends(social.getFriendList()[i]).getId());
				trace("Picture is " + Friends(social.getFriendList()[i]).getPicture());
				trace("Installed is " + Friends(social.getFriendList()[i]).getInstalled());
			}
		}
	} 
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
}  
Not Available
String userName = "Nick";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
Social social = socialService.getFacebookFriendsFromLinkUser(userName); 
System.out.println("userName is " + social.getUserName());
Vector friendList = social.getFriendList();   
for(int i=0;i < friendList.size();i++)  
{ 
	Social.Friends friend = (Social.Friends)friendList.elementAt(i);  
	System.out.println("Installed is : " + friend.getInstalled());
	System.out.println("Id is : " + friend.getId());
	System.out.println("Name is : " + friend.getName());
}         
Get Facebook Friends From AccessToken

This function returns a list of Facebook friends of the specified user using a given authorization token.

Required Parameters

accessToken - Facebook Access Token that has been received after authorization.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for Swift
  • 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 accessToken = "<Enter Facebook Access Token>";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
socialService.getFacebookFriendsFromAccessToken(accessToken, new App42CallBack() {
public void onSuccess(Object response) 
{
	Social social  = (Social)response;
	System.out.println("accessToken is " + social.getFacebookAccessToken());
	for(int i =0; i < social.getFriendList().size();i++)
	{
		System.out.println("Installed is : " + social.getFriendList().get(i).getInstalled());
		System.out.println("Id is : " + social.getFriendList().get(i).getId());
		System.out.println("Picture is :" + social.getFriendList().get(i).getPicture());
		System.out.println("Name is : " + social.getFriendList().get(i).getName());
	}
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});    
      
String accessToken = "<Enter Facebook Access Token>";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService();
socialService.GetFacebookFriendsFromAccessToken(accessToken, new Callback());  
public class Callback : App42Callback  
{     
	public void OnSuccess(Object response)  
	{  
		Social social = (Social) response;    
		Console.WriteLine("accessToken is" + social.GetFacebookAccessToken()); 
		Console.WriteLine("userName is" + social.GetUserName());
		for(int i =0; i < social.GetFriendList().Count;i++)
		{
			Console.WriteLine("Installed is : " + social.GetFriendList()[i].GetInstalled());
			Console.WriteLine("Id is : " + social.GetFriendList()[i].GetId());
			Console.WriteLine("Name is : " + social.GetFriendList()[i].GetName());
		}     
	}        
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	} 
}  
	  
NSString *accessToken = @"<Enter Facebook Access Token>";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
SocialService *socialService = [App42API buildSocialService]; 
[socialService getFacebookFriendsFromAccessToken:accessToken completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		Social *social =  (Social*)responseObj;
		for (Friends *friend in social.friendsList)
		{
			NSLog(@"Name=%@",friend.name);
			NSLog(@"Picture=%@",friend.picture);
			NSLog(@"Id=%@",friend.friendId);
			NSLog(@"Installed=%d",friend.installed);
		}
		NSString *jsonResponse = [social toString];
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
let accessToken = "<Enter Facebook Access Token>"
App42API.initializeWithAPIKey("API_KEY", andSecretKey: "SECRET_KEY")
let socialService = App42API.buildSocialService as! SocialService
socialService?.getFacebookFriendsFromAccessToken(accessToken,completionBlock:{ (success, response, exception) -> Void in 
if (success)
	{
		let social = response as! Social
		for friend in social.friendsList
		{
			NSLog("Name=%@",friend.name)
			NSLog("Picture=%@",friend.picture)
			NSLog("Id=%@",friend.friendId)
			NSLog("Installed=%d",friend.installed)
		}
		NSLog("Response String is %@", social.strResponse)
	}
	else
	{
		NSLog("%@", exception.reason!)
        NSLog("%d", exception.appErrorCode)
        NSLog("%d", exception.httpErrorCode)
        NSLog("%@", exception.userInfo!)
	}
})
String accessToken = "<Enter Facebook Access Token>";            
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
Social social = socialService.getFacebookFriendsFromAccessToken(accessToken); 
System.out.println("accessToken is " + social.getFacebookAccessToken());
for(int i =0; i < social.getFriendList().size();i++)
{
	System.out.println("Installed is : " + social.getFriendList().get(i).getInstalled());
	System.out.println("Id is : " + social.getFriendList().get(i).getId());
	System.out.println("Picture is :" + social.getFriendList().get(i).getPicture());
	System.out.println("Name is : " + social.getFriendList().get(i).getName());
}    
String accessToken = "<Enter Facebook Access Token>";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
socialService.GetFacebookFriendsFromAccessToken(accessToken, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Social social = (Social) response;    
		App42Log.Console("accessToken is" + social.GetFacebookAccessToken());
		for(int i =0; i < social.GetFriendList().Count;i++)
		{
			App42Log.Console("Installed is : " + social.GetFriendList()[i].GetInstalled());
			App42Log.Console("Id is : " + social.GetFriendList()[i].GetId());
			App42Log.Console("Name is : " + social.GetFriendList()[i].GetName());
		}     
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
              
var accessToken = "<Enter Facebook Access Token>",
social;
App42.initialize("API_KEY","SECRET_KEY");
var socialService  = new App42Social();
socialService.getFacebookFriendsFromAccessToken(accessToken,{
	success: function(object) {
	var response = JSON.parse(object);
            social = response.app42.response.social;
            console.log("accessToken is " + social.facebookAccessToken);
            var friends = social.friends;
            if (friends instanceof Array) {
                for (var i = 0; i < friends.length; i++) {
                    console.log("Id : " + friends[i].id)
                    console.log("Installed : " + friends[i].installed)
                    console.log("Name : " + friends[i].name)
                    console.log("Picture : " + friends[i].picture)
                }
            } else {
                console.log("Id : " + friends.id)
                console.log("Installed : " + friends.installed)
                console.log("Name : " + friends.name)
                console.log("Picture : " + friends.picture)
            }
        },
        error: function (error) {
        }
});
local accessToken = "<Enter Facebook Access Token>"
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local socialService  = App42API:buildSocialService()
socialService:getFacebookFriendsFromAccessToken(accessToken,App42CallBack)
function App42CallBack:onSuccess(object)
	print("Access Token is " ..object:getFacebookAccessToken()); 
	for m=1,table.getn(object:getFriendList()) do
		print(object:getFriendList()[m]:getInstalled())
		print("Id is : " ..object:getFriendList()[m]:getId());  
		print("Picture is :" ..object:getFriendList()[m]:getPicture());  
		print("Name is : " ..object:getFriendList()[m]:getName());  
	end    
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* accessToken = "<Enter Facebook Access Token>";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->GetFacebookFriendsFromAccessToken(accessToken, app42callback(Sample_Class::onSocialServiceRequestCompleted, this));
void Sample_Class::onSocialServiceRequestCompleted(void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
        printf("\nUserName=%s",app42SocialResponse->social.getUserName().c_str());  
        printf("\nFBAccessToken=%s",app42SocialResponse->social.getFacebookAccessToken().c_str());      
        /**
         * Getting friends
         */
        vector<App42Friend> friends = app42SocialResponse->friendsList;
        for(std::vector<App42Friend>::iterator it = friends.begin(); it != friends.end(); ++it)
        {
            printf("\nFriendId=%s",it->getFriendId().c_str());
            printf("\nName=%s\n",it->getName().c_str());
            printf("\nPictureUrl=%s\n",it->getPicture().c_str());
            printf("\nInstalled=%d\n",it->getInstalled());
        }
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
              
String accessToken = "<Enter Facebook Access Token>";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
Social social = socialService.GetFacebookFriendsFromAccessToken(accessToken); 
Console.WriteLine("accessToken is" + social.GetFacebookAccessToken()); 
for(int i =0; i < social.GetFriendList().Count;i++)
{
	Console.WriteLine("Installed is : " + social.GetFriendList()[i].GetInstalled());
	Console.WriteLine("Id is : " + social.GetFriendList()[i].GetId());
	Console.WriteLine("Name is : " + social.GetFriendList()[i].GetName());
}     
              
$accessToken = "<Enter Facebook Access Token>";
App42API::initialize("API_KEY","SECRET_KEY");
$socialService = App42API::buildSocialService();
$social = $socialService->getFacebookFriendsFromAccessToken($accessToken); 
print_r("accessToken is" . $social->getFacebookAccessToken());
$friendList = $social->getFriendslist();
foreach ($friendList as $friends) 
{
	print_r("Friend Name : ".$friends->getName());
	print_r("Id : ".$friends->getId());
	print_r("Picture is : ".$friends->getPicture());
	print_r("Installed is : " . $friends->getInstalled());
}
$jsonResponse = $social->toString();
const char* accessToken = "<Enter Facebook Access Token>";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->GetFacebookFriendsFromAccessToken(accessToken, this, app42callfuncND_selector(Sample_Class::onSocialServiceRequestCompleted));
void Sample_Class::onSocialServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
        printf("\nUserName=%s",app42SocialResponse->social.getUserName().c_str());  
        printf("\nFBAccessToken=%s",app42SocialResponse->social.getFacebookAccessToken().c_str());      
        /**
         * Getting friends
         */
        vector<App42Friend> friends = app42SocialResponse->friendsList;
        for(std::vector<App42Friend>::iterator it = friends.begin(); it != friends.end(); ++it)
        {
            printf("\nFriendId=%s",it->getFriendId().c_str());
            printf("\nName=%s\n",it->getName().c_str());
            printf("\nPictureUrl=%s\n",it->getPicture().c_str());
            printf("\nInstalled=%d\n",it->getInstalled());
        }
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
Not Available
var accessToken:String = "<Enter Facebook Access Token>";
App42API.initialize("API_KEY","SECRET_KEY");
var socialService:SocialService = App42API.buildSocialService(); 
socialService.getFacebookFriendsFromAccessToken(accessToken, new callback());  
public class callback implements App42CallBack  
{   
	public function onSuccess(response:Object):void  
	{  
		var social:Social = Social(response);
		trace("accessToken is " + social.getFacebookAccessToken());
		if(social.getFriendList().length > 0){
			for(var i:int=0;i<social.getFriendList().length;i++){
				trace("Name is : " + Friends(social.getFriendList()[i]).getName());
				trace("Id is " + Friends(social.getFriendList()[i]).getId());
				trace("Picture is " + Friends(social.getFriendList()[i]).getPicture());
				trace("Installed is " + Friends(social.getFriendList()[i]).getInstalled());
			}
		}
	}
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}   
}  
Not Available
              
String accessToken = "<Enter Facebook Access Token>";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
Social social = socialService.getFacebookFriendsFromAccessToken(accessToken); 
System.out.println("accessToken is " + social.getFacebookAccessToken());
Vector friendList = social.getFriendList();   
for(int i=0;i < friendList.size();i++)  
{ 
	Social.Friends friend = (Social.Friends)friendList.elementAt(i);  
	System.out.println("Installed is : " + friend.getInstalled());
	System.out.println("Id is : " + friend.getId());
	System.out.println("Name is : " + friend.getName());
}         
Update Twitter Status

Update the Twitter status of the specified user.

Required Parameters

userName - Name of the user for whom the status needs to be updated. status - Status that has to be updated.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for Swift
  • 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 status = "Nick is using the App42 API";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
socialService.updateTwitterStatus(userName, status, new App42CallBack() {
public void onSuccess(Object response) 
{
	Social social  = (Social)response;
	System.out.println("userName is :" + social.getUserName());  
	System.out.println("Status is : " + social.getStatus()); 
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});       
String userName = "Nick";                  
String status = "Nick is using the App42 API";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService();
socialService.UpdateTwitterStatus(userName, status, new Callback());  
public class Callback : App42Callback  
{  
	public void OnSuccess(Object response)  
	{  
		Social social = (Social) response;    
		Console.WriteLine("userName is" + social.GetUserName()); 
		Console.WriteLine("status is" + social.GetStatus()); 
		String jsonResponse = social.ToString();  
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
	
NSString *userName = @"Nick";                 
NSString *status = @"Nick is using the App42 API";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
SocialService *socialService = [App42API buildSocialService]; 
[socialService updateTwitterStatus:userName status:status completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		Social *social =  (Social*)responseObj;
		NSLog(@"UserName = %@",social.userName);		
		NSLog(@"status is %@",social.status);
		NSString *jsonResponse = [social toString];
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
let userName = "Nick";                 
let status = "Nick is using the App42 API"
App42API.initializeWithAPIKey("API_KEY", andSecretKey: "SECRET_KEY")
let socialService = App42API.buildSocialService as! SocialService
socialService?.updateTwitterStatus(userName, status:status, completionBlock:{ (success, response, exception) -> Void in
if (success)
	{
		let social = response as! Social
		NSLog("UserName = %@",social.userName)	
		NSLog("status is %@",social.status)
		NSLog("Response String is %@", social.strResponse)
	}
	else
	{
		NSLog("%@", exception.reason!)
        NSLog("%d", exception.appErrorCode)
        NSLog("%d", exception.httpErrorCode)
        NSLog("%@", exception.userInfo!)
	}
})
String userName = "Nick";                 
String status = "Nick is using the App42 API";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
Social social = socialService.updateTwitterStatus(userName, status); 
System.out.println("userName is :" + social.getUserName());  
System.out.println("Status is : " + social.getStatus()); 
String jsonResponse = social.toString();    
String userName = "Nick";                
String status = "Nick is using the App42 API";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
socialService.UpdateTwitterStatus(userName, status, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Social social = (Social) response;    
		App42Log.Console("userName is" + social.GetUserName()); 
		App42Log.Console("status is" + social.GetStatus()); 
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",              
status = "Nick is using the App42 API",
social ;
App42.initialize("API_KEY","SECRET_KEY");
var socialService  = new App42Social();
socialService.updateTwitterStatus(userName, status,{
	success: function(object) {
	var response = JSON.parse(object);  
		social = response.app42.response.social;
		console.log("userName is " + social.userName)
		console.log("status is " + social.status)
	},
	error: function(error) {
	}
});
local userName = "Nick"                          
local status = "Nick is using the App42 API"        
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local socialService  = App42API:buildSocialService()
socialService:updateTwitterStatus(userName, status ,App42CallBack)
function App42CallBack:onSuccess(object)
	print("userName is :"..object:getUserName());    
	print("Status is : "..object:getStatus());       
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
const char* status = "Nick is using the App42 API";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->UpdateTwitterStatus(userName, status, app42callback(Sample_Class::onSocialServiceRequestCompleted, this));
void Sample_Class::onSocialServiceRequestCompleted(void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
        printf("\nUserName=%s",app42SocialResponse->social.getUserName().c_str());
        printf("\nStatus=%s",app42SocialResponse->social.getStatus().c_str());
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
String userName = "Nick";                
String status = "Nick is using the App42 API";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
Social social = socialService.UpdateTwitterStatus(userName, status); 
Console.WriteLine("userName is" + social.GetUserName()); 
Console.WriteLine("status is" + social.GetStatus()); 
String jsonResponse = social.ToString();         
$userName = "Nick";              
$status = "Nick is using the App42 API";
App42API::initialize("API_KEY","SECRET_KEY");
$socialService = App42API::buildSocialService();
$social = $socialService->updateTwitterStatus($userName, $status); 
Print_r("userName is" . $social->getUserName());
Print_r("status is" . $social->getStatus());
$jsonResponse = $social->toString();
const char* userName = "Nick";
const char* status = "Nick is using the App42 API";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->UpdateTwitterStatus(userName, status, this, app42callfuncND_selector(Sample_Class::onSocialServiceRequestCompleted));
void Sample_Class::onSocialServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
        printf("\nUserName=%s",app42SocialResponse->social.getUserName().c_str());
        printf("\nStatus=%s",app42SocialResponse->social.getStatus().c_str());
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
user_name = "Nick";
status = "Nick is using the App42 API";	
api = App42::ServiceAPI.new("API_KEY","SECRET_KEY")  
social_service = api.build_social_service()
social = social_service.update_twitter_status(user_name, status); 
puts "userName is #{social.user_name}";
puts "status is #{social.status}";
puts "twitterConsumerKey is #{social.twitter_consumer_key}";
puts "twitterConsumerSecret is #{social.twitter_consumer_secret}";
puts "twitterAccessToken is #{social.twitter_access_token}";
puts "twitterAccessToken is #{social.twitter_access_token_secret}";
json_response = social.to_s(); 
var userName:String = "Nick";                  
var status:String = "Nick is using the App42 API";
App42API.initialize("API_KEY","SECRET_KEY");
var socialService:SocialService = App42API.buildSocialService(); 
socialService.updateTwitterStatus(userName,status, new callback());  
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var social:Social = Social(response);
		trace("userName is " + social.getUserName());
		trace("status is " + social.getStatus());
	}  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
}  
Not Available
String userName = "Nick";                       
String status = "Nick is using the App42 API";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
Social social = socialService.updateTwitterStatus(userName, status); 
System.out.println("userName is " + social.getUserName());
System.out.println("fb Access Token is " + social.getStatus());
String jsonResponse = social.toString();    
Update Linkedin Status

Update the LinkedIn status of the specified user.

Required Parameters

userName - Name of the user for whom the status needs to be updated. status - Status that has to be updated.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for Swift
  • 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 status = "Nick is using the App42 API";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
socialService.updateLinkedInStatus(userName, status, new App42CallBack() {
public void onSuccess(Object response) 
{
	Social social  = (Social)response;
	System.out.println("userName is " + social.getUserName());  
	System.out.println("status is " + social.getStatus());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});       
String userName = "Nick";                  
String status = "Nick is using the App42 API";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService();
socialService.UpdateLinkedInStatus(userName, status, new Callback());  
public class Callback : App42Callback  
{  
	public void OnSuccess(Object response)  
	{  
		Social social = (Social) response;    
		Console.WriteLine("userName is" + social.GetUserName()); 
		Console.WriteLine("status is" + social.GetStatus()); 
		String jsonResponse = social.ToString();  
	} 
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}   
}  
	
NSString *userName = @"Nick";                 
NSString *status = @"Nick is using the App42 API";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
SocialService *socialService = [App42API buildSocialService]; 
[socialService updateLinkedInStatus:userName status:status completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		Social *social =  (Social*)responseObj;
		NSLog(@"userName is %@",social.userName);
		NSLog(@"status is %@",social.status);
		NSString *jsonResponse = [social toString];
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
let userName = "Nick"                
let status = "Nick is using the App42 API"
App42API.initializeWithAPIKey("API_KEY", andSecretKey: "SECRET_KEY")
let socialService = App42API.buildSocialService as! SocialService
socialService?.updateLinkedInStatus(userName, status:status,completionBlock:{ (success, response, exception) -> Void in
    if (success)
	{
		let social = response as! Social
		NSLog("userName is %@",social.userName)
		NSLog("status is %@",social.status)
		NSLog("Response String is %@", social.strResponse)
	}
	else
	{
		NSLog("%@", exception.reason!)
        NSLog("%d", exception.appErrorCode)
        NSLog("%d", exception.httpErrorCode)
        NSLog("%@", exception.userInfo!)
	}
})
String userName = "Nick";                 
String status = "Nick is using the App42 API";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
Social social = socialService.updateLinkedInStatus(userName, status); 
System.out.println("userName is " + social.getUserName());  
System.out.println("status is " + social.getStatus());
String jsonResponse = social.toString();    
String userName = "Nick";                
String status = "Nick is using the App42 API";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
socialService.UpdateLinkedInStatus(userName, status, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Social social = (Social) response;    
		App42Log.Console("userName is" + social.GetUserName()); 
		App42Log.Console("status is" + social.GetStatus()); 
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",              
status = "Nick is using the App42 API",
social ;
App42.initialize("API_KEY","SECRET_KEY");
var socialService  = new App42Social();
socialService.updateLinkedInStatus(userName, status,{
	success: function(object) {
	var response = JSON.parse(object);  
		social = response.app42.response.social;
		console.log("userName is " + social.userName)
		console.log("status is " + social.status)
	},
	error: function(error) {
	}
});
local userName = "Nick"                          
local status = "Nick is using the App42 API"     
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local socialService  = App42API:buildSocialService()
socialService:updateLinkedInStatus(userName,status ,App42CallBack)
function App42CallBack:onSuccess(object)  
	print("userName is " ..object:getUserName());    
	print("status is " ..object:getStatus());        
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
const char* status = "Nick is using the App42 API";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->UpdateLinkedInStatus(userName, status, app42callback(Sample_Class::onSocialServiceRequestCompleted, this));
void Sample_Class::onSocialServiceRequestCompleted(void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
        printf("\nUserName=%s",app42SocialResponse->social.getUserName().c_str());
        printf("\nStatus=%s",app42SocialResponse->social.getStatus().c_str());
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
String userName = "Nick";                
String status = "Nick is using the App42 API";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
Social social = socialService.UpdateLinkedInStatus(userName, status); 
Console.WriteLine("userName is" + social.GetUserName()); 
Console.WriteLine("status is" + social.GetStatus()); 
String jsonResponse = social.ToString();         
$userName = "Nick";              
$status = "Nick is using the App42 API";
App42API::initialize("API_KEY","SECRET_KEY");
$socialService = App42API::buildSocialService();
$social = $socialService->updateLinkedInStatus($userName, $status); 
Print_r("userName is" . $social->getUserName());
Print_r("status is" . $social->getStatus());
$jsonResponse = $social->toString();
const char* userName = "Nick";
const char* status = "Nick is using the App42 API";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->UpdateLinkedInStatus(userName, status, this, app42callfuncND_selector(Sample_Class::onSocialServiceRequestCompleted));
void Sample_Class::onSocialServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
        printf("\nUserName=%s",app42SocialResponse->social.getUserName().c_str());
        printf("\nStatus=%s",app42SocialResponse->social.getStatus().c_str());
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
user_name = "Nick";
status = "Nick is using the App42 API";
api = App42::ServiceAPI.new("API_KEY","SECRET_KEY")  
social_service = api.build_social_service()
social = social_service.update_linkedIn_status(user_name, api_key, secret_key, access_token, access_token_secret); 
puts"userName is #{social.user_name}";
puts "linkedinApiKey is #{social.linkedin_api_key}";
puts "linkedinSecretKey is #{social.linkedin_secret_key}";
puts "linkedinAccessToken is #{social.linkedin_access_token}";
puts "linkedinAccessTokenSecret is #{social.linkedin_access_token_secret}";
response = social.response(); 
json_response = social.to_s();
var userName:String = "Nick";                  
var status:String = "Nick is using the App42 API";
App42API.initialize("API_KEY","SECRET_KEY");
var socialService:SocialService = App42API.buildSocialService(); 
socialService.updateLinkedInStatus(userName,status, new callback());  
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var social:Social = Social(response);
		trace("userName is " + social.getUserName());
		trace("status is " + social.getStatus());
	} 
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}   
}  
Not Available
String userName = "Nick";                       
String status = "Nick is using the App42 API";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
Social social = socialService.updateLinkedInStatus(userName, status); 
System.out.println("userName is " + social.getUserName());
System.out.println("fb Access Token is " + social.getStatus());
String jsonResponse = social.toString();    
Update Social Status On All

Update the status on all linked social accounts of the specified user.

Required Parameters

userName - Name of the user for whom the status needs to be updated. status - Status that has to be updated.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for Swift
  • 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 status = "Nick is using the App42 API";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
socialService.updateSocialStatusForAll(userName, status, new App42CallBack() {
public void onSuccess(Object response) 
{
	Social social  = (Social)response;
	System.out.println("userName is " + social.getUserName());  
	System.out.println("status is " + social.getStatus());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});        
String userName = "Nick";                  
String status = "Nick is using the App42 API";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService();
socialService.UpdateSocialStatusForAll(userName, status, new Callback());  
public class Callback : App42Callback  
{  
	public void OnSuccess(Object response)  
	{  
		Social social = (Social) response;    
		Console.WriteLine("userName is" + social.GetUserName()); 
		Console.WriteLine("status is" + social.GetStatus()); 
		String jsonResponse = social.ToString();  
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
	
NSString *userName = @"Nick";                 
NSString *status = @"Nick is using the App42 API";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
SocialService *socialService = [App42API buildSocialService]; 
[socialService updateSocialStatusForAll:userName status:status completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		Social *social =  (Social*)responseObj;
		NSLog(@"userName is %@",social.userName);
		NSLog(@"status is %@",social.status);
		NSString *jsonResponse = [social toString];
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
let userName = "Nick"                 
let status = "Nick is using the App42 API"
App42API.initializeWithAPIKey("API_KEY", andSecretKey: "SECRET_KEY")
let socialService = App42API.buildSocialService as! SocialService
socialService?.updateSocialStatusForAll(userName, status:status,completionBlock:{ (success, response, exception) -> Void in

	if (success)
	{
		let social = response as! Social
		NSLog("userName is %@",social.userName)
		NSLog("status is %@",social.status)
		NSLog("Response String is %@", social.strResponse)
	}
	else
	{
		NSLog("%@", exception.reason!)
        NSLog("%d", exception.appErrorCode)
        NSLog("%d", exception.httpErrorCode)
        NSLog("%@", exception.userInfo!)
	}
})
String userName = "Nick";                 
String status = "Nick is using the App42 API";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
Social social = socialService.updateSocialStatusForAll(userName, status); 
System.out.println("userName is " + social.getUserName());  
System.out.println("status is " + social.getStatus());
String jsonResponse = social.toString();    
String userName = "Nick";                
String status = "Nick is using the App42 API";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
socialService.updateSocialStatusForAll(userName, status, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Social social = (Social) response;    
		App42Log.Console("userName is" + social.GetUserName()); 
		App42Log.Console("status is" + social.GetStatus()); 
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var userName = "Nick",              
status = "Nick is using the App42 API",
social ;
App42.initialize("API_KEY","SECRET_KEY");
var socialService  = new App42Social();
socialService.updateSocialStatusForAll(userName, status,{
	success: function(object) {
	var response = JSON.parse(object);  
		social = response.app42.response.social;
		console.log("userName is " + social.userName)
		console.log("status is " + social.status)
	},
	error: function(error) {
	}
});
local userName = "Nick"                          
local status = "Nick is using the App42 API"     
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local socialService  = App42API:buildSocialService()
socialService:updateSocialStatusForAll(userName,status ,App42CallBack)
function App42CallBack:onSuccess(object)  
	print("userName is " ..object:getUserName());    
	print("status is " ..object:getStatus());        
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* userName = "Nick";
const char* status = "Nick is using the App42 API";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->UpdateSocialStatusForAll(userName, status, app42callback(Sample_Class::onSocialServiceRequestCompleted, this));

void Sample_Class::onSocialServiceRequestCompleted(void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
        printf("\nUserName=%s",app42SocialResponse->social.getUserName().c_str());
        printf("\nStatus=%s",app42SocialResponse->social.getStatus().c_str());
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
String userName = "Nick";                
String status = "Nick is using the App42 API";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
Social social = socialService.updateSocialStatusForAll(userName, status); 
Console.WriteLine("userName is" + social.GetUserName()); 
Console.WriteLine("status is" + social.GetStatus()); 
String jsonResponse = social.ToString();         
$userName = "Nick";              
$status = "Nick is using the App42 API";
App42API::initialize("API_KEY","SECRET_KEY");
$socialService = App42API::buildSocialService();
$social = $socialService->updateSocialStatusForAll($userName, $status); 
Print_r("userName is" . $social->getUserName());
Print_r("status is" . $social->getStatus());
$jsonResponse = $social->toString();
const char* userName = "Nick";
const char* status = "Nick is using the App42 API";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->UpdateSocialStatusForAll(userName, status, this, app42callfuncND_selector(Sample_Class::onSocialServiceRequestCompleted));

void Sample_Class::onSocialServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
        printf("\nUserName=%s",app42SocialResponse->social.getUserName().c_str());
        printf("\nStatus=%s",app42SocialResponse->social.getStatus().c_str());
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
user_name = "Nick";
status = "Nick is using the App42 API";
api = App42::ServiceAPI.new("API_KEY","SECRET_KEY")  
social_service = api.build_social_service()
social = social_service.update_social_status_for_all(user_name, status); 
puts "userName is #{social.user_name}";
response = social.response(); 
json_response = social.to_s();
var userName:String = "Nick";                  
var status:String = "Nick is using the App42 API";
App42API.initialize("API_KEY","SECRET_KEY");
var socialService:SocialService = App42API.buildSocialService(); 
socialService.updateSocialStatusForAll(userName,status, new callback());  
public class callback implements App42CallBack  
{   
	public function onSuccess(response:Object):void  
	{  
		var social:Social = Social(response);
		trace("userName is " + social.getUserName());
		trace("status is " + social.getStatus());
	} 
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
}  
Not Available
String userName = "Nick";                       
String status = "Nick is using the App42 API";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
Social social = socialService.updateSocialStatusForAll(userName, status); 
System.out.println("userName is " + social.getUserName());
System.out.println("status is " + social.getStatus());
String jsonResponse = social.toString();    
Facebook Link Post

Share your link on Facebook based on access token.

Required Parameters

accessToken - Facebook Access Token that has been received after authorization. link - Link which has to be posted on Facebook wall. message - Message which has to be posted with the Link.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for Swift
  • 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 accessToken = "<Enter Facebook Access Token>";
String link = "http://www.shephertz.com/";
String message =  "Welcome to ShepHertz";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
socialService.facebookLinkPost(accessToken, link, message, 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 accessToken = "<Enter Facebook Access Token>";
String link = "http://www.shephertz.com/";
String message =  "Welcome to ShepHertz";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService();
socialService.FacebookLinkPost(accessToken, link, message, new Callback());  
public class Callback : App42Callback  
{  
	public void OnSuccess(Object response)  
	{  
		App42Response app42Response = (App42Response) response;    
		Console.WriteLine("app42Response is" + app42Response);
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
	
NSString *accessToken = @"<Enter Facebook Access Token>";
NSString *message = @"Welcome to ShepHertz";
NSString *link = @"http://www.shephertz.com";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
SocialService *socialService = [App42API buildSocialService]; 
[socialService facebookLinkPost:accessToken link:link message:message completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		App42Response *response = (App42Response*)responseObj;
		NSLog(@"response=%@",response.strResponse);
		NSLog(@"isResponseSuccess=%d",response.isResponseSuccess);
		NSString *jsonResponse = [response toString];
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
let  accessToken = "<Enter Facebook Access Token>"
let message = "Welcome to ShepHertz"
let link = "http://www.shephertz.com"
App42API.initializeWithAPIKey("API_KEY", andSecretKey: "SECRET_KEY")
let socialService = App42API.buildSocialService as! SocialService
socialService?.facebookLinkPost(accessToken, link:link,message:message,completionBlock:{ (success, response, exception) -> Void in
    if (success)
	{
		let response = response as! App42Response
		NSLog("response=%@",response.strResponse)
		NSLog("isResponseSuccess=%d",response.isResponseSuccess)
		NSLog("Response String is %@", response.strResponse)
	}
	else
	{
		NSLog("%@", exception.reason!)
        NSLog("%d", exception.appErrorCode)
        NSLog("%d", exception.httpErrorCode)
        NSLog("%@", exception.userInfo!)
	}
})
String accessToken = "<Enter Facebook Access Token>";
String link = "http://www.shephertz.com/";
String message =  "Welcome to ShepHertz";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
App42Response app42Response = socialService.facebookLinkPost(accessToken, link, message);
System.out.println("app42Response is" + app42Response);    
String accessToken = "<Enter Facebook Access Token>";
String link = "http://www.shephertz.com/";
String message =  "Welcome to ShepHertz";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
socialService.FacebookLinkPost(accessToken, link, message, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42Response = (App42Response) response;    
		App42Log.Console("app42Response is" + app42Response); 
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var accessToken = "<Enter Facebook Access Token>",
link = "http://www.shephertz.com/",
message =  "Welcome to ShepHertz",
result;
App42.initialize("API_KEY","SECRET_KEY");
var socialService  = new App42Social();
socialService.facebookLinkPost(accessToken, link,message,{
	success: function(object) {
	var app42esponse = JSON.parse(object);  
		result = app42esponse.app42.response;
		console.log("responses is " + result)
	},
	error: function(error) {
	}
});
local accessToken = "<Enter Facebook Access Token>"                        
local link = "http://www.shephertz.com/"                          
local message =  "Welcome to ShepHertz"   
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local socialService  = App42API:buildSocialService()
socialService:facebookLinkPost(accessToken, link, message,App42CallBack)
function App42CallBack:onSuccess(object)  
	print("Response is :"..object:getStrResponse());     
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* link = "http://www.shephertz.com/";
const char* message = "Welcome to ShepHertz";
const char* accessToken = "<Enter Facebook Access Token>";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->FacebookLinkPost(accessToken, link, message, app42callback(Sample_Class::onSocialServiceRequestCompleted, this));
void Sample_Class::onSocialServiceRequestCompleted(void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
String accessToken = "<Enter Facebook Access Token>";
String link = "http://www.shephertz.com/";
String message =  "Welcome to ShepHertz";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
App42Response app42Response = socialService.FacebookLinkPost(accessToken, link, message);   
Console.WriteLine("app42Response is" + app42Response);
$accessToken = "<Enter Facebook Access Token>";
$link = "http://www.shephertz.com/";
$message =  "Welcome to ShepHertz";
App42API::initialize("API_KEY","SECRET_KEY");
$socialService = App42API::buildSocialService();
$app42Response = $socialService->facebookLinkPost($accessToken, $link,$message);
print_r("Response is : ".$app42Response->toString());
const char* link = "http://www.shephertz.com/";
const char* message = "Welcome to ShepHertz";
const char* accessToken = "<Enter Facebook Access Token>";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->FacebookLinkPost(accessToken, link, message, this, app42callfuncND_selector(Sample_Class::onSocialServiceRequestCompleted));
void Sample_Class::onSocialServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
Not Available
var accessToken:String = "<Enter Facebook Access Token>";
var link:String = "http://www.shephertz.com/";
var message:String =  "Welcome to ShepHertz";
App42API.initialize("API_KEY","SECRET_KEY");
var socialService:SocialService = App42API.buildSocialService(); 
socialService.facebookLinkPost(accessToken, link, message,new callback()); 
public class callback implements App42CallBack  
{   
	public function onSuccess(response:Object):void  
	{  
		var app42Response:App42Response = App42Response(response);
		trace("app42Response is : " + app42Response);
	} 
	public function onException(exception:App42Exception):void  
	{  
		trace("Exception is : "+ exception);  
	}  
}  
Not Available
String accessToken = "<Enter Facebook Access Token>";
String link = "http://www.shephertz.com/";
String message =  "Welcome to ShepHertz";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
App42Response app42Response = socialService.facebookLinkPost(accessToken, link, message);
System.out.println("app42Response is" + app42Response);   
Facebook Link Post With Custom Thumbnail

Share your link on Facebook based on custom image and message.

Required Parameters

accessToken - Facebook Access Token that has been received after authorization. link - Link which has to be posted on Facebook. message - Message which has to be posted with the Link. pictureUrl - Your thumbnail image url which you want to share on Facebook. fileName - Name of your File which you have shared on Facebook. description - Description of your file and Post.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for Swift
  • 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 accessToken = "<Enter Facebook Access Token>";
String link = "http://www.shephertz.com/";
String message =  "Welcome to ShepHertz";
String pictureUrl="https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
String fileName = "Buddy Image";
String description =  "Welcome to ShepHertz Home Page";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
socialService.facebookLinkPostWithCustomThumbnail(accessToken, link, message, pictureUrl, fileName, description, 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 accessToken = "<Enter Facebook Access Token>";
String link = "http://www.shephertz.com/";
String message =  "Welcome to ShepHertz";
String pictureUrl="https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
String fileName = "Buddy Image";
String description =  "Welcome to ShepHertz Home Page";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService();
socialService.FacebookLinkPostWithCustomThumbnail(accessToken, link, message, pictureUrl, fileName, description, new Callback());  
public class Callback : App42Callback  
{   
	public void OnSuccess(Object response)  
	{  
		App42Response app42Response = (App42Response) response;    
		Console.WriteLine("app42Response is" + app42Response);
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	} 
}  
	
NSString *accessToken = @"<Enter Facebook Access Token>";
NSString *link = @"http://www.shephertz.com";
NSString *message =  @"Welcome to ShepHertz";
NSString *pictureUrl = @"https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
NSString *fileName = @"Buddy Image";
NSString *description = @"Welcome to ShepHertz Home Page";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
SocialService *socialService = [App42API buildSocialService]; 
[socialService facebookLinkPostWithCustomThumbnail:accessToken link:link message:message pictureUrl:pictureUrl fileName:fileName description:description completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		App42Response *response = (App42Response*)responseObj;
		NSLog(@"response=%@",response.strResponse);
		NSLog(@"isResponseSuccess=%d",response.isResponseSuccess);
		NSString *jsonResponse = [response toString];
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
let accessToken = "<Enter Facebook Access Token>"
let link = "http://www.shephertz.com"
let message =  "Welcome to ShepHertz"
let pictureUrl = "https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png"
let fileName = "Buddy Image"
let description = "Welcome to ShepHertz Home Page"
App42API.initializeWithAPIKey("API_KEY", andSecretKey: "SECRET_KEY")
let socialService = App42API.buildSocialService as! SocialService
socialService?.facebookLinkPostWithCustomThumbnail(accessToken, link:link,message:message,pictureUrl:pictureUrl,fileName:fileName,description:description,completionBlock:{ (success, response, exception) -> Void in

	if (success)
	{
		let response = response as! App42Response
		NSLog("response=%@",response.strResponse)
		NSLog("isResponseSuccess=%d",response.isResponseSuccess)
		NSLog("Response String is %@", response.strResponse)
	}
	else
	{
		NSLog("%@", exception.reason!)
                NSLog("%d", exception.appErrorCode)
                NSLog("%d", exception.httpErrorCode)
                NSLog("%@", exception.userInfo!)
	}
})
String accessToken = "<Enter Facebook Access Token>";
String link = "http://www.shephertz.com/";
String message =  "Welcome to ShepHertz";
String pictureUrl="https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
String fileName = "Buddy Image";
String description =  "Welcome to ShepHertz Home Page";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
App42Response app42Response = socialService.facebookLinkPostWithCustomThumbnail(accessToken, link, message, pictureUrl, fileName, description);		
System.out.println("app42Response is" + app42Response);
String accessToken = "<Enter Facebook Access Token>";
String link = "http://www.shephertz.com/";
String message =  "Welcome to ShepHertz";
String pictureUrl="https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
String fileName = "Buddy Image";
String description =  "Welcome to ShepHertz Home Page";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
socialService.FacebookLinkPostWithCustomThumbnail(accessToken, link, message, pictureUrl, fileName, description, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42Response = (App42Response) response;    
		App42Log.Console("app42Response is" + app42Response); 
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var accessToken = "<Enter Facebook Access Token>",
link = "http://www.shephertz.com/",
message =  "Welcome to ShepHertz",
pictureUrl="https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png",
fileName = "Buddy Image",
description =  "Welcome to ShepHertz Home Page",
app42Response;
App42.initialize("API_KEY","SECRET_KEY");
var socialService  = new App42Social();
socialService.facebookLinkPostWithCustomThumbnail(accessToken, link,message,pictureUrl, fileName, description,{
	success: function(object) {
	var result = JSON.parse(object);  
		app42Response = result.app42.response;
		console.log("app42Response is : " + app42Response)
	},
	error: function(error) {
	}
});
local accessToken = "<Enter Facebook Access Token>"
local link = "http://www.shephertz.com/"
local message =  "Welcome to ShepHertz"
local pictureUrl="https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png"
local fileName = "Buddy Image"
local description =  "Welcome to ShepHertz Home Page"
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local socialService  = App42API:buildSocialService()
socialService:facebookLinkPostWithCustomThumbnail(accessToken,link,message,pictureUrl,fileName, description,App42CallBack)
function App42CallBack:onSuccess(object)  
	print("Response is :"..object:getStrResponse());     
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* link = "http://www.shephertz.com/";
const char* message = "Welcome to ShepHertz";
const char* accessToken = "<Enter Facebook Access Token>";
const char* pictureUrl = "https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
const char* fileName = "Buddy Image";
const char* description = "Welcome to ShepHertz Home Page";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->FacebookLinkPostWithCustomThumbnail(accessToken, link, message,pictureUrl,fileName,description, app42callback(Sample_Class::onSocialServiceRequestCompleted, this));
void Sample_Class::onSocialServiceRequestCompleted(void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
 
String accessToken = "<Enter Facebook Access Token>";
String link = "http://www.shephertz.com/";
String message =  "Welcome to ShepHertz";
String pictureUrl="https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
String fileName = "Buddy Image";
String description =  "Welcome to ShepHertz Home Page";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
App42Response app42Response = socialService.FacebookLinkPostWithCustomThumbnail(accessToken, link, message, pictureUrl, fileName, description);   
Console.WriteLine("app42Response is" + app42Response);
$accessToken = "<Enter Facebook Access Token>";
$link = "http://www.shephertz.com/";
$message =  "Welcome to ShepHertz";
$pictureUrl="https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
$fileName = "Buddy Image";
$description =  "Welcome to ShepHertz Home Page";
App42API::initialize("API_KEY","SECRET_KEY");
$socialService = App42API::buildSocialService();
$app42Response = $socialService->facebookLinkPostWithCustomThumbnail($accessToken,$link,$message,$pictureUrl,$fileName,$description);
print_r("Response is : ".$app42Response->toString());
const char* link = "http://www.shephertz.com/";
const char* message = "Welcome to ShepHertz";
const char* accessToken = "<Enter Facebook Access Token>";
const char* pictureUrl = "https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
const char* fileName = "Buddy Image";
const char* description = "Welcome to ShepHertz Home Page";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->FacebookLinkPostWithCustomThumbnail(accessToken, link, message,pictureUrl,fileName,description, this, app42callfuncND_selector(Sample_Class::onSocialServiceRequestCompleted));
void Sample_Class::onSocialServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
Not Available
var accessToken:String = "<Enter Facebook Access Token>";
var link:String = "http://www.shephertz.com/";
var message:String =  "Welcome to ShepHertz";
var pictureUrl:String="https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
var fileName:String = "Buddy Image";
var description:String =  "Welcome to ShepHertz Home Page";
App42API.initialize("API_KEY","SECRET_KEY");
var socialService:SocialService = App42API.buildSocialService(); 
socialService.facebookLinkPostWithCustomThumbnail(accessToken, link, message, pictureUrl, fileName, description,new callback());
public class callback implements App42CallBack  
{   
	public function onSuccess(response:Object):void  
	{  
		var app42Response:App42Response = App42Response(response);
		trace("app42Response is : " + app42Response);
	} 
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
}  
Not Available
String accessToken = "<Enter Facebook Access Token>";
String link = "http://www.shephertz.com/";
String message =  "Welcome to ShepHertz";
String pictureUrl="https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
String fileName = "Buddy Image";
String description =  "Welcome to ShepHertz Home Page";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
App42Response app42Response = socialService.facebookLinkPostWithCustomThumbnail(accessToken, link, message, pictureUrl, fileName, description);		
System.out.println("app42Response is" + app42Response);
Get Facebook Profile

Fetch the profile info likes profile picture ,Facebook ID and name of the user based on Facebook access token.

Required Parameters

accessToken - Access Token of the user for which Profile Info has to be fetched.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for Swift
  • 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 accessToken = "<Enter Facebook Access Token>";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
socialService.getFacebookProfile(accessToken, new App42CallBack() {
public void onSuccess(Object response) 
{
	Social social  = (Social)response;
	System.out.println("FacebookAccessToken is:"+social.getFacebookAccessToken());
	System.out.println("facebookProfileId is : " + social.getFacebookProfile().getId());
	System.out.println("facebookProfileName is : " + social.getFacebookProfile().getName());   
	System.out.println("facebookProfileImage is : " + social.getFacebookProfile().getPicture());
}
public void onException(Exception ex) 
{
	System.out.println("Exception Message"+ex.getMessage());
}
});
String accessToken = "<Enter Facebook Access Token>";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService();
socialService.GetFacebookProfile(accessToken, new Callback());  
public class Callback : App42Callback  
{  
	public void OnSuccess(Object response)  
	{  
		Social social = (Social) response;  
		Console.WriteLine("facebookProfileId is : " + social.GetFacebookProfile().GetId());
		Console.WriteLine("facebookProfileName is : " + social.GetFacebookProfile().GetName());   
		Console.WriteLine("facebookProfileImage is : " + social.GetFacebookProfile().GetPicture()); 
	}  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception Message : " + exception);  
	}  
}  
	
NSString *accessToken = @"<Enter Facebook Access Token>";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
SocialService *socialService = [App42API buildSocialService]; 
[socialService getFacebookProfile:accessToken completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		Social *social =  (Social*)responseObj;
		NSLog(@"Name=%@",social.facebookProfile.name);
		NSLog(@"Picture=%@",social.facebookProfile.picture);
		NSLog(@"Id=%@",social.facebookProfile.fbId);
		NSString *jsonResponse = [social toString];
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];
let accessToken = "<Enter Facebook Access Token>"
App42API.initializeWithAPIKey("API_KEY", andSecretKey: "SECRET_KEY")
let socialService = App42API.buildSocialService as! SocialService
socialService?.getFacebookProfile(accessToken,completionBlock:{ (success, response, exception) -> Void in
    if (success)
	{
		let social = response as! Social
		NSLog("Name=%@",social.facebookProfile.name);
		NSLog("Picture=%@",social.facebookProfile.picture);
		NSLog("Id=%@",social.facebookProfile.fbId);
		NSLog("Response String is %@", social.strResponse)
	}
	else
	{
		NSLog("%@", exception.reason!)
        NSLog("%d", exception.appErrorCode)
        NSLog("%d", exception.httpErrorCode)
        NSLog("%@", exception.userInfo!)
	}
})
String accessToken = "<Enter Facebook Access Token>";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
Social social = socialService.getFacebookProfile(accessToken);
System.out.println("FacebookAccessToken is:"+social.getFacebookAccessToken());
System.out.println("facebookProfileId is : " + social.getFacebookProfile().getId());
System.out.println("facebookProfileName is : " + social.getFacebookProfile().getName());   
System.out.println("facebookProfileImage is : " + social.getFacebookProfile().getPicture());
String accessToken = "<Enter Facebook Access Token>";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
socialService.GetFacebookProfile(accessToken, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Social social = (Social) response;    
		App42Log.Console("facebookProfileId is : " + social.GetFacebookProfile().GetId());
		App42Log.Console("facebookProfileName is : " + social.GetFacebookProfile().GetName());   
		App42Log.Console("facebookProfileImage is : " + social.GetFacebookProfile().GetPicture()); 
		
	}
	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var accessToken = "<Enter Facebook Access Token>",
social;
App42.initialize("API_KEY","SECRET_KEY");
var socialService  = new App42Social();
socialService.getFacebookProfile(accessToken,{
	success: function(object) {
	var response = JSON.parse(object);  
		social = response.app42.response.social;
		console.log("facebookProfileId is : " + social.me.id)
		console.log("facebookProfileName is : " + social.me.name)
		console.log("facebookProfileImage is : " + social.me.picture)
	},
	error: function(error) {
	}
});
local accessToken = "<Enter Facebook Access Token>"
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local socialService  = App42API:buildSocialService()
socialService:getFacebookProfile(accessToken,App42CallBack)
function App42CallBack:onSuccess(object)  
	print("FacebookAccessToken is:"..object:getFacebookAccessToken());
	print("Id is : " ..object:getFacebookProfile():getId());  
	print("Picture is :" ..object:getFacebookProfile():getPicture());  
	print("Name is : " ..object:getFacebookProfile():getName());    
end
function App42CallBack:onException(exception)
	print("Message is : "..exception:getMessage())
	print("App Error code is : "..exception:getAppErrorCode())
	print("Http Error code is "..exception:getHttpErrorCode())
	print("Detail is : "..exception:getDetails())
end
const char* accessToken = "<Enter Facebook Access Token>";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->GetFacebookProfile(accessToken, app42callback(Sample_Class::onSocialServiceRequestCompleted, this));
void Sample_Class::onSocialServiceRequestCompleted(void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
        /**
         * Getting facebook profile
         */
        printf("\nName=%s", app42SocialResponse->facebookProfile.getName().c_str());
        printf("\nFbId=%s", app42SocialResponse->facebookProfile.getFbId().c_str());
        printf("\nPicture=%s", app42SocialResponse->facebookProfile.getPicture().c_str());
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
String accessToken = "<Enter Facebook Access Token>";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
Social social = socialService.GetFacebookProfile(accessToken);
Console.WriteLine("facebookProfileId is : " + social.GetFacebookProfile().GetId());
Console.WriteLine("facebookProfileName is : " + social.GetFacebookProfile().GetName());   
Console.WriteLine("facebookProfileImage is : " + social.GetFacebookProfile().GetPicture()); 
$accessToken = "<Enter Facebook Access Token>";
App42API::initialize("API_KEY","SECRET_KEY");
$socialService = App42API::buildSocialService();
$social = $socialService->getFacebookProfile($accessToken);
print_r("FacebookAccessToken is:".$social->getFacebookAccessToken());
print_r("facebookProfileId is : ".$social->getFacebookProfile()->getId());
print_r("facebookProfileName is : " .$social->getFacebookProfile()->getName());
print_r("facebookProfileImage is : ".$social->getFacebookProfile()->getPicture());
const char* accessToken = "<Enter Facebook Access Token>";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->GetFacebookProfile(accessToken, this, app42callfuncND_selector(Sample_Class::onSocialServiceRequestCompleted));
void Sample_Class::onSocialServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
        /**
         * Getting facebook profile
         */
        printf("\nName=%s", app42SocialResponse->facebookProfile.getName().c_str());
        printf("\nFbId=%s", app42SocialResponse->facebookProfile.getFbId().c_str());
        printf("\nPicture=%s", app42SocialResponse->facebookProfile.getPicture().c_str());
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}
Not Available
var accessToken:String = "<Enter Facebook Access Token>";
App42API.initialize("API_KEY","SECRET_KEY");
var socialService:SocialService = App42API.buildSocialService(); 
socialService.getFacebookProfile(accessToken,new callback());
public class callback implements App42CallBack  
{  
	public function onSuccess(response:Object):void  
	{  
		var social:Social = Social(response);
		trace("facebookProfileName is : " + FacebookProfile(social.getFaceBookProfile()).getName());
		trace("facebookProfileId is : " + FacebookProfile(social.getFaceBookProfile()).getId());
		trace("facebookProfileImage is : " + FacebookProfile(social.getFaceBookProfile()).getPicture());
	}  
	public function onException(excption:App42Exception):void  
	{  
		trace("Exception Message");  
	}  
}  
Not Available
String accessToken = "<Enter Facebook Access Token>";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
Social social = socialService.getFacebookProfile(accessToken);
System.out.println("facebookProfileId is : " + social.getFacebookProfile().getId());
System.out.println("facebookProfileName is : " + social.getFacebookProfile().getName());   
System.out.println("facebookProfileImage is : " + social.getFacebookProfile().getPicture()); 
Facebook Publish Stream

Share your file on Facebook wall based on Facebook access token.

Required Parameters

accessToken - Facebook Access Token that has been received after authorization. fileName - Name of the file which you want to upload. filePath - Local path of the file. message - Message which has to be posted with the Link.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for Swift
  • 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 accessToken = "<Enter Facebook Access Token>";
String fileName = "Buddy Image";
String filePath = "https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
String message =  "Welcome to ShepHertz";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
socialService.facebookPublishStream(accessToken,fileName,filePath,message,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 accessToken = "<Enter Facebook Access Token>";
String fileName = "Buddy Image";
String filePath = "https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
String message =  "Welcome to ShepHertz";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService();
socialService.FacebookPublishStream(accessToken, fileName, filePath, message, new Callback());  
public class Callback : App42Callback  
{  
	public void OnException(App42Exception exception)  
	{  
		Console.WriteLine("Exception is : " + exception);  
	}  
	public void OnSuccess(Object response)  
	{  
		App42Response app42Response = (App42Response) response;    
		Console.WriteLine("app42Response is" + app42Response);
	}  
}  
	
NSString *accessToken = @"<Enter Facebook Access Token>";
NSString *fileName = @"Buddy Image";
NSString *filePath = @"https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
NSString *message =  @"Welcome to ShepHertz";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
SocialService *socialService = [App42API buildSocialService]; 
[socialService facebookPublishStream:accessToken fileName:fileName filePath:filePath message:message completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		App42Response *response = (App42Response*)responseObj;
		NSLog(@"response=%@",response.strResponse);
		NSLog(@"isResponseSuccess=%d",response.isResponseSuccess);
		NSString *jsonResponse = [response toString];
	}
	else
	{
		NSLog(@"Exception = %@",[exception reason]);
		NSLog(@"HTTP error Code = %d",[exception httpErrorCode]);
		NSLog(@"App Error Code = %d",[exception appErrorCode]);
		NSLog(@"User Info = %@",[exception userInfo]);
	}
}];

let accessToken = "<Enter Facebook Access Token>"
let fileName = "Buddy Image"
let filePath = "https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png"
let message =  "Welcome to ShepHertz"
App42API.initializeWithAPIKey("API_KEY", andSecretKey: "SECRET_KEY")
let socialService = App42API.buildSocialService as! SocialService
socialService?.facebookPublishStream(accessToken,fileName:fileName, filePath:filePath, message:message, completionBlock:{ (success, response, exception) -> Void in
    if (success)
	{
		let response = response as! App42Response
		NSLog("response=%@",response.strResponse);
		NSLog("isResponseSuccess=%d",response.isResponseSuccess);
		NSLog("Response String is %@", response.strResponse)
	}
	else
	{
		NSLog("%@", exception.reason!)
        NSLog("%d", exception.appErrorCode)
        NSLog("%d", exception.httpErrorCode)
        NSLog("%@", exception.userInfo!)
	}
})
String accessToken = "<Enter Facebook Access Token>";
String fileName = "Buddy Image";
String filePath = "https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
String message =  "Welcome to ShepHertz";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
App42Response social = socialService.facebookPublishStream(accessToken, fileName, filePath, message);
System.out.println("response is " + social) ; 
String jsonResponse = social.toString();  
String accessToken = "<Enter Facebook Access Token>";
String fileName = "Buddy Image";
String filePath = "https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
String message =  "Welcome to ShepHertz";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
socialService.FacebookPublishStream(accessToken, fileName, filePath, message, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		App42Response app42Response = (App42Response) response;    
		App42Log.Console("app42Response is" + app42Response);
	}

	public void OnException(Exception e)
	{
		App42Log.Console("Exception : " + e);
	}
}
var accessToken = "<Enter Facebook Access Token>",              
fileName = "Buddy Image",
filePath = "https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png",
message =  "Welcome to ShepHertz",
app42Response;
App42.initialize("API_KEY","SECRET_KEY");
var socialService  = new App42Social();
socialService.facebookPublishStream(accessToken, fileName, filePath, message,{
	success: function(object) {
	var response = JSON.parse(object);  
		app42Response = response.app42.response;
		console.log("app42Response is : " + app42Response)
	},
	error: function(error) {
	}
});
Coming Soon
const char* accessToken = "<Enter Facebook Access Token>";
const char* filePath = "Your File Path";
const char* fileName = "<Your_file_name>";
const char* message = "Welcome to ShepHertz";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->FacebookPublishStream(accessToken, fileName, filePath.c_str(), message, app42callback(Sample_Class::onSocialServiceRequestCompleted, this));
void Sample_Class::onSocialServiceRequestCompleted(void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}  
String accessToken = "<Enter Facebook Access Token>";
String fileName = "Buddy Image";
String filePath = "https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
String message =  "Welcome to ShepHertz";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
App42Response app42Response = socialService.FacebookPublishStream(accessToken, fileName, filePath, message);    
Console.WriteLine("app42Response is" + app42Response);
$accessToken = "<Enter Facebook Access Token>";
$fileName = "Buddy Image";
$filePath = "https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
$message =  "Welcome to ShepHertz";
App42API::initialize("API_KEY","SECRET_KEY");
$socialService = App42API::buildSocialService();
$app42Response = $socialService->facebookPublishStream($accessToken,$fileName, $filePath, $message);
print_r("Response is : ".$app42Response->toString());
const char* accessToken = "<Enter Facebook Access Token>";
const char* filePath = "Your File Path";
const char* fileName = "<Your_file_name>";
const char* message = "Welcome to ShepHertz";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->FacebookPublishStream(accessToken, fileName, filePath.c_str(), message, this, app42callfuncND_selector(Sample_Class::onSocialServiceRequestCompleted));
void Sample_Class::onSocialServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        printf("\nResponse Body=%s",app42SocialResponse->getBody().c_str());
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
    }
}  
Not Available
Coming soon
Not Available
String accessToken = "<Enter Facebook Access Token>";
String fileName = "Buddy Image";
String filePath = "https://apis.shephertz.com/images/cloud-api-services/app42-cloud-api-services.png";
String message =  "Welcome to ShepHertz";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
App42Response social = socialService.facebookPublishStream(accessToken, fileName, filePath, message);
String jsonResponse = social.toString();    
Exception Handling

The functions available under Social API can throw some exceptions in abnormal conditions. If a developer is linking the User’s Twitter account name who has not authorized the app to use his account, the function will throw the App42Exception (as shown below) with message as “Not Found” and the appErrorCode as “3800” and the details as “Twitter App Credentials (ConsumerKey / ConsumerSecret) does not exist”.

  • create User Api for Android
  • create User Api for Windows
  • create User Api for iOS
  • create User Api for Swift
  • 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 status = "Nick is using the App42 API";
App42API.initialize("ANDROID_APPLICATION_CONTEXT","API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
socialService.updateTwitterStatus(userName, status, new App42CallBack() {
public void onSuccess(Object response) 
{
	Social social  = (Social)response;
	System.out.println(social);
	System.out.println("userName is :" + social.getUserName());  
	System.out.println("Status is : " + social.getStatus()); 
}
public void onException(Exception ex) 
{
	App42Exception exception = (App42Exception)ex;
	int appErrorCode = exception.getAppErrorCode();
	int httpErrorCode = exception.getHttpErrorCode();
	if(appErrorCode == 3800)
	{
	// Handle here for Not Found (Twitter App Credentials(ConsumerKey / ConsumerSecret) does not exist.)
	}
	else if(appErrorCode  == 3801)
	{
	// Handle here for Bad Request (The request is Unauthorized with the provided credentials.)
	}
	else if(appErrorCode  == 3802)
	{
	// Handle here for Not Found (Twitter User Access Credentials does not exist. Please use linkUserTwitterAccount API to link the User Twitter account.)
	}
	else if(appErrorCode  == 3803)
	{
	// Handle here for Bad Request (The Twitter Access Credentials are invalid.)
	}
	else if(appErrorCode == 1401)
	{
	// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
	// handle here for Internal Server Error
	}
	String jsonText = ex.getMessage(); 
	}
});	       
String userName = "Nick";
String status = "Nick is using the App42 API";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService();
socialService.UpdateTwitterStatus(userName, status, new Callback()); 
public class Callback : App42Callback  
{   
	public void OnException(App42Exception exception)  
	{  
		int appErrorCode = exception.GetAppErrorCode();
		int httpErrorCode = exception.GetHttpErrorCode();
		if(appErrorCode == 3800)
		{
			// Handle here for Not Found (Twitter App Credentials(ConsumerKey / ConsumerSecret) does not exist.)
		}
		else if(appErrorCode  == 3801)
		{
			// Handle here for Bad Request (The request is Unauthorized with the provided credentials.)
		}
		else if(appErrorCode  == 3802)
		{
			// Handle here for Not Found (Twitter User Access Credentials does not exist. Please use linkUserTwitterAccount API to link the User Twitter account.)
		}
		else if(appErrorCode  == 3803)
		{
			// Handle here for Bad Request (The Twitter Access Credentials are invalid.)
		}
		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)  
	{  
		Social social = (Social) response;
		String jsonResponse = social.ToString();  
	}  
} 
	
NSString *userName = @"Nick";
NSString *status = @"Nick is using the App42 API";
[App42API initializeWithAPIKey:@"APP_KEY" andSecretKey:@"SECRET_KEY"];
SocialService *socialService = [App42API buildSocialService]; 
[socialService updateTwitterStatus:userName status:status completionBlock:^(BOOL success, id responseObj, App42Exception *exception) 
{
	if (success)
	{
		Social *social =  (Social*)responseObj;
		NSString *jsonResponse = [social toString];
	}
	else
	{
		int appErrorCode = ex.appErrorCode;
		int httpErrorCode = ex.httpErrorCode;
		if(appErrorCode == 3800)
		{
			// Handle here for Not Found (Twitter App Credentials(ConsumerKey / ConsumerSecret) does not exist.)
		}
		else if(appErrorCode  == 3801)
		{
			// Handle here for Bad Request (The request is Unauthorized with the provided credentials.)
		}
		else if(appErrorCode  == 3802)
		{
			// Handle here for Not Found (Twitter User Access Credentials does not exist. Please use linkUserTwitterAccount API to link the User Twitter account.)
		}
		else if(appErrorCode  == 3803)
		{
			// Handle here for Bad Request (The Twitter Access Credentials are invalid.)
		}
		else if(appErrorCode == 1401)
		{
			// handle here for Client is not authorized
		}
		else if(appErrorCode == 1500)
		{
			// handle here for Internal Server Error
		}
		NSString *jsonText = ex.reason; 	
	}
}];	
Coming Soon
String userName = "Nick";
String status = "Nick is using the App42 API";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
try
{
	Social social = socialService.updateTwitterStatus(userName, status);
}
catch(App42Exception ex) 
{
	int appErrorCode = ex.getAppErrorCode();
	int httpErrorCode = ex.getHttpErrorCode();
	if(appErrorCode == 3800)
	{
		// Handle here for Not Found (Twitter App Credentials(ConsumerKey / ConsumerSecret) does not exist.)
	}
	else if(appErrorCode  == 3801)
	{
		// Handle here for Bad Request (The request is Unauthorized with the provided credentials.)
	}
	else if(appErrorCode  == 3802)
	{
		// Handle here for Not Found (Twitter User Access Credentials does not exist. Please use linkUserTwitterAccount API to link the User Twitter account.)
	}
	else if(appErrorCode  == 3803)
	{
		// Handle here for Bad Request (The Twitter Access Credentials are invalid.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	String jsonText = ex.getMessage(); 	
}
String userName = "Nick";                
String status = "Nick is using the App42 API";
App42Log.SetDebug(true);		//Print output in your editor console
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
socialService.UpdateTwitterStatus(userName, status, new UnityCallBack()); 
public class UnityCallBack : App42CallBack
{
	public void OnSuccess(object response)
	{
		Social social = (Social) response;    
		App42Log.Console("userName is" + social.GetUserName()); 
		App42Log.Console("status is" + social.GetStatus()); 
	}
	public void OnException(Exception e)
	{
		App42Exception ex = (App42Exception)e;
		int appErrorCode = ex.GetAppErrorCode();
        int httpErrorCode = ex.GetHttpErrorCode();
		if(appErrorCode == 3800)
		{
			// Handle here for Not Found (Twitter App Credentials(ConsumerKey / ConsumerSecret) does not exist.)
		}
		else if(appErrorCode  == 3801)
		{
			// Handle here for Bad Request (The request is Unauthorized with the provided credentials.)
		}
		else if(appErrorCode  == 3802)
		{
			// Handle here for Not Found (Twitter User Access Credentials does not exist. Please use linkUserTwitterAccount API to link the User Twitter account.)
		}
		else if(appErrorCode  == 3803)
		{
			// Handle here for Bad Request (The Twitter Access Credentials are invalid.)
		}
		else if(appErrorCode == 1401)
		{
			// handle here for Client is not authorized
		}
		else if(appErrorCode == 1500)
		{
			// handle here for Internal Server Error
		}
		String jsonText = ex.GetMessage(); 
	}
}
var userName = "Nick",
appErrorCode ,
status = "Nick is using the App42 API";
App42.initialize("API_KEY","SECRET_KEY");
var socialService  = new App42Social();
socialService.updateTwitterStatus(userName, status,{
	success: function(object) {
	},
	error: function(error) 
	{
		var socialObj = JSON.parse(error);
		appErrorCode = socialObj.app42Fault.appErrorCode;
		if(appErrorCode == 3800)
		{
			// Handle here for Not Found (Twitter App Credentials(ConsumerKey / ConsumerSecret) does not exist.)
		}
		else if(appErrorCode  == 3801)
		{
			// Handle here for Bad Request (The request is Unauthorized with the provided credentials.)
		}
		else if(appErrorCode  == 3802)
		{
			// Handle here for Not Found (Twitter User Access Credentials does not exist. Please use linkUserTwitterAccount API to link the User Twitter account.)
		}
		else if(appErrorCode  == 3803)
		{
			// Handle here for Bad Request (The Twitter Access Credentials are invalid.)
		}
		else if(appErrorCode == 1401)
		{
			// handle here for Client is not authorized
		}
		else if(appErrorCode == 1500)
		{
			// handle here for Internal Server Error
		}
	}
});
local userName = "Nick"
local status = "Nick is using the App42 API"
local App42CallBack = {}
App42API:initialize("API_KEY","SECRET_KEY")
local socialService  = App42API:buildSocialService()
socialService:updateTwitterStatus(userName, status ,App42CallBack)
function App42CallBack:onSuccess(object)
	print("Response Success is "..object:getResponseSuccess())
end
function App42CallBack:onException(exception)
	local appErrorCode = exception:getAppErrorCode()
	if appErrorCode == 3800 then
		-- Handle here for Not Found (Twitter App Credentials(ConsumerKey / ConsumerSecret) does not exist.)
	elseif appErrorCode  == 3801 then
		-- Handle here for Bad Request (The request is Unauthorized with the provided credentials.)
	elseif appErrorCode  == 3802 then
		-- Handle here for Not Found (Twitter User Access Credentials does not exist. Please use linkUserTwitterAccount API to link the User Twitter account.)
	elseif appErrorCode  == 3803 then
		-- Handle here for Bad Request (The Twitter Access Credentials are invalid.)
	elseif appErrorCode == 1401 then
		-- handle here for Client is not authorized
	elseif appErrorCode == 1500 then
		-- handle here for Internal Server Error
	end
end
const char* userName = "Nick";
const char* status = "Nick is using the App42 API";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->UpdateTwitterStatus(userName, status,app42callback(Sample_Class::onSocialServiceRequestCompleted, this));
void Sample_Class::onSocialServiceRequestCompleted(void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        
        // Handle success response here
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
        int appErrorCode = app42SocialResponse->appErrorCode;
		int httpErrorCode = app42SocialResponse->httpErrorCode;
		if(appErrorCode == 3800)
		{
			// Handle here for Not Found (Twitter App Credentials(ConsumerKey / ConsumerSecret) does not exist.)
		}
		else if(appErrorCode  == 3801)
		{
			// Handle here for Bad Request (The request is Unauthorized with the provided credentials.)
		}
		else if(appErrorCode  == 3802)
		{
			// Handle here for Not Found (Twitter User Access Credentials does not exist. Please use linkUserTwitterAccount API to link the User Twitter account.)
		}
		else if(appErrorCode  == 3803)
		{
			// Handle here for Bad Request (The Twitter Access Credentials are invalid.)
		}
		else if(appErrorCode == 1401)
		{
			// handle here for Client is not authorized
		}
		else if(appErrorCode == 1500)
		{
			// handle here for Internal Server Error
		}
    }
}
String userName = "Nick";
String status = "Nick is using the App42 API";
App42API.Initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.BuildSocialService(); 
try
{
	Social social = socialService.UpdateTwitterStatus(userName, status);
}
catch(App42Exception ex) 
{
	int appErrorCode = ex.GetAppErrorCode();
	int httpErrorCode = ex.GetHttpErrorCode();
	if(appErrorCode == 3800)
	{
		// Handle here for Not Found (Twitter App Credentials(ConsumerKey / ConsumerSecret) does not exist.)
	}
	else if(appErrorCode  == 3801)
	{
		// Handle here for Bad Request (The request is Unauthorized with the provided credentials.)
	}
	else if(appErrorCode  == 3802)
	{
		// Handle here for Not Found (Twitter User Access Credentials does not exist. Please use linkUserTwitterAccount API to link the User Twitter account.)
	}
	else if(appErrorCode  == 3803)
	{
		// Handle here for Bad Request (The Twitter Access Credentials are invalid.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	String jsonText = ex.GetMessage(); 	
}    
$userName = "Nick";
$status = "Nick is using the App42 API";
App42API::initialize("API_KEY","SECRET_KEY");
$socialService = App42API::buildSocialService();
try
{
	$social = $socialService->updateTwitterStatus($userName, $status);
} 
catch(App42Exception $ex) 
{
	$appErrorCode = $ex->getAppErrorCode();
	$httpErrorCode = $ex->getHttpErrorCode();
	if($appErrorCode == 3800)
	{
		// Handle here for Not Found (Twitter App Credentials(ConsumerKey / ConsumerSecret) does not exist.)
	}
	else if($appErrorCode  == 3801)
	{
		// Handle here for Bad Request (The request is Unauthorized with the provided credentials.)
	}
	else if($appErrorCode  == 3802)
	{
		// Handle here for Not Found (Twitter User Access Credentials does not exist. Please use linkUserTwitterAccount API to link the User Twitter account.)
	}
	else if($appErrorCode  == 3803)
	{
		// Handle here for Bad Request (The Twitter Access Credentials are invalid.)
	}
	else if($appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if($appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	$jsonText = $ex->getMessage(); 	
}                          
const char* userName = "Nick";
const char* status = "Nick is using the App42 API";
App42API::Initialize("API_KEY", "SECRET_KEY");
SocialService *socialService = App42API::BuildSocialService();
socialService->UpdateTwitterStatus(userName, status, this, app42callfuncND_selector(Sample_Class::onSocialServiceRequestCompleted));
void Sample_Class::onSocialServiceRequestCompleted(App42CallBack *sender, void *response)
{
    App42SocialResponse *app42SocialResponse = (App42SocialResponse*)response;
    
    if(app42SocialResponse->isSuccess)
    {
        printf("\ncode=%d",app42SocialResponse->getCode());
        printf("\nisSuccess=%d",app42SocialResponse->isSuccess);
        
        // Handle success response here
    }
    else
    {
        printf("\nerrordetails:%s",app42SocialResponse->errorDetails.c_str());
        printf("\nerrorMessage:%s",app42SocialResponse->errorMessage.c_str());
        printf("\nappErrorCode:%d",app42SocialResponse->appErrorCode);
        printf("\nhttpErrorCode:%d",app42SocialResponse->httpErrorCode);
        int appErrorCode = app42SocialResponse->appErrorCode;
		int httpErrorCode = app42SocialResponse->httpErrorCode;
		if(appErrorCode == 3800)
		{
			// Handle here for Not Found (Twitter App Credentials(ConsumerKey / ConsumerSecret) does not exist.)
		}
		else if(appErrorCode  == 3801)
		{
			// Handle here for Bad Request (The request is Unauthorized with the provided credentials.)
		}
		else if(appErrorCode  == 3802)
		{
			// Handle here for Not Found (Twitter User Access Credentials does not exist. Please use linkUserTwitterAccount API to link the User Twitter account.)
		}
		else if(appErrorCode  == 3803)
		{
			// Handle here for Bad Request (The Twitter Access Credentials are invalid.)
		}
		else if(appErrorCode == 1401)
		{
			// handle here for Client is not authorized
		}
		else if(appErrorCode == 1500)
		{
			// handle here for Internal Server Error
		}
    }
}
Coming Soon
var userName:String = "Nick";                  
var status:String = "Nick is using the App42 API";
App42API.initialize("API_KEY","SECRET_KEY");
var socialService:SocialService = App42API.buildSocialService(); 
socialService.updateTwitterStatus(userName,status, new callback());    
public class callback implements App42CallBack    
{     
    public function onSuccess(response:Object):void    
    {    
       var social:Social = Social(response);  
        trace("response is :" + social)   
    }    
    public function onException(exception:App42Exception):void    
    {    
        var appErrorCode:int = exception.getAppErrorCode();    
        var httpErrorCode:int = exception.getHttpErrorCode();    
        if(appErrorCode == 3800)  
        {  
            // Handle here for Not Found (Twitter App Credentials(ConsumerKey / ConsumerSecret) does not exist.)
		}
        else if(appErrorCode  == 3802)  
        {  
            // Handle here for Not Found (Twitter User Access Credentials does not exist. Please use linkUserTwitterAccount API to link the User Twitter account.)
		}
		else if(appErrorCode  == 3803)
		{
		// Handle here for Bad Request (The Twitter Access Credentials are invalid.)
		}
        else if(appErrorCode == 1401)  
        {  
            // handle here for Client is not authorized  
        }  
        else if(appErrorCode == 1500)  
        {  
            // handle here for Internal Server Error  
        }  
    }     
} 
Coming Soon
String userName = "Nick";
String status = "Nick is using the App42 API";
App42API.initialize("API_KEY","SECRET_KEY");
SocialService socialService = App42API.buildSocialService(); 
try
{
	Social social = socialService.updateTwitterStatus(userName, status);
}
catch(App42Exception ex) 
{
	int appErrorCode = ex.getAppErrorCode();
	int httpErrorCode = ex.getHttpErrorCode();
	if(appErrorCode == 3800)
	{
		// Handle here for Not Found (Twitter App Credentials(ConsumerKey / ConsumerSecret) does not exist.)
	}
	else if(appErrorCode  == 3801)
	{
		// Handle here for Bad Request (The request is Unauthorized with the provided credentials.)
	}
	else if(appErrorCode  == 3802)
	{
		// Handle here for Not Found (Twitter User Access Credentials does not exist. Please use linkUserTwitterAccount API to link the User Twitter account.)
	}
	else if(appErrorCode  == 3803)
	{
		// Handle here for Bad Request (The Twitter Access Credentials are invalid.)
	}
	else if(appErrorCode == 1401)
	{
		// handle here for Client is not authorized
	}
	else if(appErrorCode == 1500)
	{
		// handle here for Internal Server Error
	}
	String jsonText = ex.getMessage(); 	
}    
Error Codes

Functions in Session 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. 3800 - NOT FOUND - Twitter App Credentials(ConsumerKey / ConsumerSecret) does not exist. 3802 - NOT FOUND - Twitter User Access Credentials does not exist. Please use linkUserTwitterAccount API to link the User Twitter account. 3803 - BAD REQUEST - The Twitter Access Credentials are invalid." + &lt;Exception Message>. 3804 - NOT FOUND - Facebook App Credentials(ConsumerKey/ConsumerSecret) does not exist. 3805 - BAD REQUEST - The Facebook Access Credentials are invalid + &lt;Received Facebook Exception Message>. 3806 - NOT FOUND - Facebook User Access Credentials does not exist. Please use linkUserFacebookAccount API to link the User facebook account. 3807 - NOT FOUND - LinkedIn App Credentials(ApiKey/SecretKey) does not exist. 3808 - BAD REQUEST - The Access Credentials are invalid + &lt;Exception Message>. 3809 - NOT FOUND - LinkedIn User Access Credentials does not exist. Please use linkUserLinkedInAccount API to link the User LinkedIn account. 3810 - NOT FOUND - Social App Credentials do not exist. 3811 - NOT FOUND - User Social Access Credentials do not exist. Please use linkUserXXXXXAccount API to link the User Social account.