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

403

Forbidden

404

Document not found

Technical design

Components

  • pkg/processors/query2

    • IApiPathHandler implementation for handling ApiPath_Docs

      • ~cmp.docsHandler~

    • newQueryProcessorPipeline: provide API handler for ApiPath_Docs

      • ~cmp.provideDocsHandler~

    • check ACL when including referenced objects and/or containers ~cmp.includeCheckACL~

  • pkg/sys/it

    • integration test for /docs/

      • ~it.TestQueryProcessor2_Docs~

Last updated

Was this helpful?