SMS Service
List of all options:
- Get list of all supported regions
- Send SMS message
- Send SMS message to a user
Initialize service
TrivoreID sdk = TrivoreID.mgmtApiClient();
SMSServiceImpl smsService = new SMSServiceImpl(sdk.smsService());
Get list of all supported regions
List<Region> regions = smsService.getSupportedRegions();
Send SMS message
SMSMessage message = new SMSMessage();
message.setTo("+3584012345678");
message.setText("Example text body.");
smsService.send(message);
Send SMS message to a user
SMSMessage message = new SMSMessage();
message.setText("Example text body.");
message.setMessageClass(1);
smsService.sendToUser(message, "userId");
Send SMS message to all group members
Sending SMS message to all primary (first) mobile numbers of users that belong to the defined groups.
SMSMessage message = new SMSMessage();
message.setText("Example text body.");
message.setMessageClass(1);
// This will send SMS message to all members of the groups (can be group IDs or names).
// If the group was not found within defined namespace, then the warning message will be logged.
// The maximum number of groups is 20 due to the limited length of the URL.
smsService.sendToGroupMembers(message, "nsCode", "group001", "group002", "group003");