[openstreetmap/openstreetmap-website] Messages API `message_read` field is missing (Issue #5489)

Tobias Zwick notifications at github.com
Fri Jan 10 14:41:13 UTC 2025


### URL

https://master.apis.dev.openstreetmap.org/api/0.6/user/messages

### How to reproduce the issue?

1. **Send yourself a message** 
   `POST https://master.apis.dev.openstreetmap.org/api/0.6/user/messages`
   Body: `recipient_id=<your id>, title=Test123, body=Test123`
   Headers: `Authorization=Bearer <your OAuth2 token>`

2. **Get the inbox**
   `GET https://master.apis.dev.openstreetmap.org/api/0.6/user/messages/inbox`
   Headers: `Authorization=Bearer <your OAuth2 token>`

   The message in the response will look something like this. `message_read` field is missing:

   ```xml
   <message id="99" from_user_id="3625" from_display_name="westnordost" to_user_id="3625" to_display_name="westnordost" sent_on="2025-01-10T14:24:50Z" body_format="markdown" deleted="false">
     <title>Test123</title>
   </message>
   ```

   To confirm that it is a bug and not just not included because of weird API design (missing == false??):

3. **Update the read status of the message**
   `PUT https://master.apis.dev.openstreetmap.org/api/0.6/user/messages/<message id>`
   Body: `read_status=true`
   Headers: `Authorization=Bearer <your OAuth2 token>`

   The response will still look something like this. `message_read` field is missing:

   ```xml
   <message id="99" from_user_id="3625" from_display_name="westnordost" to_user_id="3625" to_display_name="westnordost" sent_on="2025-01-10T14:24:50Z" body_format="markdown" deleted="false">
     <title>Test123</title>
   </message>
   ```
   
   To confirm that `message_read` is not just omitted for all responses except the inbox, 

2. **Get the inbox again**
   `GET https://master.apis.dev.openstreetmap.org/api/0.6/user/messages/inbox`
   Headers: `Authorization=Bearer <your OAuth2 token>`

   The message in the response will still look something like this. `message_read` field is missing:

   ```xml
   <message id="99" from_user_id="3625" from_display_name="westnordost" to_user_id="3625" to_display_name="westnordost" sent_on="2025-01-10T14:24:50Z" body_format="markdown" deleted="false">
     <title>Test123</title>
   </message>
   ```

### Screenshot(s) or anything else?

_No response_

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/5489
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/5489 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250110/0fea48c4/attachment-0001.htm>


More information about the rails-dev mailing list