300+ App42 Cloud APIs – Backend as a Service (BaaS, MBaaS)
Posted on September 13, 2012 by Siddhartha
String userName = "Nick"; App42Callback requestCallback = this; /* This function used the App42Callback interface */ ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); SessionService sessionService = api.BuildSessionService(); sessionService.GetSession(userName,requestCallback); OnSuccess(Object obj) { Session session = (Session) obj; String jsonResponse = session.ToString(); } public class CallBack : App42Callback { public override void OnSuccess(Object obj) { Session session = (Session) obj; //Do whatever you want with the object } public override void OnException(App42Exception e) { //Do whatever you want with the exception } }
String userName = "Nick"; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); SessionService sessionService = api.buildSessionService(); Session session = sessionService.getSession(userName); String jsonResponse = session.toString();
String userName = "Nick"; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); SessionService sessionService = api.buildSessionService(); Session session = sessionService.getSession(userName); String jsonResponse = session.toString();
NSString *userName = @"Nick"; ServiceAPI *serviceAPIObj = [[ServiceAPI alloc]init]; serviceAPIObj.apiKey = @"<API_KEY>"; serviceAPIObj.secretKey = @"<SECRET_KEY>"; SessionService *sessionService = [serviceAPIObj buildSessionService]; Session *session = [sessionService getSession:userName]; NSString *jsonResponse = [session toString];
String userName = "Nick"; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); SessionService sessionService = api.buildSessionService(); Session session = sessionService.getSession(userName); String jsonResponse = session.toString();
String userName = "Nick"; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); SessionService sessionService = api.BuildSessionService(); Session session = sessionService.GetSession(userName); String jsonResponse = session.ToString();
userName = "Nick"; api = App42::ServiceAPI.new("<API_KEY>","<SECRET_KEY>"); sessionService = api.buildSessionService(); session = sessionService.get_session(userName); jsonResponse = session.to_s();
The request format for getSession is URL : https://api.shephertz.com/cloud/1.0/session Method : POST QueryParam : apiKey=<apiKey>&signature=<signature>&version=<version>×tamp=<UTC_FORMATED_TIME_STAMP> Accept : application/json Content-Type : application/json Body : {"app42": {"session": {"userName": "Nick",}}}
var session = new App42Session(); var userName = "Nick"; // In order to use the various functions available under a particular API, a developer will have to call the // App42.initialize method by passing the apiKey and the secretKey. App42.initialize("<API_KEY>","<SECRET_KEY>"); session.getSession(userName,{ success: function(object) { // Session Object creation }, error: function(error) { // Session exception handled } });
$userName = "Nick"; $api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); $sessionService = $api->buildSessionService(); $session = $sessionService->getSession($userName); $jsonResponse = $session->toString();
String sessionId = "48dacb76-7f5e-4011-ac24-e09623bdc70f"; String attributeName = "attributeName01"; String attributeValue = "attributeValue01"; App42Callback requestCallback = this; /* This function used the App42Callback interface */ ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); SessionService sessionService = api.BuildSessionService(); sessionService.SetAttribute(sessionId, attributeName, attributeValue,requestCallback); OnSuccess(Object obj) { Session session = (Session) obj; String jsonResponse = session.ToString(); } public class CallBack : App42Callback { public override void OnSuccess(Object obj) { Session session = (Session) obj; //Do whatever you want with the object } public override void OnException(App42Exception e) { //Do whatever you want with the exception } }
String sessionId = "48dacb76-7f5e-4011-ac24-e09623bdc70f"; String attributeName = "attributeName01"; String attributeValue = "attributeValue01"; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); SessionService sessionService = api.buildSessionService(); Session session = sessionService.setAttribute(sessionId, attributeName, attributeValue); String jsonResponse = session.toString();
String sessionId = "48dacb76-7f5e-4011-ac24-e09623bdc70f"; String attributeName = "attributeName01"; String attributeValue = "attributeValue01"; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); SessionService sessionService = api.buildSessionService(); Session session = sessionService.setAttribute(sessionId, attributeName, attributeValue); String jsonResponse = session.toString();
NSString *sessionId = @"48dacb76-7f5e-4011-ac24-e09623bdc70f"; NSString *attributeName = @"attributeName01"; NSString *attributeValue = @"attributeValue01"; ServiceAPI *serviceAPIObj = [[ServiceAPI alloc]init]; serviceAPIObj.apiKey = @"<API_KEY>"; serviceAPIObj.secretKey = @"<SECRET_KEY>"; SessionService *sessionService = [serviceAPIObj buildSessionService]; Session *session = [sessionService setAttribute:sessionId attributeName:attributeName attributeValue:attributeValue]; NSString *jsonResponse = [session toString];
String sessionId = "48dacb76-7f5e-4011-ac24-e09623bdc70f"; String attributeName = "attributeName01"; String attributeValue = "attributeValue01"; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); SessionService sessionService = api.buildSessionService(); Session session = sessionService.setAttribute(sessionId, attributeName, attributeValue); String jsonResponse = session.toString();
String sessionId = "48dacb76-7f5e-4011-ac24-e09623bdc70f"; String attributeName = "attributeName01"; String attributeValue = "attributeValue01"; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); SessionService sessionService = api.BuildSessionService(); Session session = sessionService.SetAttribute(sessionId, attributeName, attributeValue); String jsonResponse = session.ToString();
sessionId = "48dacb76-7f5e-4011-ac24-e09623bdc70f"; attributeName = "attributeName01"; attributeValue = "attributeValue01"; api = App42::ServiceAPI.new("<API_KEY>","<SECRET_KEY>"); sessionService = api.buildSessionService(); session = sessionService.set_attribute(sessionId, attributeName, attributeValue); jsonResponse = session.to_s();
The request format for setAttribute is URL : https://api.shephertz.com/cloud/1.0/session/id/{sessionId} Method : POST QueryParam : apiKey=&signature= &version= ×tamp= Accept : application/json Content-Type : application/json Body : {"app42": {"session": {"name": "attributeName01","value": "attributeValue01"}}}
var session = new App42Session(); var sessionId = "48dacb76-7f5e-4011-ac24-e09623bdc70f"; var attributeName = "attributeName"; var attributeValue = "attributeValue"; // In order to use the various functions available under a particular API, a developer will have to call the // App42.initialize method by passing the apiKey and the secretKey. App42.initialize("<API_KEY>","<SECRET_KEY>"); session.setAttribute(sessionId, attributeName, attributeValue,{ success: function(object) { // Session Object creation }, error: function(error) { // Session exception handled } });
$sessionId = "48dacb76-7f5e-4011-ac24-e09623bdc70f"; $attributeName = "attributeName01"; $attributeValue = "attributeValue01"; $api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); $sessionService = $api->buildSessionService(); $session = $sessionService->setAttribute($sessionId, $attributeName, $attributeValue); $jsonResponse = $session->toString();