api:dmails
Table of Contents
- 01. Record field format
- 02. Derived field format
- 03. Associated attributes
- 04. Index
- 05. Show
- 06. Create
- 07. Update
- 08. Mark all as read
- 09. See also
- 10. External links
This page has details for how to interact with dmail records through the API.
01 Record field format
| Name | Type | Details |
|---|---|---|
id | integer | >0 |
owner_id | integer | >0 |
to_id | integer | >0 |
from_id | integer | >0 |
title | string | |
body | string | |
is_read | boolean | |
is_deleted | boolean | |
is_spam | boolean | obsolete |
created_at | timestamp | |
updated_at | timestamp |
02 Derived field format
These are values which are not part of the actual record, but instead are derived from calculations and record lookups on the fly.
| Name | Type | Details | Notes |
|---|---|---|---|
key | string | Cryptographic key generated from the record. |
03 Associated attributes
The following is the list of relations that can be included in the API results (see Help:Common URL parameters for more info):
| Name | Type | Number | Availability | Details |
|---|---|---|---|---|
owner | user | single | required | |
to | user | single | required | |
from | user | single | required |
04 Index
Returns multiple dmail records.
| HTTP Method | GET |
| Base URL | /dmails.json |
| Type | read request |
| Description | The default order is ID descending. Only Dmails to or from the user will be shown, regardless of user level. |
Search attributes
Search parameters take the following format (see Help:Common URL parameters for more info):
search[FIELD]=VALUE
The following are the base fields along with their associated type. Check the syntax pages for all of the available variations.
- Number syntax
idcreated_atupdated_at- Text syntax
titlebody- User syntax
tofrom- Boolean syntax
is_readis_deleted
Special search parameters
The following are additional search fields.
message_matches- Case-insensitive wildcard search on the title and body fields.folder- received - Shows all dmails to the user.
- unread - Shows all unread dmails to the user.
- sent - Shows all dmails from the user.
- deleted - Shows all dmails deleted by the user.
05 Show
Returns a single dmail record.
| HTTP Method | GET |
| Base URL | /dmails/$id.json |
| Type | read request |
| Description | $id is the dmail ID.Normally only the owner can see the dmail, unless the correct dmail key is also supplied. |
Show parameters.
keyUnique key for every dmail that will allow anyone to view the dmail.
06 Create
Creates a single dmail record.
| HTTP Method | POST |
| Base URL | /dmails.json |
| Type | write request |
Create parameters
Dmail parameters take the following format (see Help:API Write Requests for more info):
dmail[FIELD]=VALUE
- Required:
- To specifier: - must be one of the following
to_idto_nametitlebody
07 Update
Updates a single comment record.
| HTTP Method | PUT/PATCH |
| Base URL | /dmails/$id.json |
| Type | write request |
| Description | $id is the dmail ID. |
Update parameters
- Optional:
is_readis_deleted
08 Mark all as read
Marks all records as read.
| HTTP Method | POST |
| Base URL | /dmails/mark_all_as_read.json |
| Type | write request |
