PUT api/v1/sms/messages/{messageID}

This method allows the user to update a message that has already been sent. The updates that are allowed are: 1. The content of the message. 2. Add new contacts to the message. 3. Removing contacts from the message. 4. Updating the expiration date. 5. Updating the dissolve settings. Updates are allowed only if the following conditions are met: 1) The message has not expired. 2) The message has not been read by any of the recipients if updating the contents of the message.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
messageID

The Id of the message to be modified.

string

Required

Body Parameters

Either xml or json request.

TwoSms.CustomerPortalRole.API.SMS.MessageDetails
NameDescriptionTypeAdditional information
messageId

The unique identifier for the message.

globally unique identifier

Required

DateReceived

The date the sender created the message. The format is the following:[YYYY-MM-DDTHH:MM:SSZ]

string

Required

DateToSend

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

string

Required

DateSent

The actual date the message was sent. The format is the following:[YYYY-MM-DDTHH:MM:SSZ]

string

Required

Sender

The name of the sender that sent the message.

string

Required

DateModified

The date the template was last modified.

string

Required

AccountID

The unique Id of the account.

globally unique identifier

None.

StatusID

Unique Id of the status.

string

None.

Content

The actual message.

string

None.

Reference

Reference of the message sent.

string

None.

ExpiryDate

The date the encrypted message should expire. The format is the following:[YYYY-MM-DDTHH:MM:SSZ]

string

None.

DeliveryReceipt

Delivery receipt

boolean

None.

SmsReadReceipt

Read reciept.

boolean

None.

EmailReadReceipt

Read reciept.

boolean

None.

GroupID

globally unique identifier

None.

ContactID

integer

None.

NoOfReads

integer

None.

AdditionalGroupID

globally unique identifier

None.

AdditionalContactID

PersonNumber field of the contact

integer

Required

RemoveGroupID

globally unique identifier

None.

RemoveContactID

integer

None.

MessageType

string

None.

NoOfContacts

integer

None.

AuthenticationMethod

Authentication type for the account

TwoSms.Platform.Database.CustomerPortal.Tables.SMS.MessageAuthenticationType

Required

Request Formats

application/json, text/json

Sample:
{
  "messageId": "dbcc0ec5-7543-4a9d-932c-ab0623551910",
  "DateReceived": "sample string 2",
  "DateToSend": "sample string 3",
  "DateSent": "sample string 4",
  "Sender": "sample string 5",
  "DateModified": "sample string 6",
  "AccountID": "71a9437e-9ae2-410d-b3d1-983c44a55dcd",
  "StatusID": "sample string 8",
  "Content": "sample string 9",
  "Reference": "sample string 10",
  "ExpiryDate": "sample string 11",
  "DeliveryReceipt": true,
  "SmsReadReceipt": true,
  "EmailReadReceipt": true,
  "GroupID": "7fa1f2e9-c001-47d5-bd2e-35d4fec2c535",
  "ContactID": 16,
  "NoOfReads": 1,
  "AdditionalGroupID": "3e13280a-5c26-412e-8e3b-ca41e0d3fea9",
  "AdditionalContactID": 18,
  "RemoveGroupID": "55de749b-b8db-4491-a558-3b9ed525181d",
  "RemoveContactID": 20,
  "MessageType": "sample string 21",
  "NoOfContacts": 1,
  "AuthenticationMethod": 0
}

application/xml, text/xml

Sample:
<MessageDetails xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ID>dbcc0ec5-7543-4a9d-932c-ab0623551910</ID>
  <DateReceived>sample string 2</DateReceived>
  <DateToSend>sample string 3</DateToSend>
  <DateSent>sample string 4</DateSent>
  <Sender>sample string 5</Sender>
  <DateModified>sample string 6</DateModified>
  <AccountID>71a9437e-9ae2-410d-b3d1-983c44a55dcd</AccountID>
  <StatusID>sample string 8</StatusID>
  <Content>sample string 9</Content>
  <Reference>sample string 10</Reference>
  <ExpiryDate>sample string 11</ExpiryDate>
  <DeliveryReceipt>true</DeliveryReceipt>
  <SmsReadReceipt>true</SmsReadReceipt>
  <EmailReadReceipt>true</EmailReadReceipt>
  <GroupID>7fa1f2e9-c001-47d5-bd2e-35d4fec2c535</GroupID>
  <ContactID>16</ContactID>
  <NoOfReads>1</NoOfReads>
  <AdditionalGroupID>3e13280a-5c26-412e-8e3b-ca41e0d3fea9</AdditionalGroupID>
  <AdditionalContactID>18</AdditionalContactID>
  <RemoveGroupID>55de749b-b8db-4491-a558-3b9ed525181d</RemoveGroupID>
  <RemoveContactID>20</RemoveContactID>
  <MessageType>sample string 21</MessageType>
  <NoOfContacts>1</NoOfContacts>
  <AuthenticationMethod>ANONYMOUS</AuthenticationMethod>
</MessageDetails>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'System.Web.Http.ModelBinding.JQueryMvcFormUrlEncodedFormatter' to write type 'TwoSms.CustomerPortalRole.API.SMS.MessageDetails'.

Response Information

Resource Description

Sms transaction and balance.

TwoSms.CustomerPortalRole.API.Misc.ResponseOfTwoSms.CustomerPortalRole.API.SMS.SmsTransaction
NameDescriptionTypeAdditional information
Error

TwoSms.CustomerPortalRole.API.Misc.Error

None.

ResponseData

TwoSms.CustomerPortalRole.API.Misc.ResponseDataOfTwoSms.CustomerPortalRole.API.SMS.SmsTransaction

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>