DirectMessageEvents

class DirectMessageEvents(val client: ApiClient) : Endpoint

Collection of api endpoints related to Direct Message Events.

See also

Parameters

client

Current ApiClient instance.

Constructors

Link copied to clipboard
fun DirectMessageEvents(client: ApiClient)

Creates new DirectMessageEvents endpoint instance.

Properties

Link copied to clipboard
open override val client: ApiClient

Extensions

Link copied to clipboard
fun DirectMessageEvents.create(    userId: Long,     text: String,     type: String = "message_create",     vararg options: Option): JsonObjectApiAction<DirectMessageEvent.Show>

Publishes a new message_create event resulting in a Direct Message sent to a specified user from the authenticating user. Returns an event if successful. Supports publishing Direct Messages with optional Quick Reply and media attachment. Replaces behavior currently provided by POST direct_messages/new. Requires a JSON POST body and Content-Type header to be set to application/json. Setting Content-Length may also be required if it is not automatically.

Link copied to clipboard
fun DirectMessageEvents.delete(id: String, vararg options: Option): EmptyApiAction

Deletes the direct message specified in the required ID parameter. The authenticating user must be the recipient of the specified direct message. Direct Messages are only removed from the interface of the user context provided. Other members of the conversation can still access the Direct Messages. A successful delete will return a 204 http response code with no body content. Important: This method requires an access token with RWD (read, write & direct message) permissions.

Link copied to clipboard

Shorthand property to DirectMessageEvents.list.

fun DirectMessageEvents.list(    count: Int? = null,     cursor: String? = null,     vararg options: Option): JsonObjectApiAction<DirectMessageEvent.List>

Returns all Direct Message events (both sent and received) within the last 30 days. Sorted in reverse-chronological order.

Link copied to clipboard
fun DirectMessageEvents.show(id: String, vararg options: Option): JsonObjectApiAction<DirectMessageEvent.Show>

Returns a single Direct Message event by the given id.