Skip to content

Get Project

Method

REST method is adopted.

HTTP Method

GET: Get single project information

Naming Convention

To unify the naming of query parameters and nodes and improve readability, snake_case is used for URIs and JSON nodes in requests.

Request and Response

Headers

Meta information is set in HTTP headers, not in the response body.

Request Headers

  • Authorization
  • Content-Type
  • Accept
  • Accept-language

Response Headers

  • Content-Type

Get Single Project Information

URI

GET /v1/organizations/{organization_id}/projects/{project_id}

Path Parameters

Name Type Required Description
organization_id string Required Organization UUID
project_id string Required Project UUID

Response

The response is JSON.

{
  "id": "project-uuid",
  "name": "Project Alpha",
  "organizationId": "org-uuid",
  "codeCount": 15,
  "designCount": 8,
  "createdAt": 1234567890000,
  "updatedAt": 1234567890000,
  "deletedAt": null,
  "createdBy": "user-id",
  "updatedBy": "user-id",
  "deletedBy": null
}

Response Fields

Name Type Description
id string Project UUID
name string Project name
organizationId string Parent organization UUID
codeCount number Number of code entries
designCount number Number of designs
createdAt number Creation timestamp (epoch milliseconds)
updatedAt number Update timestamp (epoch milliseconds)
deletedAt number | null Deletion timestamp (epoch milliseconds)

Authentication

Authentication is performed using JSON Web Tokens (JWT) issued by Amazon Cognito.

Admins use their role permissions. A regular user needs an active user_project assignment with read or read/write access.

Error Handling

The status codes for error handling are as follows.

Description Status Code Status Name
Missing credentials 401 Unauthorized
Insufficient permissions 403 Forbidden
Project or organization not found 404 Not Found
Internal server error 500 Internal Server Error

Processing Flow

  1. Extract organization ID and project ID from path parameters
  2. Verify the user belongs to the organization
  3. Verify the project belongs to the specified organization
  4. For a regular user, verify an active project assignment with read or read/write access
  5. Return project information

Detailed Flowchart

flowchart TD
    Start([GET Request]) --> Auth[Auth & Parameter Extraction]
    Auth --> Service[Service Layer]
    Service --> AccessCheck[Access Check]
    AccessCheck --> HasAccess{Read permission?}
    HasAccess -->|No| Err404[404 Not Found]
    HasAccess -->|Yes| QueryDB[Repository Layer]
    QueryDB --> FindRecord[Fetch Record<br/>WHERE deletedAt IS NULL]
    FindRecord --> Exists{Exists?}
    Exists -->|No| Err404
    Exists -->|Yes| Format[Format Response]
    Format --> Success[200 OK]