List Structures
Method
REST method is adopted.
HTTP Method
GET: Get structure list
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
AuthorizationContent-TypeAcceptAccept-language
Response Headers
Content-Type
Get List
URI
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| organization_id | integer | Required | Organization ID |
| project_id | integer | Required | Project ID |
Query Parameters
List endpoints define page, limit, and sort parameters.
| Name | Type | Default | Description |
|---|---|---|---|
| page | integer | 1 | Page number (minimum: 1) |
| limit | integer | 20 | Items per page (minimum: 1, maximum: 100) |
| sort | string | asc | Sort order (asc or desc) |
Response
The response is JSON.
{
"currentPage": 1,
"totalCount": 10,
"list": [
{
"structureId": "structure-uuid",
"projectId": 1,
"name": "My Structure",
"createdAt": 1234567890000,
"updatedAt": 1234567890000,
"deletedAt": null
}
]
}
Response Fields
| Name | Type | Description |
|---|---|---|
| currentPage | number | Current page number |
| totalCount | number | Total number of items |
| list | array | Array of structure objects |
| list[].structureId | string | Structure UUID |
| list[].projectId | number | Project ID |
| list[].name | string | Structure name |
| list[].createdAt | number | Creation timestamp (epoch milliseconds) |
| list[].updatedAt | number | Update timestamp (epoch milliseconds) |
| list[].deletedAt | number | null | Deletion timestamp (epoch milliseconds); null if not deleted |
Note: The
jsonfield is not included in the list response. Use the single GET endpoint to retrieve json data.
Authentication
Authentication is performed using JSON Web Tokens (JWT) issued by Amazon Cognito.
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
- Extract organization ID and project ID from path parameters
- Extract pagination settings from query parameters
- Verify the user has access to the project
- Query DocumentDB for structures with pagination (excluding the json field)
- Return paginated response
Detailed Flowchart
flowchart TD
Start([GET Request]) --> Auth[Auth & Parameter Extraction<br/>page, limit, sort]
Auth --> Service[Service Layer]
Service --> AccessCheck[Access Check]
AccessCheck --> HasAccess{Read permission?}
HasAccess -->|No| Err404[404 Not Found]
HasAccess -->|Yes| Validate{sort validation}
Validate -->|NG| Err400[400 Bad Request]
Validate -->|OK| QueryDB[Repository Layer]
QueryDB --> CountQuery[Get COUNT]
CountQuery --> ListQuery[Fetch Records<br/>LIMIT, OFFSET, ORDER BY<br/>json field excluded]
ListQuery --> Format[Format Response]
Format --> Success[200 OK<br/>currentPage, totalCount, list]