Demos
Check out our demos, find out how it works and what’s under the hood!
Send SMS
SMS will be sent to your GSM number.
// First initialize the messaging client
$smsClient = new SmsClient(USERNAME, PASSWORD);
$client->login();
// Prepare the message
$smsMessage = new SMSRequest();
$smsMessage->senderAddress = SENDER_ADDRESS;
$smsMessage->address = DESTINATION_ADDRESS;
$smsMessage->message = 'Test message';
// Send the message
$smsMessageSendResult = $smsClient->sendSMS($smsMessage);
// The client correlator is a unique identifier of this api call
$clientCorrelator = $smsMessageSendResult->clientCorrelator;
// Query for the delivery status of the message
$smsMessageStatus = $smsClient->queryDeliveryStatus(
$smsMessageSendResult
);
$deliveryStatus = $smsMessageStatus->deliveryInfo[0]->deliveryStatus;
// First initialize the messaging client using your username and password
// Set proxy script URL
OA.setProxy("/proxy/cdproxy.php");
// Call init method
if(!oneapi.init()) {
// Handle errors
// ...
} else {
// Init sucessfull
}
// Then login with the client
oneapi.login(sUserName,sUserPassword,function(isOk,oResponse) {
if(!isOk) { // oResponse is DmApiError
// Handle error
// alert('Unable to login:' + oResponse.getErrorText());
} else { // oResponse is DmUserCredentials
// Check user credentials or call other API methods
if(!oResponse.isVerified()) { // Check if user is verified
// alert("Please verify your account.");
}
}
});
// Prepare the message
// Message will be sent to GSM number from user CustomerProfile
var oMessage = FM.DmObject.newObject("SMSMessage", {
senderAddress: oProfile.getAttr("gsm"),
senderName: oProfile.getAttr("username"),
message: 'Welcome to Parseco',
address: oProfile.getAttr("gsm")
});
// Send the message
oneapi.sendSMS(oMessage,function(isOk,oResourceRef) {
if(!isOk) { // oResourceRef is DmApiError
// Handle error
// alert('Unable to send SMS:' + oResponse.getErrorText());
} else { // oResourceRef DmResourceReference
// Handle response
// alert("Message sent. Resource URL is " +
// oResourceRef.getDataID());
}
});
// Later you can query for the delivery status of the message
oneapi.queryDeliveryStatus(
address,clientCorrelator,
function(isOk,oResponse) {
if(!isOk) { // oResponse is DmApiError
// Handle error
// alert('Unable to query deivery status:' +
// oResponse.getErrorText());
} else { // oResponse is array of DmDeliveryInfo objects
for(var i=0; i < oResponse.length; i++) {
// ...
}
}
});
# First initialize the messaging client
sms_client = oneapi.SmsClient(username, password)
# Prepare the message
sms = models.SMSRequest()
sms.sender_address = address
sms.address = address
sms.message = 'Test message'
sms.callback_data = 'Any string'
# Send the message
result = sms_client.send_sms(sms)
# store client correlator
# because we can later query for the delivery status
client_correlator = result.client_correlator
# Later you can query for the delivery status of the message
query_status = sms_client.query_delivery_status(client_correlator)
delivery_status = query_status.delivery_info[0].delivery_status
// First initialize the messaging client
Configuration configuration = new Configuration(username, password);
SMSClient smsClient = new SMSClient(configuration);
// Prepare the message
SMSRequest smsRequest = new SMSRequest(
senderAddress, message, recipientAddress
);
// Send the message
// Store request id because we can later query for the delivery status
string requestId = smsClient.SmsMessagingClient.SendSMS(smsRequest);
// Later you can query for the delivery status of the message
DeliveryInfoList deliveryInfoList =
smsClient.SmsMessagingClient.QueryDeliveryStatus(
senderAddress, requestId
);
string deliveryStatus = deliveryInfoList.DeliveryInfos[0].DeliveryStatus;
Number context query
Find out more about your users.
// First initialize the messaging client
$smsClient = new SmsClient(USERNAME, PASSWORD);
$client->login();
// Retrieve the roaming status (HLR)
$response = $client->retrieveRoamingStatus(DESTINATION_ADDRESS);
// First initialize the messaging client using your username and password
// Set proxy script URL
OA.setProxy("/proxy/cdproxy.php");
// Call init method
if(!oneapi.init()) {
// Handle errors
// ...
} else {
// Init sucessfull
}
// Then login with the client
oneapi.login(sUserName,sUserPassword,function(isOk,oResponse) {
if(!isOk) { // oResponse is DmApiError
// Handle error
// alert('Unable to login:' + oResponse.getErrorText());
} else { // oResponse is DmUserCredentials
// Check user credentials or call other API methods
if(!oResponse.isVerified()) { // Check if user is verified
// alert("Please verify your account.");
}
}
});
// Query roaming status of GSM number from user CustomerProfile
oneapi.retrieveRoamingStatus(
oProfile.getAttr("gsm"),null,null, null, null,
function(isOk,oResponse) {
if(!isOk) { // oResponse is DmApiError
// Handle error
// alert('Unable to query roaming status: ' +
// oResponse.getErrorText());
} else { // oResponse DmTerminalRoamingStatus
// Handle response
// alert("Status is " +
// oResponse.getAttr('retrievalStatus','unknown'));
}
}
);
# Initialize and login the data connection client
data_connection_client = oneapi.DataConnectionProfileClient(username, password)
# Retrieve the roaming status (HLR)
response = data_connection_client.retrieve_roaming_status(destination_address)
// Initialize and login the data connection client
Configuration configuration = new Configuration(username, password);
SMSClient smsClient = new SMSClient(configuration);
// Retrieve the roaming status (HLR)
Roaming roaming = smsClient.HlrClient.QueryHLR(address);
Receive and Send an SMS (2 WAY)
Trigger events on your app with a text message.
// First initialize the messaging client
$smsClient = new SmsClient(USERNAME, PASSWORD);
$client->login();
// Retrieve inbound messages
$inboundMessages = $smsClient->retrieveInboundMessages();
foreach($inboundMessages->inboundSMSMessage as $message) {
echo $message;
}
// Initialize the messaging client using your username and password
// Set proxy script URL
OA.setProxy("/proxy/cdproxy.php");
// Call init method
if(!oneapi.init()) {
// Handle errors
// ...
} else {
// Init sucessfull
}
// Then login with the client
oneapi.login(sUserName,sUserPassword,function(isOk,oResponse) {
if(!isOk) { // oResponse is DmApiError
// Handle error
// alert('Unable to login:' + oResponse.getErrorText());
} else { // oResponse is DmUserCredentials
// Check user credentials or call other API methods
if(!oResponse.isVerified()) { // Check if user is verified
// alert("Please verify your account.");
}
}
});
// Retrieve inbound messages
oneapi.retrieveInboundMessages(1,99,function(isOk,oResponse) {
if(!isOk) { // oResponse is DmApiError
// Handle error
// alert('Unable to retrieve inbound messages: ' +
// oResponse.getErrorText());
} else { // oResponse is array of DmInboundMessage objects
for(var i=0; i < oResponse.length; i++) {
// ...
}
}
});
# First initialize the messaging client
sms_client = oneapi.SmsClient(username, password)
# Retrieve inbound messages
result = sms_client.retrieve_inbound_messages()
// First initialize the messaging client
Configuration configuration = new Configuration(username, password);
SMSClient smsClient = new SMSClient(configuration);
// Retrieve inbound messages
InboundSMSMessageList inboundSMSMessageList =
smsClient.SmsMessagingClient.GetInboundMessages();