Messages

/v2/message/simple_send

Lodge a message with given text to be sent to a given recipient. A From header can be defined as well as a scheduled send time.

Authentication: In order to use this method you must be authenticated using one of the supported methods.

Parameters

  • Message - the message to send
  • Recipient - the number to send the message to
  • SendAt - (optional) time to send the message. Defaults to immediate send.
  • From - (optional) used as the sender of the message. If none provided uses a default from the MessageNet pool.

Return Values

  • 200 - Success.
  • 401 - Credentials failed.

Content will contain

Example Request

POST /v2/message/simple_send HTTP/1.1
Host: api.messagenet.com.au
Authorization: Bearer 12345
Content-Type: application/json
Accept: application/json
{
  "SendAt":"2015-12-24T12:00:00+10:00",
  "Message": "Have you been good this year?",
  "Recipient":"61400111222",
  "From":"Santa"
}

And an example response

{
  "Data": {
    "Message": {
      "PhoneNumber": "61400111222",
      "MessageId": "20151224130000812923",
      "Status": "ACTIVE"
    }
  },
  "Status": "Success",
  "StatusCode": 200
}

/v2/message/send

Lodges one or more messages to be sent to recipients.

If a single message to a single recipient is lodged, the message will be created immediately. If multiple recipients are lodged, the creation of the messages will be batched and a batch code will be returned.

Authentication: In order to use this method you must be authenticated using one of the supported methods.

Parameters

  • Message - the message to send
  • Recipients - an array of numbers to send the message to. (max 100 recipients)
  • Source - (optional) used as the sender of the message. If none provided uses a default from the MessageNet pool.
  • SendAt - (optional) the time to send the messages.
  • ReplyType - (optional) set the reply type for the messages.
  • ReplyPath - (optional) set the reply path for the messages.
  • ExternalSystemId - (optional) an Id from your own system. This Id will be returned when retrieving the message status.
  • Tags - (optional) comma seperated tags that you may apply to the message. These tags will be returned when retrieving the message status.

Note

If an ExternalSystemId is provided in batch of messages, it will be applied to all messages. If you need to apply an ExternalSystemId to individual messages you must send them one by one.

Return Values

  • 200 - Success.
  • 400 - Invalid request data
  • 401 - Credentials failed.

Content will contain:

  • Message - a MessageStatus data type
  • BatchCode - The id of a batch file.

Note

To set what the recipient sees at the sender of the message, set the value of reply_type to HEADER and put the sender value in reply_path.

If more than one message is provided is provided, a batch file will be created and background loaded by the MessageNet system and messages lodged to be sent. The progress of the batch file can be queried using Message/Status

Example Request

Sending a single message

POST /v2/message/send HTTP/1.1
Host: api.messagenet.com.au
Authorization: Bearer 12345
Content-Type: application/json
Accept: application/json
{
  "SendAt":"2015-12-24T12:00:00+10:00",
  "Message": "Have you been good this year?",
  "Recipients":["61400111222"],
  "Source": "ENTER YOUR PHONE NUMBER HERE",
  "ExternalSystemId":"1001",
  "Tags":"query,dasher"
}

And an example response

{
    "Data": {
    "Message": {
      "PhoneNumber": "61400111222",
      "MessageId": "20151224130000812923",
      "Status": "ACTIVE",
      "ExternalSystemId": "1001",
      "Tags": "query,dasher"
    }
  },

"Status": "Success", "StatusCode": 200 }

Sending multiple messages

POST /v2/message/send HTTP/1.1
Host: api.messagenet.com.au
Authorization: Bearer 12345
Content-Type: application/json
Accept: application/json
{
  "SendAt":"2015-12-24T12:00:00+10:00",
  "Message": "Have you been good this year?",
  "Recipients":["61400111222","61400111333"],
  "ReplyType": "HEADER",
  "ReplyPath":"Santa"
}

And an example response

{
  "Data": {
    "BatchCode": "batchFile1"
  },
  "Status": "Success",
  "StatusCode": 200
}

/v2/message/status

This is used to query the status of a message or batch file.

Authentication: In order to use this method you must be authenticated using one of the supported methods.

Parameters

  • message_id - the id of a single message.
  • batch_code - the id of a batch file. Will return status for all messages included in the batch file.

Only one parameter can be passed in a single request. If multiple are sent the request will fail.

Return Value

  • 200 - Success.
  • 400 - Both a message_id and batch_code were supplied.
  • 401 - Credentials failed.
  • 403 - Message or batch does not belong to the account.
  • 404 - Message or batch does not exist.

Content will contain an array of

  • PhoneNumber - the number the message was sent to.
  • MessageId - the internal id of the message.
  • Status - the status of the message within the system
Statuses
  • UNKNOWN
  • ACTIVE
  • Blocked
  • CANC
  • DELETED
  • DELIV
  • ERRBLK
  • ERROR
  • EXPIRED
  • LODGED
  • PAUSE
  • PEND
  • REJECTD
  • SENT
  • SUBMITTED
  • TRYMAX
  • UNDELIV

Example Request

GET /v2/message/status?message_id=20200101130000113313 HTTP/1.1
Host: api.messagenet.com.au
Authorization: Bearer 12345

And an example response

[
  {
    "PhoneNumber": "61400111222",
    "MessageId": "20200101130000113313",
    "Status": "ACTIVE",
      "ExternalSystemId": "1001",
      "Tags": "alert,system1"
  }
]

/v2/message/logs

Retrieves details of messges sent by the account.

Authentication: In order to use this method you must be authenticated using one of the supported methods.

Parameters

  • From - retrieve messages sent on or after this date and time.
  • To - retrieve messages sent before at at this date and time.
  • Page - (optional) the page number of results to retreive. Defaults to gae 1
  • PageSize - (optional) the maximum number of results to retreive per page. Defaults to 500. Maximum page size permitted is 1000.

Only one parameter can be passed in a single request. If multiple are sent the request will fail.

Return Values

  • 200 - Success.
  • 401 - Credentials failed.

Content returned will be the total number of records that fit the search results, and array of objects with the following properties.

  • MessageId - the internal id of the message.
  • Status - the status of the message within the system.
  • DateSent - Date and time the message was sent. Provided in UTC format.
  • DateLodged - Date and time the message was lodged. Provided in UTC format.
  • DeliveryReceiptReceived (Deprecated)
  • Sender - Username of the lodging user. (Deprecated)
  • CostCentre - Cost centre of the lodging user. (Deprecated)
  • To - the number the message was sent to.
  • Subject - The subject sent in the Message (Deprecated)
  • Message - The text of the message
  • Parts - The number of message parts required to send the message. If the message was a Fax, this will be the number of pages sent.
  • Type - The type of message
  • SenderId - The Id of the sending user (Deprecated)
  • SenderServiceId - The id of the login used by the sending user (Deprecated)
  • From - The number the message was sent from
  • ReplyType - the type of handling that was performed on the reply
  • ReplyPath - the address the reply was forwarded to
  • TrackingId - internal tracking code for the message
  • BatchTrackingId - if the message was part of a batch, the internal tracking code for the batch.
Statuses
  • UNKNOWN
  • ACTIVE
  • Blocked
  • CANC
  • DELETED
  • DELIV
  • ERRBLK
  • ERROR
  • EXPIRED
  • LODGED
  • PAUSE
  • PEND
  • REJECTD
  • SENT
  • SUBMITTED
  • TRYMAX
  • UNDELIV

Example Request

GET /v2/message/logs
Host: api.messagenet.com.au
Authorization: Bearer 12346

And an example response

{
  "totalRecords": 1,
  "messages": [
    {
      "messageId": "20180413125213VjnRO8",
      "status": "ACTIVE",
      "dateSent": "2018-04-13T12:52:13+10:00",
      "dateLodged": "2018-04-13T12:52:13+10:00",
      "deliveryReceiptReceived": null,
      "sender": "Hello World",
      "costcentre": "",
      "from": "61400111333",
      "to": "61400111222",
      "subject": null,
      "message": "Helloooo World...!!!",
      "parts": 1,
      "type": "SMS",
      "senderid": 1,
      "senderserviceid": 101,
      "replytype": "WWW",
      "replypath": "helloworld",
      "trackingId": "6a7db3ae-bd6c-4df3-892a-3b5d91b5a8f8",
      "batchTrackingId": null
    }
  ]
}