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