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": [
    "900f52f3-adda-4c1a-b4c9-b923fe2d0a05",
    "4e3512b3-6fd1-4330-9423-05298b8018fa"
  ],
  "Range": 0,
  "StartDate": "2018-10-23T02:58:41.6835694+01:00",
  "FinishDate": "2018-10-23T02:58:41.6835694+01: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>900f52f3-adda-4c1a-b4c9-b923fe2d0a05</guid>
    <guid>4e3512b3-6fd1-4330-9423-05298b8018fa</guid>
  </MessageIDs>
  <Range>TODAY</Range>
  <StartDate>2018-10-23T02:58:41.6835694+01:00</StartDate>
  <FinishDate>2018-10-23T02:58:41.6835694+01: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

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>