This page was generated
January  28,  2016
4:07  AM
XQuery & XSLT Built-In & Modules Function Reference

Module: Client API - Service Extension Functions

Use the interfaces in this section to manage and use resource service extensions. Resource service extensions allow you to install custom XQuery modules on MarkLogic Server and expose them through a REST interface.

Use the /config/resources service to manage the XQuery module that implements your extension. Use the /ext service to manage assets in the Modules database associated with a REST API instance, including dependent libraries of resource service extensions and content transformations. Use the /resources service to invoke resource service extensions.

For details, see 'Extending the REST API' in the REST Application Developer's Guide.

REST Resource Summary
GET /v1/config/resources Retrieve a list of installed resource service extensions, including their metadata.
DELETE /v1/config/resources/{name} Uninstall the named resource service extension.
GET /v1/config/resources/{name} Retrieve the XQuery library module implementing the named resource service extension.
PUT /v1/config/resources/{name} Create or update a resource service extension.
DELETE /v1/ext/{directories} Delete the assets in /ext/{directories} in the modules database associated with the REST API instance.
GET /v1/ext/{directories} Retrieve a list of assets installed in the modules database associated with a REST API instance, such as a dependent library of an extension or transformation.
DELETE /v1/ext/{directories}/{asset} Remove the asset with document URI /ext/{directories}/{asset} from the modules database associated with this REST API instance.
GET /v1/ext/{directories}/{asset} Retrieve an asset installed in the modules database associated with a REST API instance, such as a dependent library of a module implementing an extension or a transformation.
PUT /v1/ext/{directories}/{asset} Install an asset such as a dependent library of an extension module in the modules database associated with this REST API instance.
DELETE /v1/resources/{name} Send a DELETE request to the named resource service extension.
GET /v1/resources/{name} Make a GET request to the named resource service extension.
POST /v1/resources/{name} Applies an extension-specific operation to a resource implemented by a resource service extension.
PUT /v1/resources/{name} Perform the PUT operation associated with a resource service extension.
REST Resource Detail
GET /v1/config/resources
Summary:

Retrieve a list of installed resource service extensions, including their metadata.

Parameters:
format? : The expected content type of the response, either xml or json. Overrides the Accept header.
refresh? : Whether or not to refresh metadata before generating the response. Default: true.

Request Headers:
Accept*: The expected MIME type of the response, either application/xml, application/json, or text/xml. Ignored if the format parameter is present.

Response Headers:
Content-type: The MIME type of the content in the response, either application/xml or application/json.

Required Privilege:

This operation requires the rest-reader role, or the following privilege:

http://marklogic.com/xdmp/privileges/rest-reader


Response:

Upon success, MarkLogic Server returns status 200 (OK) and returns the requested listing in XML or JSON in the response body. The amount of detail available for a given extension depends on the metadata specified during extension installation.

Usage Notes:

Specify the expected response content type using either the format parameter or Accept header. If you supply both, the format parameter takes precedence. If you specify neither, XML is returned.

When refresh is true (the default), extension metadata is rebuilt from the most recent installation of all extensions. When set to false, the metadata in the response reflects the contents as of the last refresh, and may be out of synch if there has been a subsequent update to the extension. You should only need to set refresh to false if you find this request is taking too long. Extension metadata is only used for informational purposes, so the ability of client applications to use an extension is not affected by out of synch metadata.

For details, see 'Discovering Resource Service Extensions' in the REST Application Developer's Guide.


Example:
$ curl --anyauth --user user:password -H "Accept: application/xml" -X GET -i \
    http://localhost:8004/v1/config/resources

==> A list of resource service extensions is returned as XML in the response
    body. For example, the output below reflects a extension, "example",
    which supports only a GET method. The GET method accepts a single
    string parameter, "the-uri". The provider is "Acme Widgets".

Server: MarkLogic
Content-Type: text/xml; charset=UTF-8
Content-Length: 211
Connection: close

HTTP/1.1 200 OK
Content-type: application/xml
Server: MarkLogic
Content-Length: 571
Connection: close

<rapi:resources xmlns:rapi="http://marklogic.com/rest-api">
  <rapi:resource>
    <rapi:name>example</rapi:name>
    <rapi:title/>
    <rapi:version/>
    <rapi:provider-name>Acme Widgets</rapi:provider-name>
    <rapi:description/>
    <rapi:methods>
      <rapi:method>
        <rapi:method-name>get</rapi:method-name>
        <rapi:parameter>
          <rapi:parameter-name>the-uri</rapi:parameter-name>
          <rapi:parameter-type>string</rapi:parameter-type>
        </rapi:parameter>
      </rapi:method>
    </rapi:methods>
    <rapi:resource-source>/v1/resources/example</rapi:resource-source>
  </rapi:resource>
</rapi:resources>
  
Example:
$ curl --anyauth --user user:password -X GET -i \
    -H "Accept: application/json" \
    http://localhost:8004/v1/config/resources

==> A list of resource service extensions is returned as JSON in the response
    body. For example, the output below reflects a single extension, "example",
    which supports only a GET method. The GET method accepts a single
    string parameter, "the-uri". The provider is "Acme Widgets".

Server: MarkLogic
Content-Type: text/xml; charset=UTF-8
Content-Length: 211
Connection: close

HTTP/1.1 200 OK
Content-type: application/json
Server: MarkLogic
Content-Length: 286
Connection: close

{
  "resources": {
    "resource": [
      {
        "name": "example",
        "title": "",
        "version": "",
        "provider-name": "Acme Widgets",
        "description": "",
        "methods": {
          "method": [
            {
              "parameter": [
                {
                  "parameter-name": "the-uri",
                  "parameter-type": "string"
                }
              ],
              "method-name": "get"
            }
          ]
        },
        "resource-source": "/v1/resources/example"
      }
    ]
  }
}
  

DELETE /v1/config/resources/{name}
Summary:

Uninstall the named resource service extension.

Required Privilege:

This operation requires the rest-admin role, or the following privileges:

http://marklogic.com/xdmp/privileges/rest-admin

http://marklogic.com/xdmp/privileges/rest-writer

http://marklogic.com/xdmp/privileges/rest-reader


Response:

MarkLogic Server responds with 204 Deleted.

Usage Notes:

For more information, see 'Extending the REST API' in the REST Application Developer's Guide.

Example:
$ curl --anyauth --user user:password -X DELETE -i \
    http://localhost:8004/v1/config/resources/example

==> The resource service extension installed with the name "example"
    is removed. MarkLogic Server responds with headers of the form:

Server: MarkLogic
Content-Type: text/xml; charset=UTF-8
Content-Length: 211
Connection: close

HTTP/1.1 204 Deleted
Server: MarkLogic
Content-Length: 0
Connection: close
  

GET /v1/config/resources/{name}
Summary:

Retrieve the XQuery library module implementing the named resource service extension.

Request Headers:
Accept?: The expected MIME type of the response. Only application/xquery is accepted.

Response Headers:
Content-type: The MIME type of the content in the response. The content type is always application/xquery.

Required Privilege:

This operation requires the rest-admin role, or the following privileges:

http://marklogic.com/xdmp/privileges/rest-admin

http://marklogic.com/xdmp/privileges/rest-writer

http://marklogic.com/xdmp/privileges/rest-reader


Response:

Upon success, MarkLogic server returns status 200 (OK) and returns the XQuery library module implementing the extension in the response body.

Usage Notes:

For more details, see 'Retrieving the Implementation of a Resource Service Extension' in the REST Application Developer's Guide.

Example:
$ curl --anyauth --user user:password -H "Accept: application/xquery" -i \
    -X GET http://localhost:8004/v1/config/resources/example

==> The contents of the XQuery library module that implements the
    "example" resource services. MarkLogic Server returns:

Server: MarkLogic
Content-Type: text/xml; charset=UTF-8
Content-Length: 211
Connection: close

HTTP/1.1 200 OK
Content-type: application/xquery
Server: MarkLogic
Content-Length: 650
Connection: close

xquery version "1.0-ml";
module namespace example="http://marklogic.com/rest-api/resource/example";
declare function example:get( 
...
  

PUT /v1/config/resources/{name}
Summary:

Create or update a resource service extension.

Parameters:
provider? : The name of the provider of the service. Optional, used only as metadata.
version? : The version of the service. Optional, used only as metadata.
title? : The title of the service. Optional, used only as metadata.
description? : A description of the service. Optional, used only as metadata.
method* : The name of an HTTP method supported by the extension. Accepted values: get, put, post delete. The parameter may be specified multiple times to specify multiple methods. Optional, used only as metadata.
method:{name}* : The name, type, and cardinality of a method parameter. For example, get:the-uri=string. The method must be one of get, put, post, or delete. The {name} is the parameter name. The parameter value is an XQuery SequenceType, including cardinality (*, ?, etc.) such as appears in the type declaration of an XQuery function parameter. Optional, used only as metadata.

Request Headers:
Content-type: The type of the request body. Since request body must contain an XQuery library module that implements the services provided for the named resource, the content type must be application/xquery

Required Privilege:

This operation requires the rest-admin role, or the following privileges:

http://marklogic.com/xdmp/privileges/rest-admin

http://marklogic.com/xdmp/privileges/rest-writer

http://marklogic.com/xdmp/privileges/rest-reader


Usage Notes:

For details on implementing a resource service extension, see 'Extending the REST API' in the REST Application Developer's Guide.

Example:
$ curl --anyauth --user user:password -X PUT -i \
  -H "Content-type: application/xquery" -d@"./example.xqy" \
  'http://localhost:8004/v1/config/resources/example'

==> A resource addressable through /v1/resources/example. MarkLogic Server 
    returns the following headers:

Server: MarkLogic
Content-Type: text/xml; charset=UTF-8
Content-Length: 211
Connection: close

HTTP/1.1 204 Created
Server: MarkLogic
Content-Type: text/plain; charset=UTF-8
Content-Length: 4
Connection: close
  
Example:
$ curl --anyauth --user user:password -X PUT -i \
  -H "Content-type: application/xquery" -d@"./example.xqy" \
  'http://localhost:8004/v1/config/resources/example?method=get&get:the-uri=string&provider=Acme Widgets'

==> A resource addressable through /v1/resources/example. The metadata for
    the extension will include parameter name and type information for the
    GET method. MarkLogic Server returns the following headers:

Server: MarkLogic
Content-Type: text/xml; charset=UTF-8
Content-Length: 211
Connection: close

HTTP/1.1 204 Created
Server: MarkLogic
Content-Type: text/plain; charset=UTF-8
Content-Length: 4
Connection: close
  

DELETE /v1/ext/{directories}
Summary:

Delete the assets in /ext/{directories} in the modules database associated with the REST API instance.

Required Privilege:

This operation requires the rest-admin role, or the following privileges:

http://marklogic.com/xdmp/privileges/rest-admin

http://marklogic.com/xdmp/privileges/rest-reader

http://marklogic.com/xdmp/privileges/rest-writer


Response:

Whether or not any assets exist under the given directory, MarkLogic Server returns status code 204 (Deleted).

Usage Notes:

{directories} must be one or more database directory path steps. For example: /your/domain/. Use the same directory path as was used to install the asset with GET /v1/ext/{directories}/{asset}.

For more details, see 'Managing Dependent Libraries and Other Assets' in the REST Application Developer's Guide.


Example:
$ curl --anyauth --user user:password -i -X DELETE  \
    'http://localhost:8003/v1/ext/my/example/'

==> All assets installed in /ext/my/example/ in the modules database are
    deleted. MarkLogic Server responds with output similar to the following:

HTTP/1.1 204 Deleted
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
  

GET /v1/ext/{directories}
Summary:

Retrieve a list of assets installed in the modules database associated with a REST API instance, such as a dependent library of an extension or transformation.

Parameters:
format? : The expected content type of the response, either xml or json. Overrides the Accept header.

Request Headers:
Accept*: The expected MIME type of the response, either application/xml, application/json, or text/xml. Ignored if the format parameter is present.

Response Headers:
Content-type?: The MIME type of the data in the response body, either application/xml or text/plain (JSON).

Required Privilege:

This operation requires the rest-admin role, or the following privileges:

http://marklogic.com/xdmp/privileges/rest-admin

http://marklogic.com/xdmp/privileges/rest-reader

http://marklogic.com/xdmp/privileges/rest-writer


Response:

Upon successful completion, MarkLogic Server responds with status code 200 (OK) and returns a list of installed assets in XML or JSON. See the examples, below. If no assets are found with the given directory path, MarkLogic Server returns status code 404 (Not Found).

Usage Notes:

{directories} must be one or more database directory path steps. For example: /your/domain/. Use the same directory path as was used to install the asset with GET /v1/ext/{directories}/{asset}.

The directory path must end with "/".

For more details, see 'Managing Dependent Libraries and Other Assets' in the REST Application Developer's Guide.


Example:
$ curl --anyauth --user user:password -i -H "Accept: application/xml" -X GET  \
    'http://localhost:8003/v1/ext'

==> A list of all assets installed in the modules database under /ext/.
    MarkLogic Server responds with output similar to the following:

HTTP/1.1 200 OK
Server: MarkLogic
Content-Type: text/xml; charset=UTF-8
Content-Length: 119
Connection: Keep-Alive
Keep-Alive: timeout=5

<rapi:assets xmlns:rapi="http://marklogic.com/rest-api">
  <rapi:asset>/ext/replace/my-lib.xqy</rapi:asset>
</rapi:assets>
  
Example:
$ curl --anyauth --user user:password -i -H "Accept: application/json" -X GET  \
    'http://localhost:8003/v1/ext'

==> A list of all assets installed in the modules database under /ext/,
    as JSON. MarkLogic Server responds with output similar to the following:

HTTP/1.1 200 OK
Server: MarkLogic
Content-Type: text/plain; charset=UTF-8
Content-Length: 48
Connection: Keep-Alive
Keep-Alive: timeout=5

{"assets":[
  {"asset":"/ext/replace/my-lib.xqy"}
]}
  
Example:
curl --anyauth --user user:password -i -H "Accept: application/xml" -X GET  \
    'http://localhost:8003/v1/ext/example/'

==> A list of all assets installed in the /ext/example/ directory of the
    modules database. MarkLogic Server responds with output similar to the 
    following:

HTTP/1.1 200 OK
Server: MarkLogic
Content-Type: text/xml; charset=UTF-8
Content-Length: 119
Connection: Keep-Alive
Keep-Alive: timeout=5

<rapi:assets xmlns:rapi="http://marklogic.com/rest-api">
  <rapi:asset>/ext/example/my-lib.xqy</rapi:asset>
</rapi:assets>
  

DELETE /v1/ext/{directories}/{asset}
Summary:

Remove the asset with document URI /ext/{directories}/{asset} from the modules database associated with this REST API instance.

Required Privilege:

This operation requires the rest-admin role, or the following privileges:

http://marklogic.com/xdmp/privileges/rest-admin

http://marklogic.com/xdmp/privileges/rest-reader

http://marklogic.com/xdmp/privileges/rest-writer


Response:

MarkLogic Server responds with 204 (Deleted), whether or not there is an asset in the modules database with the specified document URI.

Usage Notes:

/ext/{directories}/{asset} must be the document URI of the asset in the modules database, where {directories} is one or more database directory path steps, separated by "/", and {asset} is the asset document. See the example below.

To remove all assets in a database directory with a single request, use DELETE /v1/ext/{directories}.

For more details, see 'Managing Dependent Libraries and Other Assets' in the REST Application Developer's Guide.


Example:
$ curl --anyauth --user user:password -X DELETE -i \
    'http://localhost:8003/v1/ext/my/example/my-lib.xqy'

==> MarkLogic Server deletes the XQuery library module with the document 
    URI /ext/my/example/my-lib.xqy from the modules database associated
    with this REST API instance and returns a response similar to the
    following:

HTTP/1.1 204 Deleted
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
  

GET /v1/ext/{directories}/{asset}
Summary:

Retrieve an asset installed in the modules database associated with a REST API instance, such as a dependent library of a module implementing an extension or a transformation. The asset should have the database URI /ext/{directories}/{asset}.

Request Headers:
Accept?: The expected MIME type of the data in the response body. You are responsible for selecting the correct type for the asset being retrieved. Content negotiation is not supported.

Response Headers:
Content-type?: The MIME type of the data in the response body, derived from the Accept header.

Required Privilege:

This operation requires the rest-admin role, or the following privileges:

http://marklogic.com/xdmp/privileges/rest-admin

http://marklogic.com/xdmp/privileges/rest-reader

http://marklogic.com/xdmp/privileges/rest-writer


Response:

Upon successful completion, MarkLogic Server responds with status code 200 (OK) and returns the asset in the response body. If no asset is found with the specified URI, MarkLogic Server returns status code 404 (Not Found).

Usage Notes:

/ext/{directories}/{asset} should be the document URI of the asset in the modules database, where {directories} is one or more database directory path steps, separated by "/", and {asset} is the asset document. For example, if the asset is inserted into the database with the document URI /ext/your/domain/your-module.xqy then the request URL is of the form http://localhost:port/v1/ext/your/domain/your-module.xqy.

The response returns the asset with a Content-type corresponding to the MIME type in the Accept header. No content negotiation is supported. For example, if you specify application/xml in the Accept header, but retrieve a binary JPG document, then the response will have Content-type application/xml, even though the body actually contains JPG.

For more details, see 'Managing Dependent Libraries and Other Assets' in the REST Application Developer's Guide.


Example:
$ curl --anyauth --user user:password -i -X GET  \
    'http://localhost:8003/v1/ext/my/example/my-lib.xqy'

==> MarkLogic Server returns the XQuery library module in the modules
    database with the document URI /ext/my/example/my-lib.xqy. The response
    headers are similar to the following:

HTTP/1.1 200 OK
Content-type: application/xml
Server: MarkLogic
Content-Length: 633
Connection: Keep-Alive
Keep-Alive: timeout=5
  

PUT /v1/ext/{directories}/{asset}
Summary:

Install an asset such as a dependent library of an extension module in the modules database associated with this REST API instance. The asset is installed with the database URI /ext/{directories}/{asset}.

Parameters:
format? : Specify the asset document type for MarkLogic Server. Allowed values: xml, text, binary. If this parameter is not given, the document type is determined based on Content-type request header or the MIME type mapping defined for for the URI extension. For details, see 'Controlling Input and Output Content Type' in the REST Application Developer's Guide.
perm:{role}* : Give the asset the specified permissions, in addition to the default rest-admin permissions that all assets have. Any existing permissions beyond the default are replaced. Example: perm:my-role=execute. Valid capability values: read, update, execute.

Request Headers:
Content-type?: The MIME type of the data in the request body.

Required Privilege:

This operation requires the rest-admin role, or the following privileges:

http://marklogic.com/xdmp/privileges/rest-admin

http://marklogic.com/xdmp/privileges/rest-reader

http://marklogic.com/xdmp/privileges/rest-writer


Response:

Upon successful completion, MarkLogic Server responds with status code 201 (Created) or 204 (Updated).

Usage Notes:

/ext/{directories}/{asset} will be the document URI of the asset in the modules database, where {directories} is one or more database directory path steps, separated by "/", and {asset} is the asset document. See the example below.

The input document type is based on the MarkLogic Server MIME type mapping for the asset URI extension or on Content-type header. For details, see the discussion of document handling in 'Controlling Input and Output Content Type' in the REST Application Developer's Guide.

For more details, see 'Managing Dependent Libraries and Other Assets' in the REST Application Developer's Guide.


Example:
$ curl --anyauth --user user:password -X PUT -i -d @./my-lib.xqy \
    -H "Content-type: application/xquery"  \
    'http://localhost:8003/v1/ext/my/example/my-lib.xqy?perm:my-users=execute'

==> MarkLogic Server installs the XQuery library module that is in 
    the request body into the Modules database with the document 
    URI /ext/my/example/my-lib.xqy and returns a response similar
    to the following. The module is executable by users with the
    'my-users' role.

HTTP/1.1 201 Created
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
  

DELETE /v1/resources/{name}
Summary:

Send a DELETE request to the named resource service extension.

Parameters:
txid? : The transaction identifier of the multi-statement transaction in which to service this request. Use the /transactions service to create and manage multi-statement transactions.
rs:{name}* : A service-specific parameter. The name and expected value of the parameter is service dependent. For example, if the GET method of a service extension expects a boolean valued parameter named "reset", then include the URI parameter "rs:reset=true" to set it to true.

Request Headers:
Accept*: The accepted response MIME type, if any. The accepted values depends on service extension implementation.
Content-type?: The type of the request body. The accepted values are service dependent.

Response Headers:
Content-type?: The type of the response body. If the POST method returns multiple documents, the response is multipart/mixed.

Required Privilege:

This operation requires the rest-writer role, or the following privileges:

http://marklogic.com/xdmp/privileges/rest-reader

http://marklogic.com/xdmp/privileges/rest-writer


Response:

The status and response contents are extension-specific. If the service does not exists, or if the service exists but does not support this method, MarkLogic Server returns status 400 (Bad Request).

Usage Notes:

This operation invokes the delete function of a resource service extension previously installed using the PUT /v1/config/resources/{name}. You can use GET /v1/config/resources to discover the names and interfaces of installed extensions. For details, see 'Extending the REST API' in the REST Application Developer's Guide.

All request parameters intended for the underlying XQuery extension function must be prefixed with rs: to distinguish them from implementation independent request parameters like txid. For example, to pass a resource-specific parameter named arg1, include a request parameter named rs:arg1.

For more details, see 'Using a Resource Service Extension' in the REST Application Developer's Guide.


Example:
  

GET /v1/resources/{name}
Summary:

Make a GET request to the named resource service extension.

Parameters:
txid? : The transaction identifier of the multi-statement transaction in which to service this request. Use the /transactions service to create and manage multi-statement transactions.
rs:{name}* : A service-specific parameter. The name and expected value of the parameter is service dependent. For example, if the GET method of a service extension expects a boolean valued parameter named "reset", then include the URI parameter "rs:reset=true" to set it to true.

Request Headers:
Accept: The accepted response MIME type, if any. The accepted values depends on service extension implementation.

Response Headers:
Content-type: The type of the response body. If the GET method returns multiple documents, the response is multipart/mixed.

Required Privilege:

This operation requires the rest-reader role, or the following privilege:

http://marklogic.com/xdmp/privileges/rest-reader


Response:

The status and response contents are extension-specific.

Usage Notes:

This operation invokes the get function of a resource service extension previously installed using the PUT /v1/config/resources/{name}. You can use GET /v1/config/resources to discover the names and interfaces of installed extensions. For details, see 'Extending the REST API' in the REST Application Developer's Guide.

All request parameters intended for the underlying XQuery extension function must be prefixed with rs: to distinguish them from implementation independent request parameters like txid. For example, to pass a resource-specific parameter named arg1, include a request parameter named rs:arg1.

For more details, see 'Using a Resource Service Extension' in the REST Application Developer's Guide.


Example:
  

POST /v1/resources/{name}
Summary:

Applies an extension-specific operation to a resource implemented by a resource service extension.

Parameters:
txid? : The transaction identifier of the multi-statement transaction in which to service this request. Use the /transactions service to create and manage multi-statement transactions.
rs:{name}* : A service-specific parameter. The name and expected value of the parameter is service dependent. For example, if the GET method of a service extension expects a boolean valued parameter named "reset", then include the URI parameter "rs:reset=true" to set it to true.

Request Headers:
Accept*: The accepted response MIME type, if any. The accepted values depends on service extension implementation.
Content-type?: The type of the request body. The accepted values are service dependent.

Response Headers:
Content-type?: The type of the response body. If the POST method returns multiple documents, the response is multipart/mixed.

Required Privilege:

This operation requires the rest-writer role, or the following privileges:

http://marklogic.com/xdmp/privileges/rest-reader

http://marklogic.com/xdmp/privileges/rest-writer


Response:

The status and response contents are extension-specific. If the service does not exists, or if the service exists but does not support this method, MarkLogic Server returns status 400 (Bad Request).

Usage Notes:

This operation invokes the post function of a resource service extension previously installed using the PUT /v1/config/resources/{name}. You can use GET /v1/config/resources to discover the names and interfaces of installed extensions. For details, see 'Extending the REST API' in the REST Application Developer's Guide.

All request parameters intended for the underlying XQuery extension function must be prefixed with rs: to distinguish them from implementation independent request parameters like txid. For example, to pass a resource-specific parameter named arg1, include a request parameter named rs:arg1.

For more details, see 'Using a Resource Service Extension' in the REST Application Developer's Guide.


Example:
  

PUT /v1/resources/{name}
Summary:

Perform the PUT operation associated with a resource service extension.

Parameters:
txid? : The transaction identifier of the multi-statement transaction in which to service this request. Use the /transactions service to create and manage multi-statement transactions.
rs:{name}* : A service-specific parameter. The name and expected value of the parameter is service dependent. For example, if the GET method of a service extension expects a boolean valued parameter named "reset", then include the URI parameter "rs:reset=true" to set it to true.

Request Headers:
Accept*: The accepted response MIME type, if any. The accepted values depends on service extension implementation.
Content-type?: The type of the request body. The accepted values are service dependent.

Response Headers:
Content-type?: The type of the response body. If the PUT method returns multiple documents, the response is multipart/mixed.

Required Privilege:

This operation requires the rest-writer role, or the following privileges:

http://marklogic.com/xdmp/privileges/rest-reader

http://marklogic.com/xdmp/privileges/rest-writer


Response:

The status and response contents are extension-specific. If the service does not exist, or if the service exists but does not support this method, MarkLogic Server returns status 400 (Bad Request).

Usage Notes:

This operation invokes the put function of a resource service extension previously installed using the PUT /v1/config/resources/{name}. You can use GET /v1/config/resources to discover the names and interfaces of installed extensions. For details, see 'Extending the REST API' in the REST Application Developer's Guide.

All request parameters intended for the underlying XQuery extension function must be prefixed with rs: to distinguish them from implementation independent request parameters like txid. For example, to pass a resource-specific parameter named arg1, include a request parameter named rs:arg1.

For more details, see 'Using a Resource Service Extension' in the REST Application Developer's Guide.


Example: