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();