### 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/5...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to