Skip to main content

Resource handlers

APEX Office Edit comes with a fully configured RESTful service module handling the following document operations described in the table below.

Handler purposeURI templateMethod
Create a new documentfiles/create/:typeGET
Get a document informationfiles/:fileidGET
Get a document contentsfiles/:fileid/contentsGET
Update a document contentsfiles/:fileid/contentsPOST
Save a document as a copy with a new filename and rename a documentfiles/:fileidPOST

Additionally, the RESTful service contains handlers supporting integration with an Oracle APEX application.

Handler purposeURI templateMethod
Test if RESTful service module is availablefiles/knockknockGET
Get a document meta-datafiles/meta/GET

Create a new document

URI TemplateMethodSource TypeFormat
files/create/:typeGETPL/SQLJSON

The plug-in uses the handler to create a new document of the selected type. Whenever the end-user requests a new file to be created, the handler is executed, and the new file is created using the configuration set at the APEX page designer level.

Get a document information

URI TemplateMethodSource TypeFormat
files/:fileidGETPL/SQLJSON

The AOE host server uses the handler to fetch the document information required to load and modify a document. The handler evaluates the end-user permissions on the requested document and returns the configuration of the AOE document editor.

Defined parameters

NameBind VariableSource TypeAccess MethodData Type
access_tokenaccess_tokenURIINSTRING

Other bind variables used

Bind VariableDescription
:fileidURI template parameter
:status_codeNative REST bind variable to assign HTTP status code
:content_typeNative REST bind variable to assign response content type

Get the contents of a document

URI TemplateMethodSource TypeFormat
files/:fileid/contentsGETPL/SQLJSON

The AOE host server uses the handler to fetch the document contents. After successfully downloading a document's contents, the handler executes PL/SQL callback defined for reading documents.

Defined parameters

NameBind VariableSource TypeAccess MethodData Type
access_tokenaccess_tokenURIINSTRING

Other bind variables used

Bind VariableDescription
:fileidURI template parameter
:status_codeNative REST bind variable to assign HTTP status code
:content_typeNative REST bind variable to assign response content type

Update a document's contents

URI TemplateMethodSource TypeFormat
files/:fileid/contentsPOSTPL/SQLJSON

The AOE host server uses the REST handler to update the currently opened document contents. After successfully updating a document, the handler executes PL/SQL callback defined for updating documents.

Defined parameters

NameBind VariableSource TypeAccess MethodData Type
access_tokenaccess_tokenURIINSTRING
X-LOOL-WOPI-ExtendedDatadataHTTP HeaderINSTRING
X-LOOL-WOPI-Timestamppassed_header_timestampHTTP HeaderINSTRING
X-LOOL-WOPI-IsAutosaveautosaveflagHTTP HeaderINSTRING
X-LOOL-WOPI-IsExitSaveis_exit_saveHTTP HeaderINSTRING
X-LOOL-WOPI-IsModifiedByUserismodifiedbyuserHTTP HeaderINSTRING

Other bind variables used

Bind VariableDescription
:fileidURI template parameter
:status_codeNative REST bind variable to assign HTTP status code

Save a document as a copy with a new filename and rename a document

URI TemplateMethodSource TypeFormat
files/:fileidPOSTPL/SQLJSON

The AOE host server uses the REST handler to create a new document based on an existing, currently opened document. After successfully updating a document, the handler executes PL/SQL callback defined for updating documents.

Defined parameters

NameBind VariableSource TypeAccess MethodData Type
access_tokenaccess_tokenURIINSTRING
X-WOPI-OverwriteRelativeTargeth_should_overwriteHTTP HeaderINSTRING
X-WOPI-RelativeTargetfilenameHTTP HeaderINSTRING
X-WOPI-SuggestedTargetsuggested_nameHTTP HeaderINSTRING
X-WOPI-Overridewopi_overrideHTTP HeaderINSTRING

Other bind variables used

Bind VariableDescription
:fileidURI template parameter
:status_codeNative REST bind variable to assign HTTP status code
:bodyNative REST bind variable referencing document content

Test if the RESTful service module is available

URI TemplateMethodSource TypeFormat
files/knockknockGETPL/SQLJSON

The plug-in uses the REST handler to check if the RESTful service is available. If it's unavailable or returns an invalid response, the plug-in shows an error.

Get a document meta-data

URI TemplateMethodSource TypeFormat
files/knockknockGETPL/SQLJSON

The plug-in uses the REST handler to fetch a document's meta-data, such as filename, version, last modification time, and document owner.

Defined parameters

NameBind VariableSource TypeAccess MethodData Type
access_tokenaccess_tokenURIINSTRING

Other bind variables used

Bind VariableDescription
:status_codeNative REST bind variable to assign HTTP status code