user Routes - SmartBeansGoe/smartbeans-backend GitHub Wiki

/user-Routes

GET /user/meta

Returns various metadata for the user. Requires header Authorization: Bearer <valid (session) token>.

Output

{
  "username": <String>
  "displayName": <String>,
  "passwordSet": <Bool>,
  "ltiEnabled": <Bool>,
  "activeCourse": <String>
}

Errors

  • 400: Invalid header format
  • 401: Invalid token

PUT /user/displayName

Changes the displayed name of the user (see metadata). Requires header Authorization: Bearer <valid (session) token>. Returns 200 on success.

Input

{
  "displayName": <String>
}

Output

-

Errors

  • 400: Invalid header or body format
  • 401: Invalid token

GET /user/character

Returns character data for the user. Requires header Authorization: Bearer <valid (session) token>.

Output

{
  "bodyColor": <String | null>,
  "hatId": <String | null>,
  "faceId": <String | null>,
  "shirtId": <String | null>,
  "pantsId": <String | null>
}

Errors

  • 400: Invalid header format
  • 401: Invalid token

PATCH /user/character

Changes character data for the user. All JSON fields in the request body are optional; only provided fields are changed. Requires header Authorization: Bearer <valid (session) token>. Returns 200 on success.

Please note: The data is currently written to the database without any verification. Therefore, it is not guaranteed that the provided data are in fact valid asset ids.

Input

{
  "bodyColor": <String | null>,
  "hatId": <String | null>,
  "faceId": <String | null>,
  "shirtId": <String | null>,
  "pantsId": <String | null>
}

Output

-

Errors

  • 400: Invalid header format
  • 401: Invalid token
⚠️ **GitHub.com Fallback** ⚠️