hoiio.service.sms

class hoiio.service.sms.Sms

Provide SMS services such as sending and querying for SMS.

Usage: Hoiio.sms.send(...), Hoiio.sms.history(...), etc.

bulk_send(msg, *dests, **kwargs)

Send SMS to multiple phone numbers (up to 1,000).

Parameters:
  • dests – List of phone numbers to send SMS to
  • msg – The SMS message
  • sender_name – The sender name that will be displayed to dest
  • tag – Your own reference tag for this transaction
  • notify_url – A notification URL for Hoiio to SMS to your web server
Returns:

Return hoiio.service.Response

history(**kwargs)

Retrieve the history of SMS. There is pagination, and each page returns up to 100 entries.

Parameters:
  • from (string) – SMS sent/received after this date. In “YYYY-MM-DD HH:MM:SS” (GMT+8) format.
  • to (string) – SMS sent/received made before this date. In “YYYY-MM-DD HH:MM:SS” (GMT+8) format.
  • page (int) – The page number. Count starts from 1.
Returns:

Return hoiio.service.Response

rate(msg, dest, **kwargs)

Retrieve the cost of sending an SMS

Parameters:
  • msg – The SMS message
  • dest – The phone number to send SMS to
Returns:

Return hoiio.service.Response

rate_in(dest, **kwargs)

Retrieve the cost of sending an SMS

Parameters:dest – The phone number to receive the SMS at
Returns:Return hoiio.service.Response
send(msg, dest, **kwargs)

Send a SMS to a phone

Parameters:
  • msg – The SMS message
  • dest – The phone number to send SMS to
  • sender_name – The sender name that will be displayed to dest
  • tag – Your own reference tag for this transaction
  • notify_url – A notification URL for Hoiio to SMS to your web server
Returns:

Return hoiio.service.Response

status(txn_ref, **kwargs)

Retrieve the status and various information about an SMS

Parameters:txn_ref – The transaction reference for the SMS
Returns:Return hoiio.service.Response