300+ App42 Cloud APIs – Backend as a Service (BaaS, MBaaS)
Posted on Sep 13, 2012 by Siddhartha
String queueName ="MyQueue"; String msg = "Its a Real Message"; long exp = 10000; App42Callback requestCallback = this; /* This function used the App42Callback interface */ ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); QueueService queueService = api.BuildQueueService(); queueService.SendMessage(queueName, msg, exp, requestCallback); OnSuccess(Object obj) { Queue queue = (Queue) obj; String jsonResponse = queue.ToString(); } public class CallBack : App42Callback { public override void OnSuccess(Object obj) { Queue queue = (Queue) obj; //Do whatever you want with the object } public override void OnException(App42Exception e) { //Do whatever you want with the exception } }
String queueName = "MyQueue"; String msg = "Its a Real Message"; long exp = 100000; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); QueueService queueService = api.buildQueueService(); Queue queue = queueService.sendMessage(queueName, msg, exp); String jsonResponse = queue.toString();
String queueName = "MyQueue"; String msg = "Its a Real Message"; long exp = 100000; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); QueueService queueService = api.buildQueueService(); Queue queue = queueService.sendMessage(queueName, msg, exp); String jsonResponse = queue.toString();
NSString *queueName = @"MyQueue"; NSString *msg = @"Its a Real Message"; long exp = 100000; ServiceAPI *serviceAPIObj = [[ServiceAPI alloc]init]; serviceAPIObj.apiKey = @"<API_KEY>"; serviceAPIObj.secretKey = @"<SECRET_KEY>"; QueueService *queueService = [serviceAPIObj buildQueueService]; Queue *queue = [queueService sendMessage:queueName message:msg expiryTime:exp]; NSString *jsonResponse = [queue toString];
String queueName = "MyQueue"; String msg = "Its a Real Message"; long exp = 100000; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); QueueService queueService = api.buildQueueService(); Queue queue = queueService.sendMessage(queueName, msg, exp); String jsonResponse = queue.toString();
String queueName = "MyQueue"; String msg = "Its a Real Message"; long exp = 100000; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); QueueService queueService = api.BuildQueueService(); Queue queue = queueService.SendMessage(queueName, msg, exp); String jsonResponse = queue.ToString();
queueName = "MyQueue"; msg = "Its a Real Message"; exp = 100000; api = App42::ServiceAPI.new("<API_KEY>","<SECRET_KEY>"); queueService = api.buildQueueService(); queue = queueService.send_message(queueName, msg, exp); jsonResponse = queue.to_s();
The request format for sendMessage is URL : https://api.shephertz.com/cloud/1.0/message/{queueName} Method : POST QueryParam : apiKey=<apiKey>&signature=<signature>&version=<version>×tamp=<UTC_FORMATED_TIME_STAMP> Accept : application/json Content-Type : application/json Body: {"app42": {"payLoad": {"message": "sending message","expiration": 600000}}}
Comming Soon...
$queueName = "MyQueue"; $msg = "Its a Real Message"; $exp = 100000; $api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); $queueService = $api->buildQueueService(); $queue = $queueService->sendMessage($queueName, $msg, $exp); $jsonResponse = $queue->toString();
String queueName ="MyQueue"; long receiveTimeOut = 10000; App42Callback requestCallback = this; /* This function used the App42Callback interface */ ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); QueueService queueService = api.BuildQueueService(); queueService.ReceiveMessage(queueName, receiveTimeOut,requestCallback); OnSuccess(Object obj) { Queue queue = (Queue) obj; String jsonResponse = queue.ToString(); } public class CallBack : App42Callback { public override void OnSuccess(Object obj) { Queue queue = (Queue) obj; //Do whatever you want with the object } public override void OnException(App42Exception e) { //Do whatever you want with the exception } }
String queueName ="MyQueue"; long receiveTimeOut = 10000; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); QueueService queueService = api.buildQueueService(); Queue queue = queueService.receiveMessage(queueName, receiveTimeOut); String jsonResponse = queue.toString();
String queueName ="MyQueue"; long receiveTimeOut = 10000; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); QueueService queueService = api.buildQueueService(); Queue queue = queueService.receiveMessage(queueName, receiveTimeOut); String jsonResponse = queue.toString();
NSString *queueName = @"MyQueue"; long receiveTimeOut = 10000; ServiceAPI *serviceAPIObj = [[ServiceAPI alloc]init]; serviceAPIObj.apiKey = @"<API_KEY>"; serviceAPIObj.secretKey = @"<SECRET_KEY>"; QueueService *queueService = [serviceAPIObj buildQueueService]; Queue *queue = [queueService receiveMessage:queueName receiveTimeOut:receiveTimeOut]; NSString *jsonResponse = [queue toString];
String queueName ="MyQueue"; long receiveTimeOut = 10000; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); QueueService queueService = api.buildQueueService(); Queue queue = queueService.receiveMessage(queueName, receiveTimeOut); String jsonResponse = queue.toString();
String queueName ="MyQueue"; long receiveTimeOut = 10000; ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); QueueService queueService = api.BuildQueueService();7 Queue queue = queueService.ReceiveMessage(queueName, receiveTimeOut); String jsonResponse = queue.ToString();
queueName ="MyQueue"; receiveTimeOut = 10000; api = App42::ServiceAPI.new("<API_KEY>","<SECRET_KEY>"); queueService = api.buildQueueService(); queue = queueService.receive_message(queueName, receiveTimeOut); jsonResponse = queue.to_s();
The request format for receiveMessage is URL : https://api.shephertz.com/cloud/1.0/message/{queueName}/{receiveTimeOut} Method : GET QueryParam : apiKey=<apiKey>&signature=<signature>&version=<version>×tamp=<UTC_FORMATED_TIME_STAMP> Accept : application/json Content-Type : application/json
Coming Soon...
$queueName ="MyQueue"; $receiveTimeOut = 10000; $api = new ServiceAPI("<API_KEY>","<SECRET_KEY>"); $queueService = $api->buildQueueService(); $queue = $queueService->receiveMessage($queueName, $receiveTimeOut); $jsonResponse = $queue->toString();