Read document or record
Motivation
Read CDoc/WDoc/CRecord/WRecord using API
Functional design
GET /api/v2/apps/{owner}/{app}/workspaces/{wsid}/docs/{pkg}.{table}/{id}
Headers
| Key | Value |
|---|---|
| Authorization | Bearer {PrincipalToken} |
Parameters
| Parameter | Type | Description |
|---|---|---|
| owner | string | name of a user who owns the application |
| app | string | name of an application |
| wsid | int64 | the ID of workspace |
| pkg, table | string | identifies a table (document or record) |
| id | int64 | ID of a document or record |
The following query constraints can be used:
- include (respects permission on reading from the table or a container)
- keys
Result
| Code | Description | Body |
|---|---|---|
| 200 | OK | CDoc/WDoc/CRecord/WRecord object |
| 400 | Bad requeset | error object |
| 403 | Forbidden | error object |
| 404 | Document not found | error object |
Technical design
Components
- pkg/processors/query2
- pkg/sys/it
- integration test for /docs/
~it.TestQueryProcessor2_Docs~covrd4✅
- integration test for /docs/