Class Reference
IRIS for UNIX 2024.1.2
InterSystems: The power behind what matters   
Documentation  Search
  [USER] >  [%Api] >  [DocDB] >  [v1]
Private  Storage   

class %Api.DocDB.v1 extends %DocDB.REST

%Api.DocDB.v1 provides version 1 APIs for DocDB

Http/Rest Calls


APIURIHTTP MethodContentDescriptionRole/Permission
GetAllDatabases /namespaceName GET none Return the name of each Database defined in the namespaceName Namespace. %DocDB_Admin/USE
DropAllDatabases /namespaceName DELETE none Delete all of the databases defined in the namespaceName namespace. %DocDB_Admin/USE
CreateDatabase /namespaceName/db/databaseName ?type= documentType& resource= databaseResource POST none Create a new Database in the namespaceName namespace. %DocDB_Admin/USE
DropDatabase /namespaceName/db/ databaseName DELETE none Drop the databaseName database from namespaceName namespace. %DocDB_Admin/USE
GetDatabase /namespaceName/db/ databaseName GET none Return the databaseName database definition. This function is also sufficient for DatabaseExists. defined resource/USE
CreateProperty /namespaceName/ prop/databaseName/ propertyName?type= propertyType& path= propertyPath& unique=propertyUnique POST none Create a new property or replace an existing property in databaseName. The property is defined by URL parameters and not Content. All parameters are optional. %DocDB_Admin/USE
DropProperty /namespaceName/prop/ databaseName /propertyName DELETE none Remove a property definition from databaseName. %DocDB_Admin/USE
GetProperty /namespaceName/prop/ databaseName/ propertyName GET none Return the property definition from databaseName. defined resource/USE
SaveDocument /namespaceName/doc/databaseName/ POST JSON object or array Insert a new document into databaseName. defined resource/WRITE
SaveDocument /namespaceName/doc/ databaseName/id PUT JSON object or array Replace an existing document in databaseName. defined resource/WRITE
SaveDocumentByKey /namespaceName/doc/ databaseName/keyPropertyName/keyValue PUT JSON object or array Replace an existing document in databaseName. defined resource/WRITE
DeleteDocument /namespaceName/doc/ databaseName/id DELETE none Delete the document from the database. defined resource/WRITE
DeleteDocumentByKey /namespaceName/doc/ databaseName/keyPropertyName/keyValue DELETE none Delete the document from the database. defined resource/WRITE
FindDocuments /namespaceName/ find/databaseName? wrapped=true|false POST JSON object Find all documents in databaseName matching the query specification. defined resource/USE
GetDocument /namespaceName/doc/ databaseName/id? wrapped=true|false GET none Return the requested document. defined resource/READ
GetDocumentByKey /namespaceName/doc/ databaseName /keyPropertyName /keyValue POST None Retrieve a document by a property defined as a unique key. defined resource/READ

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
5 17


Summary

Methods
%ClassIsLatestVersion %ClassName %DispatchClassMethod %DispatchGetModified
%DispatchGetProperty %DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty
%DispatchSetProperty %Extends %GetParameter %IsA
%New %OriginalNamespace %PackageName %SetModified
AcceptsContentType AccessCheck AccessibleNamespaces ConvertParameter
Decrypt DispatchRequest DrawCSS3STYLE DrawHEAD
DrawSTHEAD DrawSTTitle DrawSTYLE DrawTitle
DrawTitleSection Encrypt Error EscapeHTML
EscapeURL GetAuthChallenge Http403 Http404
Http405 Http500 HyperEventCall HyperEventHead
Include InsertHiddenField InsertHiddenFields IsPrivate
Link Login OnErrorSetup OnHTTPHeader
OnHandleCorsRequest OnHandleOptionsRequest OnLoginPage OnPage
OnPageError OnPostHTTP OnPostHyperEvent OnPreDispatch
OnPreHTTP OnPreHyperEvent OnSecurityTokenPage Page
QuoteJS RenderResponseBody ReportHttpStatusCode RewriteURL
SQLCODEToHttpStatus ServeXml SetClientServerHash SetResponseHeaderIfEmpty
ShowError StartTimer StatusToJSON StatusToProxyObject
StopTimer SupportedVerbs ThrowError UnescapeHTML
UnescapeURL exceptionToHttpResponse exceptionToHttpStatus getRequestBody
httpDeleteDatabase httpDeleteDocument httpDeleteDocumentByKey httpDeleteNamespace
httpDeleteProperty httpGetDatabase httpGetDocument httpGetDocumentByKey
httpGetNamespace httpGetProperty httpPostDatabase httpPostDocument
httpPostFind httpPostProperty httpPostServer httpPutDocument
httpPutDocumentByKey


Parameters

• parameter CHARSET = "utf-8";
Specifies the default character set for the page. This can be overriden using the <CSP:CONTENT CHARSET=> tag, or by setting the %response.CharSet property in the OnPreHTTP method. If this parameter is not specified, then for the default charset is utf-8.
• parameter CONTENTTYPE = "application/json";
Specifies the default content type for the page. This can be overriden using the <CSP:CONTENT TYPE=> tag, or by setting the %response.ContentType property in the OnPreHTTP method. The default value if this parameter is not set is text/html.
• parameter CONVERTINPUTSTREAM = 1;
Specifies if input %request.Content or %request.MimeData values are converted from their original character set on input. By default (0) we do not modify these and receive them as a binary stream which may need to be converted manually later. If 1 then if there is a 'charset' value in the request Content-Type or mime section we will convert from this charset when the input data is text based. For either json or xml data with no charset this will convert from utf-8 or honor the BOM if one is present.
• parameter HandleCorsRequest = 1;
This parameter influences the CORS support. The default is an empty string meaning 'not specified'. If set to true (1) then CORS processing is ON. If set to false (0) then CORS processing is OFF. If left unset "" then the decision to process CORS is delegated to the setting on the URL map route.
• parameter UseSession = 1;
This parameter controls the CSP session support. By default the CSP session will be ended after each request in accordance with the spirit of REST. However this CAN be overridden by the user. To use a session, it's necessary to manage the CSPSESSION cookie. Browsers do this automatically but command line tools such as CURL require the setting of options.

Note that if you choose to use a session then this will use a CSP license until the session is ended or expires and the grace period has been satisfied. If you use the default of no session then this will be the same behavior as SOAP requests of holding a license for ten seconds.


Methods

• classmethod httpDeleteDatabase(namespaceName As %String(MAXLEN=""), databaseName As %String(MAXLEN="")) as %Status
• classmethod httpDeleteDocument(namespaceName As %String(MAXLEN=""), databaseName As %String(MAXLEN=""), documentID As %String(MAXLEN="")) as %Status
• classmethod httpDeleteDocumentByKey(namespaceName As %String(MAXLEN=""), databaseName As %String(MAXLEN=""), keyName As %String(MAXLEN=""), keyValue As %String(MAXLEN="")) as %Status
• classmethod httpDeleteNamespace(namespaceName As %String(MAXLEN="")) as %Status
• classmethod httpDeleteProperty(namespaceName As %String(MAXLEN=""), databaseName As %String(MAXLEN=""), propertyName As %String(MAXLEN="")) as %Status
• classmethod httpGetDatabase(namespaceName As %String(MAXLEN=""), databaseName As %String(MAXLEN="")) as %Status
• classmethod httpGetDocument(namespaceName As %String(MAXLEN=""), databaseName As %String(MAXLEN=""), documentID As %String(MAXLEN="")) as %Status
• classmethod httpGetDocumentByKey(namespaceName As %String(MAXLEN=""), databaseName As %String(MAXLEN=""), keyName As %String(MAXLEN=""), keyValue As %String(MAXLEN="")) as %Status
• classmethod httpGetNamespace(namespaceName As %String(MAXLEN="")) as %Status
• classmethod httpGetProperty(namespaceName As %String(MAXLEN=""), databaseName As %String(MAXLEN=""), propertyName As %String(MAXLEN="")) as %Status
• classmethod httpPostDatabase(namespaceName As %String(MAXLEN=""), databaseName As %String(MAXLEN="")) as %Status
• classmethod httpPostDocument(namespaceName As %String(MAXLEN=""), databaseName As %String(MAXLEN="")) as %Status
• classmethod httpPostFind(namespaceName As %String(MAXLEN=""), databaseName As %String(MAXLEN="")) as %Status
• classmethod httpPostProperty(namespaceName As %String(MAXLEN=""), databaseName As %String(MAXLEN=""), propertyName As %String(MAXLEN="")) as %Status
• classmethod httpPostServer() as %Status
This method returns a list of namespaces for this server HTTP Codes returned:- HTTP 200 if OK HTTP 500 if an error occurs (details will be in status error array) returned content is an array of namespaces
• classmethod httpPutDocument(namespaceName As %String(MAXLEN=""), databaseName As %String(MAXLEN=""), documentID As %String(MAXLEN="")) as %Status
• classmethod httpPutDocumentByKey(namespaceName As %String(MAXLEN=""), databaseName As %String(MAXLEN=""), keyName As %String(MAXLEN=""), keyValue As %String(MAXLEN="")) as %Status


Copyright (c) 2025 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.