This document provides detailed information about the API endpoints available in the AshChat application. It includes the request format, response format, possible errors, and status codes for each endpoint.
Authentication Service Endpoints - http://localhost:3005/swagger-ui/index.htm
All endpoints related to user authentication are available in the Authentication Service Swagger UI. Just run the service and navigate to the Swagger UI to view the endpoints.
Chat Service Endpoints - http://localhost:4000/
(IMPORTANT: add JWT token in the Authorization header Bearer token and device_token to the http header)
PATCH - /api/user/nickname
{
"nickname": "new_nickname"
}
// Add JWT token in the Authorization header Bearer token
{
"message": "User updated successfully"
}
400 Bad Request
: Invalid input data401 Unauthorized
: Invalid token404 Not Found
: User not found500 Internal Server Error
: Server error
204 No Content
: Nickname changed successfully400 Bad Request
: Invalid input data401 Unauthorized
: Invalid token404 Not Found
: User not found500 Internal Server Error
: Server error
PATCH - /api/user/photo
{
"photo": "photo.img" // Image file with field name photo
}
{
"message": "Upload successful",
"url": "http://localhost:3000/files/uuid.img"
}
400 Bad Request
: Invalid input data401 Unauthorized
: Invalid token404 Not Found
: User not found500 Internal Server Error
: Server error
200 Ok
: Profile picture changed successfully400 Bad Request
: Invalid input data401 Unauthorized
: Invalid token404 Not Found
: User not found500 Internal Server Error
: Server error