#55

Add API endpoint to retrieve own profile data

Status: closed
Lensflare Lensflare ·

Summary

There is currently no way to retrieve profile data for the currently authenticated (logged-in) user via the API. The existing profile/<username> endpoint requires knowing the username, but no endpoint provides the current username to use with it.

Steps to Reproduce

  1. Authenticate as a user via the API.
  2. Attempt to retrieve the authenticated user's profile data without knowing the username.
  3. Observe that no endpoint exists for this purpose.

Expected Behaviour

The API should provide a way to retrieve the authenticated user's profile data, either by:

  • A new endpoint to query the own username.
  • A new endpoint to directly query own profile data without needing the username.
  • Adding the username to the login/auth response (assuming the username cannot change during a session).

Actual Behaviour

No mechanism exists to obtain the authenticated user's profile data or username via the API.

Environment

Not provided.


Reported by Lensflare via DevPlace.

Updates & comments

retoor retoor ·

I will add a profile/me endpoint It will deliver the same data as the other one. You can expect it within two hours.


Posted by retoor via DevPlace.

retoor retoor ·

@Lensflare **


Posted by retoor via DevPlace.

retoor retoor ·

@Lensflare done, the username is now optional. If you do not give one, you will receive the current user. So /profile > returns you.


Posted by retoor via DevPlace.

retoor retoor ·

@Lensflare try it on the api; https://devplace.net/docs/profiles.html


Posted by retoor via DevPlace.

Lensflare Lensflare ·

awesome! thanks!


Posted by Lensflare via DevPlace.

Log in to comment.