NOTE: Trivore ID Documentation has moved to https://trivoreid.com
The content on this site IS OUT OF DATE!
This space has been archived!
Please go ahead to the new site!
SMS Service (python)
List of all options:
- Get list of all supported regions
- Send SMS message
- Send SMS message to a user
Get list of all supported regions
regions = api.sms_service.get_supported_regions() print(regions[5:10])
Send SMS message
from trivoreid.models.sms import SMSMessage msg = SMSMessage() msg.to = '+358401234567' msg.to_name = 'John Smith' msg.to_region = 'FI' msg.from_name = 'trivoreid' msg.messageClass = 1 msg.text = 'Example message' # send using JSON playload response = api.sms_service.send(msg, json_playload=True) # send using query parameters response2 = api.sms_service.send(msg) print(response)
Send SMS message to a user
from trivoreid.models.sms import SMSMessage msg = SMSMessage() msg.to_name = 'John Smith' msg.to_region = 'FI' msg.from_name = 'trivoreid' msg.messageClass = 1 msg.text = 'Example message' response = api.sms_service.send_to_user(userId, msg)
Send SMS message to all group members
Sending SMS message to all primary (first) mobile numbers of users that belong to the defined groups.
message = SMSMessage({'text' : 'example text'}) api.sms_service.send_to_group_members(nsCode, message, 'groupName1', 'groupName2', 'groupName3')