Hello Mattermost Community!
I’m excited to share that I’ve just released an R package called MattermostR!
These functions allow R users to interact with Mattermost for messaging, file uploads, channel management, and more, directly from their R environment.
Here are some of the key functions available in the MattermostR package:
- authenticate_mattermost: Authenticate with the Mattermost server using either a token or username/password.
- send_mattermost_message: Send a text message to a specified Mattermost channel, optionally with one or multiple file attachment(s).
- get_all_teams / get_team_channels: Retrieve information about teams and their channels.
- get_channel_posts: Retrieve posts from a specific channel.
- delete_post / delete_channel: Delete a post or a channel programmatically. (archives channel only)
- create_channel: Create a new Mattermost channel.
One question I have is about the priority setting for messages. Currently, I’m using Mattermost server version 9.11.1. When I include the priority metadata in the API call, the message posts successfully, but there is no visible indication of priority in the Mattermost UI. However, when I omit the priority, the message posts successfully but without any visible indication of priority in the Mattermost UI. The server response indicates that the priority metadata is being processed, but I do not see any visual representation of the priority in the Mattermost channel. Does anyone know if there are specific settings or configurations that need to be enabled on the server or client to support priority visibility, or is this a known limitation for version 9.11.1?
For reference, here is the request body and response I received:
Request Body: { “channel_id”: “<channel_id>”, “message”: “”, “props”: { “priority”: { “priority”: “High”, “requested_ack”: true } } }
Response Status: 201 Created
Full Log: Request Body: { “channel_id”: “um13yw8k73r8ucqo6f1w8wpukw”, “message”: “Hello, Mattermost! This is a test message at 2024-10-04 12:22:12.740591”, “props”: { “priority”: { “priority”: “High”, “requested_ack”: true } } } → POST /api/v4/posts HTTP/1.1 → Host: [REDACTED] → User-Agent: httr2/1.0.3 r-curl/5.2.2 libcurl/8.3.0 → Accept-Encoding: deflate, gzip → Authorization: [REDACTED] → Accept: application/json → Content-Type: application/json → Content-Length: 189
← HTTP/1.1 201 Created ← Server: nginx ← Date: Fri, 04 Oct 2024 10:22:23 GMT ← Content-Type: application/json ← Content-Length: 517 ← Connection: keep-alive ← Permissions-Policy: ← Referrer-Policy: no-referrer ← Vary: Accept-Encoding ← X-Content-Type-Options: nosniff ← X-Request-Id: exz3e813ujghjfshqueao9145a ← X-Version-Id: 9.11.1.10419911144.929d11ada0d967ec542a54166057bf42.false ← X-Frame-Options: SAMEORIGIN ← X-XSS-Protection: 1; mode=block
Response Headers: <httr2_headers> Server: nginx Date: Fri, 04 Oct 2024 10:22:23 GMT Content-Type: application/json Content-Length: 517 Connection: keep-alive Permissions-Policy: Referrer-Policy: no-referrer Vary: Accept-Encoding X-Content-Type-Options: nosniff X-Request-Id: exz3e813ujghjfshqueao9145a X-Version-Id: 9.11.1.10419911144.929d11ada0d967ec542a54166057bf42.false X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block
Response Body: $id [1] “i4nauadw57rque4mmeucsasxjc”
$create_at [1] 1.728037e+12
$update_at [1] 1.728037e+12
$edit_at [1] 0
$delete_at [1] 0
$is_pinned [1] FALSE
$user_id [1] “h74wwx35dbnttpsetxk4wkb8sr”
$channel_id [1] “um13yw8k73r8ucqo6f1w8wpukw”
$root_id [1] “”
$original_id [1] “”
$message [1] “Hello, Mattermost! This is a test message at 2024-10-04 12:22:12.740591”
$type [1] “”
$props $props$priority $props$priority$priority [1] “High”
$props$priority$requested_ack [1] TRUE
$hashtags [1] “”
$pending_post_id [1] “”
$remote_id [1] “”
$reply_count [1] 0
$last_reply_at [1] 0
$participants NULL
$metadata named list()
No visible indication of priority in the UI.
Also, I’d love to get your thoughts on additional features you’d like to see in this package. Are there any specific functionalities or integrations with R that you think would be useful?
Thanks for your time, and I’m looking forward to your feedback and suggestions!
Cheers, Laurens