[openstreetmap/openstreetmap-website] Feature request: Add support for user preferences to be returned as JSON formatted response (API 0.6) (#3160)

Donal Hunt notifications at github.com
Sun Apr 4 16:07:57 UTC 2021


Discovered that while the `/api/0.6/user/details` endpoint will provide a json response, the `/api/0.6/user/preferences` endpoint does not. :(

**GET /api/0.6/user/details with "Accept: application/json" header:**
`{"user":{"id":12345,"display_name":"firstname surname","account_created":"1970-01-01T18:18:36Z","description":"","contributor_terms":{"agreed":true,"pd":false},"img":{"href":"https://www.gravatar.com/avatar/00000000000000000000000000.jpg"},"roles":[],"changesets":{"count":0},"traces":{"count":0},"blocks":{"received":{"count":0,"active":0}},"languages":["en-GB", "en"],"messages":{"received":{"count":0,"unread":0},"sent":{"count":0}}}}`

**GET /api/0.6/user/preferences with "Accept: application/json" header:**
```
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="OpenStreetMap server" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
  <preferences>
<preference k="diary.default_language" v="en"/>
  </preferences>
</osm>
```

Looking at the codebase, this doesn't look particular hard to implement but I wanted to a) flag it as an issue and b) check if it would be worthwhile investing the time implementing it (e.g. by submitting a PR).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3160
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20210404/e9f9cbe9/attachment.htm>


More information about the rails-dev mailing list