POST api/v1/sms/standardmessages

This method sends a standard SMS or Email using the 2sms XML Gateway.

Request Information

URI Parameters

None.

Body Parameters

Either xml or json request.

StandardMessage
NameDescriptionTypeAdditional information
Contacts

List of contacts either individual or group contacts

ContactsIncQuick

Required

Content

The actual message for the contacts to view.

string

Required

DateToSend

The date the message was scheduled to be sent to the contacts. The format is the following:[YYYY-MM-DDTHH:MM:SSZ]

date

None.

MessageOptions

Message options.

StandardMessageOptions

Required

Reference

Stores a reference for the message.

string

Required

Sender

The name of the sender that sent the message.

string

Required

Request Formats

application/json, text/json

Sample:
{
  "Contacts": {
    "ContactID": {
      "sample string 1": 0,
      "sample string 2": 0
    },
    "GroupID": {
      "sample string 1": 0,
      "sample string 2": 0
    },
    "QuickRecipients": {
      "sample string 1": 0,
      "sample string 2": 0
    }
  },
  "Content": "sample string 1",
  "DateToSend": "2024-04-20T06:08:01.9893058+00:00",
  "MessageOptions": {
    "DeliveryReceipt": true,
    "DeliverToValidated": true
  },
  "Reference": "sample string 4",
  "Sender": "sample string 5"
}

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

Sms Transaction

ResponseOfSmsTransaction
NameDescriptionTypeAdditional information
Error

Error

None.

ResponseData

ResponseDataOfSmsTransaction

None.

Response Formats

application/json, text/json

Sample:
{
  "Error": {
    "ErrorCode": "sample string 1",
    "ErrorReason": "sample string 2"
  },
  "ResponseData": {
    "Identification": {
      "UserId": "sample string 1"
    },
    "Result": "sample string 1",
    "Detail": {
      "MessageID": "sample string 1",
      "NoOfContacts": "sample string 2",
      "NoOfQuickRecipients": "sample string 3",
      "NoOfSMS": "sample string 4",
      "NoOfEmails": "sample string 5",
      "PreTransaction": "sample string 6",
      "PostTransaction": "sample string 7",
      "CreditsUsed": "sample string 8",
      "MessageText": "sample string 9"
    }
  }
}

application/xml, text/xml

Sample:
<ResponseOfSmsTransaction xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Error>
    <ErrorCode>sample string 1</ErrorCode>
    <ErrorReason>sample string 2</ErrorReason>
  </Error>
  <ResponseData>
    <Result>sample string 1</Result>
    <Identification>
      <UserId>sample string 1</UserId>
    </Identification>
    <Detail>
      <MessageID>sample string 1</MessageID>
      <NoOfContacts>sample string 2</NoOfContacts>
      <NoOfQuickRecipients>sample string 3</NoOfQuickRecipients>
      <NoOfSMS>sample string 4</NoOfSMS>
      <NoOfEmails>sample string 5</NoOfEmails>
      <PreTransaction>sample string 6</PreTransaction>
      <PostTransaction>sample string 7</PostTransaction>
      <CreditsUsed>sample string 8</CreditsUsed>
      <MessageText>sample string 9</MessageText>
    </Detail>
  </ResponseData>
</ResponseOfSmsTransaction>