layoutElementContent.uuid: 105372
layoutElementContent.uuid: 105596 Document Name 105596 Document UUID 105597

Betavine API Data Model

Transaction

Transaction Model

The Transaction model acts as a container for messages sent through the API. It is a member of the Response model.

Properties

  • Transaction ID The unique identifier for the transaction
  • type An integer representing the type of transaction. This can be one of the following:
    • 0 SMS
    • 1 Wap Push
    • 2 Email
    • 3 Trigger
    • 4 Status
  • Messages A collection of Message Models

XML Example

The following example is a segment of the XML response from Send SMS . For the purposes of this example the messages element has been shortened.

<transaction type="1">
  <id>118</id>
  <messages/>
</transaction>

JSON Example

The following example is a segment the JSON Send SMS . For the purposes of this example the messages array has been emptied.

"transaction": {
  "id":118,
  "type": 1,
  "messages":[]
}

Plain Example

The following is an example of the Plain response. It is a single line containing the text TRANSACTION followed by the Transaction Identifer. It will be followed by the Plain contents of the Messages model.

TRANSACTION 123

Message

Message Model

The Message model contains information related to a message sent to a single destination. For the XML format it is a member of the Messages model, otherwise it is a member of Transaction.

Properties

  • id A unique identifier for this message
  • status The current status of the message. See Message Status .
  • sentAt The time at which the message was sent by the API to the Messaging Gateway
  • deliveredAt The time at which the message was delivered by the Mobile Network

XML Example

The following example is a segment of the response from Send SMS . In this example the sentAt and deliveredAt elements are empty because the message has not been sent to the Messaging Gateway. This is also apparent from the 0 status code.

<response method="send/sms" status="OK" version="1.2">
  <transaction type="0" id="ff8080811a9b167b011a9b7e693e0002">
    <messages status="0" id="ff8080811a9b167b011a9b7e69c20003"/>
  </transaction>
</response>

JSON Example

The following example is a segment of the JSON response to the Status method.

{
  "deliveredAt":"2007-06-28 18:20:00.0",
  "status":1,
  "sentAt":"2007-06-28 16:19:49.0",
  "id":118
}

Plain Example

The following is an example of the Plain response. Written on a single line it contains the text MESSAGE followed by the Message ID, the sent and delivered time.

MESSAGE 12 2007-06-28 16:19:49.0 2007-06-28 18:20:00.0

Error

Error Model

A member of the Response model the Error model will occur when the API method errors.

Properties

  • Number A reference to the type of error which has occured. Any one of the following:
    1. The UAID provided is invalid. (obsolete)
    2. The UAID provided is inactive. (obsolete)
    3. The user associated with the UAID does not have enough credit.
    4. One of the parameters supplied is incorrect. More information about which parameter is invalid can be obtained from the error message.
    5. The supplied application identifier does not exist. (obsolete)
    6. The user has not added a mobile number to Betavine
    7. No such Message ID (obsolete)
    8. Internal API Error. Please report these in the Vodafone Betavine API Forums
    9. Inactive API method. The API method is down for maintenance. Please check the Vodafone Betavine API Forums
  • Message A message descibing the error which has occured. May contain extra information on what caused the error.

XML Example

The following is a Response from send/status . This will occur when providing an invalid Message ID.

<response method="send/status" status="FAIL" version="1.2">
  <error message="Transaction identifier missing" number="4"/>
</response>

JSON Example

The following is a Response from send/status . This will occur when providing an invalid Message ID.

{
  "response":{
    "error":{
      "message":"No such message ID",
      "number":7
    },
    "version":"1.1",
    "status":"FAIL"
  }
}

Plain Example

The following is a Response from send/status . This will occur when providing an invalid Message ID.

FAIL 1.1
ERROR 7 No such message ID
layoutElementContent.uuid: 105370