Skip to main content
GET
/
user
/
displayname
Get User Display Name
curl --request GET \
  --url https://api.example.com/user/displayname \
  --header 'Authorization: <authorization>'
{
  "displayName": "<string>",
  "error": "<string>"
}

Authentication

This endpoint requires authentication via the Authorization header with a valid JWT token.

Headers

Authorization
string
required
JWT token obtained from login, signup, or guest authentication

Response

displayName
string
The display name of the authenticated user

Success Response

Returns the user’s display name on success.
{
  "displayName": "John Doe"
}

Error Responses

error
string
Error message describing what went wrong

400 Bad Request

No token was provided in the request.
{
  "error": "No Token Provided"
}

500 Internal Server Error

An unexpected error occurred while retrieving the display name.
{
  "error": "Internal server error"
}

Examples

curl -X GET https://api.plant-together.com/user/displayname \
  -H "Authorization: YOUR_JWT_TOKEN"

Source Reference

Implementation: express/src/index.ts:282-291

Build docs developers (and LLMs) love