Self Destruct Messages Overview ​
POST /userapi/selfdestruct
Sending Self Destruct Messages via the API can be achieved by making a POST request on the URL, with appropriate fields forming the HTTP message body. To send Self Destruct Messages, you must have access to the following features within Passwordstate:
- When sending messages based on a Password record - your account must have access to this Password record
- When sending a message that is not related to a Password record i.e. free-form message body - you must have access to the 'Self Destruct Message' menu in Passwordstate
With the email the recipient receives for the Self Destruct message, you can either use the supplied Email Template 'Self Destruct Message Email' found on the screen Administration -> Email Templates, or you can specify the entire body of the message yourself.
Below are a list of all possible fields which can be included in your POST request, explaining which ones are mandatory, and detailed instructions for each field as appropriate.
| Heading | Data type | Mandatory | Description |
|---|---|---|---|
| PasswordID | Integer | No | The PasswordID value of the password record you are sending a Self Destruct Message for |
| Message | String | Yes and No - only mandatory if not specifying PasswordID i.e. free-form Self Destruct Message | Use this field is you are wanting to specify the entire Self Destruct Message yourself, instead of it being based off of a password record - HTML tags supported are , and , and (line break, bold and paragraph) |
| PrefixMessageContent | String | No | If you are sending a message based off of a password record, you can prefix information before the password record details with content from this field - HTML tags supported are , and , and (line break, bold and paragraph) |
| AppendMessageContent | String | No | If you are sending a message based off of a password record, you can append information after the password record details with content from this field - HTML tags supported are , and , and (line break, bold and paragraph) |
| ExpiresAt | String | Yes | This is the duration for how long the self destruct message exists before it is deleted due to not being viewed. You specify the duration and time period for this field, as per the following examples 30m (30 minutes), or 3h (3 hours), or 2d (2 days) |
| NoViews | Integer | Yes | How many times the Self Destruct Message can be viewed, before it is removed |
| ToEmailAddress | String | Yes | The Email Address of the recipient who is to receive the Self Destruct Message |
| ToFirstName | String | No | The First Name of the recipient who is to receive the Self Destruct Message - this is used in the email which is sent to the recipient |
| EmailSubject | String | Yes and No - only mandatory if you are using the EmailBody field below to compose your own emails | The Subject Line of the email sent to the recipient - if not specified, the Subject will be used from the Email Template 'Self Destruct Message Email' |
| EmailBody | String | No | If left blank, the Email Template 'Self Destruct Message Email' will be used, but you can use this field to specify the entire Email Body if you wish - HTML tags supported are , and , and (line break, bold and paragraph)There are also certain variables in the EmailBody that will be replaced as appropriate, when the email is sent - and they are: |
| - [ToFirstName] - the First Name of the recipient who will receive the email | |||
| - [UserName] - this is the FirstName and Surname of the user sending the Self Destruct Message | |||
| - [ExpirePeriod] - How long the message will be alive until it is automatically deleted | |||
| - [URL] - This is the URL for the recipient to click on to view the Self Destruct Message | |||
| - [Version] - The Version Number for your Passwordstate instance | |||
| - [SiteURL] - The URL of your Passwordstate instance | |||
| Passphrase | String | No | If you would like to Passphrase protect the Self Destruct Message, you can use this field to do that - the recipient must know the Passphrase in order to read the message |
| Reason | String | No | You can specify a Reason for sending this Self Destruct Message, and it will be added to the appropriate auditing data |