Retrieve a list of REST API instances, including configuration details. This request is only available on port 8002.
Upon success, MarkLogic Server returns status 200 OK and configuration details on all REST API instances, in XML or JSON.
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
The expected response type can be specified using either the
format
parameter or Accept
header. One or
the other must be supplied. If both are supplied and are different,
the format
parameter takes precedence.
For more details, see Retrieving Configuration Information in the REST Application Developer's Guide.
curl --anyauth --user user:password -X GET -i -H "Accept: application/xml" \ http://localhost:8002/v1/rest-apis ==> Information about configured REST services, in XML: Content-type: text/html; charset=UTF-8 Server: MarkLogic Content-Length: 1992 Connection: close HTTP/1.1 200 OK Server: MarkLogic Content-Type: text/xml; charset=UTF-8 Content-Length: 108 Connection: close <rapi:rest-apis xmlns:rapi="http://marklogic.com/rest-api"> <rapi:rest-api> <rapi:name>my-service</rapi:name> <rapi:group>Default</rapi:group> <rapi:database>my-database</rapi:database> <rapi:modules>my-service-modules</rapi:database> <rapi:port>8003</rapi:port> </rapi:rest-rapi:api> </rapi:rest-apis>
curl --anyauth --user user:password -i -X GET -H "Accept: application/json" \ http://localhost:8002/v1/rest-apis ==> Information about configured REST services, in JSON: HTTP/1.1 200 OK vnd.marklogic.document-format: json Content-type: application/json; charset=UTF-8 Server: MarkLogic Connection: close { "rest-apis": [ { "name": "my-service", "group": "Default", "database": "my-database", "modules": "my-service-modules", "port": "8003" } ] }