Manage Messages Sample

A command line console application that provides access to the SMS and MMS messaging facilities of the Aculab Cloud Web Services API.

Usage

python manage_messages.py [--wsserver <cloudWebServerAddress>] <cloudId> <username> <apiAccessKey> <command>

Arguments

cloudWebServerAddress

The address of the cloud web server. By default the wrappers call web services on https://ws-<cloudId>.aculabcloud.net. In certain circumstances you may need to use a different address which you can set here.

cloudId

Cloud region id (e.g. 1-2-0)

username

Cloud account username

apiAccessKey

Cloud API Access key

command

One of the following...

sendsms | send <to> <from> <content> [<statusPage> [<requestDeliveryReport> [<alphanumericId>]]]

sendmms <to> <from> <msgMediaList> [<content> [<statusPage> [<requestDeliveryReport> [<alphanumericId>]]]]

status <messageId> [<messageId> ...]

cancel <messageId> [<messageId> ...]

blockedto <toNumber>

blockedfrom <fromNumber>

Where...

to

The number to send the message to. This must be a full international number without any leading +.

from

The number from which the message will be sent. This must be one of your numbers. This must be a full international number without any leading +.

content

The textual content of your message. Required when sending SMS, optional when sending MMS.

msgMediaList

A comma separated list of message media files to include in the message.

statusPage

The URL of a web page to which message status updates will be sent. Default is an empty string, meaning no status updates will be sent.

requestDeliveryReport

'true' or 't' to specify that a delivery report is requested (case-insensitive). All other values will not request a delivery report. Default is 'false'.

messageId

The message ID to act on, as returned by the send command. More than one may be specified.

toNumber

A mobile number. The returned list will contain all your numbers which are blocked for sending to this number.

fromNumber

One of your numbers. The returned list will contain all mobile numbers which this number is blocked for sending to.

alphanumericId

The string to replace the from field with.

Note

For users running Python 2 under Windows, this tool does not support command line arguments containing non-ASCII characters. If you wish to specify command line arguments containing non-ASCII characters, please use Python 3.

Examples

  1. Send an SMS message

    python manage_messages.py 1-2-0 bob@acompany.com 6b4UmwoOPxjeI2M76aebfQ sendsms 441098654321 441098654321 "A useful text message."
    
  2. Send an MMS message

    python manage_messages.py 1-2-0 bob@acompany.com 6b4UmwoOPxjeI2M76aebfQ sendmms 441098654321 441098654321 Aculab.png "A message with a logo."
    
  3. Get the status of a message

    python manage_messages.py 1-2-0 bob@acompany.com 6b4UmwoOPxjeI2M76aebfQ status 2e891aea_0.1366641192.77820
    
  4. Get the status of several messages

    python manage_messages.py 1-2-0 bob@acompany.com 6b4UmwoOPxjeI2M76aebfQ status 2e891aea_0.1366641192.77823 2e891aea_0.1366641192.77822
    
  5. Cancel a message

    python manage_messages.py 1-2-0 bob@acompany.com 6b4UmwoOPxjeI2M76aebfQ cancel 2e891aea_0.1366641192.77832
    
  6. Cancel several messages

    python manage_messages.py 1-2-0 bob@acompany.com 6b4UmwoOPxjeI2M76aebfQ cancel 2e891aea_0.1366641192.77831 2e891aea_0.1366641192.77832 2e891aea_0.1366641192.77833
    
  7. Get blocked to numbers

    python manage_messages.py 1-2-0 bob@acompany.com 6b4UmwoOPxjeI2M76aebfQ blockedto 441098654321
    
  8. Get blocked from numbers

    python manage_messages.py 1-2-0 bob@acompany.com 6b4UmwoOPxjeI2M76aebfQ blockedfrom 441098654321