Developers Forum

Feedback on New /users/{id}/preferences API Endpoint

Posted by dev_ninja May 15, 2024, 10:30 AM 5 Replies 123 Views

Hi team,

I've been exploring the newly released `/users/{id}/preferences` API endpoint and wanted to share some initial thoughts and feedback. The ability to directly manage user preferences via the API is a significant improvement and will greatly streamline our integration processes.

Positive Observations:

  • Clear Naming Convention: The endpoint name is intuitive and follows RESTful principles.
  • Comprehensive Fields: It appears to cover all the necessary preference fields we've discussed, including themes, notification settings, and language preferences.
  • Status Codes: The use of standard HTTP status codes (200 OK, 201 Created, 400 Bad Request, 404 Not Found, etc.) is excellent and makes error handling straightforward.

I've tested a few scenarios, and it seems to work as expected. However, I have a couple of suggestions for enhancement:

Suggestions for Improvement:

  1. Batch Updates: Currently, it seems we can only update one preference at a time or all at once. It would be highly beneficial to support batch updates, allowing us to update a subset of preferences in a single request. This would reduce network overhead.
  2. Field Validation Feedback: While bad requests are handled, the error messages for invalid field values could be more specific. For instance, if a `theme` value is invalid, it would be helpful to know which of the allowed themes are valid directly in the error response.
  3. Rate Limiting Documentation: Could we get some clearer documentation on the rate limits for this endpoint? Understanding these limits will help prevent unexpected throttling.

Overall, this is a solid addition to our API. Looking forward to hearing your thoughts and seeing any potential updates based on this feedback!

Thanks,
dev_ninja

15

Hi dev_ninja,

Great feedback! We're really pleased you find the new endpoint useful.

Response to your points:

  • Batch Updates: That's a fantastic suggestion. We've already had similar discussions internally. We'll prioritize implementing batch update support in an upcoming release. Expect an announcement soon!
  • Field Validation Feedback: You're right. We can definitely improve the clarity of our validation error messages. We'll be refining the response structure to include more detailed information about allowed values for specific fields.
  • Rate Limiting Documentation: Good point. We'll update our API documentation shortly to include explicit details about the rate limits for this endpoint, along with example `RateLimit-*` headers you can expect.

Thanks again for taking the time to provide such constructive feedback. It's invaluable!

Best,
api_pro

3

Echoing the sentiment, dev_ninja. The endpoint is well-designed. A small question from my side: are there any plans to introduce an endpoint to *get* all preferences for a user in a single call, similar to how the `PUT` or `PATCH` works? Right now, I'm fetching each preference individually.

5

Hi data_guru,

Yes, that's absolutely on our roadmap! We're working on a `GET /users/{id}/preferences` endpoint that will return all user preferences in a single payload. We expect to have that ready for public testing in the next sprint.

2

Just wanted to chime in and say thank you for this endpoint! It's made integrating user settings into our dashboard much smoother. The documentation was clear, and the existing functionality works perfectly. Looking forward to the batch updates!

7

Leave a Reply