Skip to main content

APIv2

Motivation​

  • We need good REST API for Voedger
  • Old API must still be available until the new one is fully developed, so we can continue with AIR

Functional design​

API Conventions​

REST API Paths​

ActionREST API Path
Authentication
Creates a new principal tokenPOST /api/v2/apps/{owner}/{app}/auth/login
Refreshes a valid principal tokenPOST /api/v2/apps/{owner}/{app}/auth/refresh
Logins
Create(register) a new userPOST /api/v2/apps/{owner}/{app}/users
Change user passwordPOST /api/v2/apps/{owner}/{app}/users/change-password
Devices
Create(register) a new devicePOST /api/v2/apps/{owner}/{app}/devices
Docs and records
Create document or recordPOST /api/v2/apps/{owner}/{app}/workspaces/{wsid}/docs/{pkg}.{table}
Update document or recordPATCH /api/v2/apps/{owner}/{app}/workspaces/{wsid}/docs/{pkg}.{table}/{id}
Deactivate document or recordDELETE /api/v2/apps/{owner}/{app}/workspaces/{wsid}/docs/{pkg}.{table}/{id}
Read document or recordGET /api/v2/apps/{owner}/{app}/workspaces/{wsid}/docs/{pkg}.{table}/{id}
Read from CDoc CollectionGET /api/v2/apps/{owner}/{app}/workspaces/{wsid}/cdocs/{pkg}.{table}
BLOBs
Create BLOBPOST /api/v2/apps/{owner}/{app}/workspaces/{wsid}/docs/{pkg}.{table}/blobs/{fieldName}
Read BLOBGET /api/v2/apps/{owner}/{app}/workspaces/{wsid}/docs/{pkg}.{table}/{id}/blobs/{fieldName}
Temporary BLOBs
Create temporary BLOBPOST /api/v2/apps/{owner}/{app}/workspaces/{wsid}/tblobs
Read temporary BLOBGET /api/v2/apps/{owner}/{app}/workspaces/{wsid}/tblobs/{suuid}
Extensions
Execute CommandPOST /api/v2/apps/{owner}/{app}/workspaces/{wsid}/commands/{pkg}.{command}
Read from QueryGET /api/v2/apps/{owner}/{app}/workspaces/{wsid}/queries/{pkg}.{query}
Views
Read from ViewGET /api/v2/apps/{owner}/{app}/workspaces/{wsid}/views/{pkg}.{view}
Notifications
Create channel, subscribe and start watchingPOST /api/v2/apps/{owner}/{app}/notifications
Subscribe to an extra viewPUT /api/v2/apps/{owner}/{app}/notifications/{channelId}/workspaces/{wsid}/subscriptions/{pkg}.{view}
Unsubscribe from subscriptionDELETE /api/v2/apps/{owner}/{app}/notifications/{channelId}/workspaces/{wsid}/subscriptions/{pkg}.{view}
Schemas
List app workspacesGET /api/v2/apps/{owner}/{app}/schemas
List workspace rolesGET /api/v2/apps/{owner}/{app}/schemas/{pkg}.{workspace}/roles
Read workspace role schemaGET /api/v2/apps/{owner}/{app}/schemas/{pkg}.{workspace}/roles/{pkg}.{role}

Limitations​

  • The following functions should not be calle directly:
    • c.sys.CUD
    • q.sys.Collection

Addressed issues​

See Also​