Open FreemanBoss opened 1 month ago
Develop an API endpoint to retrieve all organizations the current user belongs to with proper authentication and validation.
/api/v1/users/organisations
Authorization: Bearer <token>
No additional parameters are required. The endpoint retrieves organizations based on the authenticated user's information.
200 OK
HTTP/1.1 200 OK [ { "org_id": "uuid", "name": "string", "description": "string" } ]
401 Unauthorized
{ "status_code": 401, "message": "User not authenticated" }
500 Internal Server Error
To provide a backend service allowing users to retrieve all organizations they belong to with appropriate authentication.
API endpoint allows users to retrieve a list of organizations they belong to with proper authentication and error handling.
GET /api/v1/users/organisations
Description
Develop an API endpoint to retrieve all organizations the current user belongs to with proper authentication and validation.
Acceptance Criteria
/api/v1/users/organisations
.Request
No additional parameters are required. The endpoint retrieves organizations based on the authenticated user's information.
Response
200 OK
status code with a list of organizations the user belongs to.401 Unauthorized
status code.Error Handling
401 Unauthorized
status code.500 Internal Server Error
status code.Purpose
To provide a backend service allowing users to retrieve all organizations they belong to with appropriate authentication.
Requirements
Expected Outcome
API endpoint allows users to retrieve a list of organizations they belong to with proper authentication and error handling.
Task List
GET /api/v1/users/organisations
to retrieve organizations.Testing