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

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.

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.

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": [
    "5a07116f-9d82-4796-9a87-91276e2852ae",
    "c5870966-c540-49d9-8c70-bf0ee79a8f9b"
  ],
  "Range": 0,
  "StartDate": "2024-11-21T08:33:32.0418725+00:00",
  "FinishDate": "2024-11-21T08:33:32.0418725+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>5a07116f-9d82-4796-9a87-91276e2852ae</guid>
    <guid>c5870966-c540-49d9-8c70-bf0ee79a8f9b</guid>
  </MessageIDs>
  <Range>TODAY</Range>
  <StartDate>2024-11-21T08:33:32.0418725+00:00</StartDate>
  <FinishDate>2024-11-21T08:33:32.0418725+00:00</FinishDate>
  <Type>BOTH</Type>
  <Delete>true</Delete>
  <NotifyRecipients>true</NotifyRecipients>
  <Reason>sample string 4</Reason>
</MessageCriteria>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

ResponseOfMessageDeletionResponse
NameDescriptionTypeAdditional information
Error

Error

None.

ResponseData

ResponseDataOfMessageDeletionResponse

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>