AddMessageDTO
in package
Class AddMessageDTO
Data Transfer Object for adding messages to existing conversations. This DTO does not extend AbstractBaseDto because Conversations API requires multipart format which differs from other Canvas APIs.
Table of Contents
Properties
- $attachmentIds : array<string|int, int>|null
- An array of attachment IDs. These must be files previously uploaded to the sender's "conversation attachments" folder
- $body : string
- The message body to be sent
- $includedMessages : array<string|int, int>|null
- An array of message ids from this conversation to forward to recipients
- $mediaCommentId : string|null
- Media comment id of an audio or video file
- $mediaCommentType : string|null
- Type of the associated media file
- $recipients : array<string|int, string>|null
- An array of recipient ids to add to the conversation.
- $userNote : bool|null
- Whether to send as a private message to each recipient
Methods
- __construct() : mixed
- Constructor
- toApiArray() : array<int, array<string, string>>
- Convert the DTO to Canvas API multipart format
Properties
$attachmentIds
An array of attachment IDs. These must be files previously uploaded to the sender's "conversation attachments" folder
public
array<string|int, int>|null
$attachmentIds
= null
$body
The message body to be sent
public
string
$body
$includedMessages
An array of message ids from this conversation to forward to recipients
public
array<string|int, int>|null
$includedMessages
= null
$mediaCommentId
Media comment id of an audio or video file
public
string|null
$mediaCommentId
= null
$mediaCommentType
Type of the associated media file
public
string|null
$mediaCommentType
= null
$recipients
An array of recipient ids to add to the conversation.
public
array<string|int, string>|null
$recipients
= null
These may be user ids or course/group ids prefixed accordingly
$userNote
Whether to send as a private message to each recipient
public
bool|null
$userNote
= null
Methods
__construct()
Constructor
public
__construct([array<string, mixed> $data = [] ]) : mixed
Parameters
- $data : array<string, mixed> = []
toApiArray()
Convert the DTO to Canvas API multipart format
public
toApiArray() : array<int, array<string, string>>