DELETE api/v1/sms/messages

The method will expire all advanced messages regardless of expiry date set in the original request. If the notify recipients option is set then the system will notify all recipients that the message has been expired and no longer viewable (Only for advanced messages). If the delete option is set and the account has the message deletion feature enabled, the contents of the standard and advanced messages will be deleted. The default search criteria will list all messages that have expired or all recipients have read the message the maximum number of times. An object listing the parameters for messages to be deleted.

Request Information

URI Parameters

None.

Body Parameters

TwoSms.CustomerPortalRole.API.SMS.MessageCriteria
NameDescriptionTypeAdditional information
Destination

Specifies the destination that the contents of the message will be deleted.

string

None.

MessageIDs

List of all the advanced message IDs that will be deleted. All other critiera will be ignored if this is present.

Collection of globally unique identifier

None.

Range

Search for messages for deletion within a given date range.

TwoSms.CustomerPortalRole.API.Reports.DateRange

None.

StartDate

Specifes the start date that search will begin in. The format is the following:[YYYY-MM-DDTHH:MM:SSZ]

date

None.

FinishDate

Specifies the finish data that the search will finish. The format is the following:[YYYY-MM-DDTHH:MM:SSZ]

date

None.

Type

Specifies the type of messages to search for to delete.

TwoSms.CustomerPortalRole.API.SMS.MessageType

None.

Delete

Determines if the contents of the message will be removed. The account must have the feature enabled for this to work.

boolean

None.

NotifyRecipients

Determines if the recipients of the messages that are being deleted will be notified of the action. Only applicable for advanced messages.

boolean

None.

Reason

Allows the user to provide a reason for message deletion.

string

None.

Request Formats

application/json, text/json

Sample:
{
  "Destination": "sample string 1",
  "MessageIDs": [
    "a0d9b087-1373-40dd-ac33-7330d000d0e4",
    "f5d19bad-54be-4c29-bcf4-a2a98dfcb418"
  ],
  "Range": 0,
  "StartDate": "2024-03-29T08:22:36.782195+00:00",
  "FinishDate": "2024-03-29T08:22:36.782195+00:00",
  "Type": 0,
  "Delete": true,
  "NotifyRecipients": true,
  "Reason": "sample string 4"
}

application/xml, text/xml

Sample:
<MessageCriteria xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Destination>sample string 1</Destination>
  <MessageIDs>
    <guid>a0d9b087-1373-40dd-ac33-7330d000d0e4</guid>
    <guid>f5d19bad-54be-4c29-bcf4-a2a98dfcb418</guid>
  </MessageIDs>
  <Range>TODAY</Range>
  <StartDate>2024-03-29T08:22:36.782195+00:00</StartDate>
  <FinishDate>2024-03-29T08:22:36.782195+00:00</FinishDate>
  <Type>BOTH</Type>
  <Delete>true</Delete>
  <NotifyRecipients>true</NotifyRecipients>
  <Reason>sample string 4</Reason>
</MessageCriteria>

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.MessageCriteria'.

Response Information

Resource Description

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

TwoSms.CustomerPortalRole.API.Misc.Error

None.

ResponseData

TwoSms.CustomerPortalRole.API.Misc.ResponseDataOfTwoSms.CustomerPortalRole.API.SMS.MessageDeletionResponse

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": {
      "NoOfMessagesExpired": 1,
      "NoOfMessagesDeleted": 2,
      "NumberOfCreditsUsed": 3.1,
      "NumberOfCreditsRemaining": 4.1
    }
  }
}

application/xml, text/xml

Sample:
<ResponseOfMessageDeletionResponse 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>
      <NoOfMessagesExpired>1</NoOfMessagesExpired>
      <NoOfMessagesDeleted>2</NoOfMessagesDeleted>
      <NumberOfCreditsUsed>3.1</NumberOfCreditsUsed>
      <NumberOfCreditsRemaining>4.1</NumberOfCreditsRemaining>
    </Detail>
  </ResponseData>
</ResponseOfMessageDeletionResponse>