Metadata for Confluence
Breadcrumbs

Metadata REST API (v 3.3)

/rest/communardo/metadata/latest/filter/{pagenumber}  GET

Search for Confluence content and its metadata. You can search with the Confluence query language (CQL) or Lucene query language or combine them.

Path parameters

Parameter


Required

Default value 

Possible values / type

pagenumber

The page number of the result list.

https://communardo.atlassian.net/wiki/s/626371833/6452/634cf7c37efa7b4eab54b193b5c882fc93d0b2af/_/images/icons/emoticons/check.png


INTEGER greater 0

Query parameters

Parameter


Required

Default value

Possible values / type

cql

The query which defines the content to be searched given in the Confluence query language (CQL).


https://communardo.atlassian.net/wiki/s/626371833/6452/634cf7c37efa7b4eab54b193b5c882fc93d0b2af/_/images/icons/emoticons/information.png  Additional help for creating search conditions which include Metadata fields can be found in Searching with Metadata.

https://communardo.atlassian.net/wiki/s/626371833/6452/634cf7c37efa7b4eab54b193b5c882fc93d0b2af/_/images/icons/emoticons/warning.png Either the cql parameter or the query parameter has to be provided.


STRING

The CQL query string.

query

DEPRECATED  please prefer the cql parameter.

The query which defines the content to be searched given in the Lucene query syntax.


https://communardo.atlassian.net/wiki/s/626371833/6452/634cf7c37efa7b4eab54b193b5c882fc93d0b2af/_/images/icons/emoticons/information.png  Additional help for creating search conditions which include Metadata fields can be found in Searching with Metadata

https://communardo.atlassian.net/wiki/s/626371833/6452/634cf7c37efa7b4eab54b193b5c882fc93d0b2af/_/images/icons/emoticons/warning.png Either the cql parameter or the query parameter has to be provided.


STRING

The Lucene query string.

sort

The column to use for sorting the results.

https://communardo.atlassian.net/wiki/s/626371833/6452/634cf7c37efa7b4eab54b193b5c882fc93d0b2af/_/images/icons/emoticons/check.png


STRING

The name of the column. Examples:

  • sort by page title withcontent-name-untokenized

  • sort by a Metadata field by providing the field keymetadatafield.status

sortdirection

The order in which the result should be sorted.

https://communardo.atlassian.net/wiki/s/626371833/6452/634cf7c37efa7b4eab54b193b5c882fc93d0b2af/_/images/icons/emoticons/check.png


  • ASCENDING

  • DESCENDING 

pagesize

The number of items to return per result page.

https://communardo.atlassian.net/wiki/s/626371833/6452/634cf7c37efa7b4eab54b193b5c882fc93d0b2af/_/images/icons/emoticons/check.png


INTEGER greater 0

fields

Narrow down the list of displayed Metadata fields per result.


All metadata fields of the content results will be contained.

A comma separated list of fields. Example:

metadatafield.status,metadatafield.contactperson

ceo

The ID of a page or a blogpost to define the context of the request. This is especially useful when using CQL with functions like currentSpace().



INTEGER


Example Request with JavaScript


JavaScript
jQuery.get( contextPath + "/rest/communardo/metadata/latest/filter/1" , {
    cql: 'global.metadatafield.contactperson="admin"',
    pagesize: 10,
    sortdirection: "DESCENDING",
    sort: "content-name-untokenized",
	fields: "global.metadatafield.contactperson"
}, function(data) {
    console.log(data);
});

Please note: latest/filter/1 displays the first page of the results. If you have more than 10 results, you can get the next result set by incrementing the pagenumber path parameter.

Example Response


{
	"pageNo": "1",
	"self": "https://wiki.company.de/rest/communardo/metadata/latest/filter",
	"searchResults": [{
		"pageTitle": "Example",
		"pageUrl": "/display/~admin/Example",
		"pageId": 1234567,
		"contentType": "page",
		"values": [{
			"id": 80,
			"key": "global.metadatafield.contactperson",
			"title": "Contact Person",
			"content": "<a class=\"confluence-userlink user-mention current-user-mention\" data-username=\"admin\" href=\"https://wiki.company.de/display/~admin\" data-linked-resource-id=\"25624936\" data-linked-resource-version=\"1\" data-linked-resource-type=\"userinfo\" data-base-url=\"https://wiki.company.de\">Administrator</a>"
		},
		{
			"id": 81,
			"key": "global.metadatafield.pagestatus",
			"title": "Page Status",
			"content": "Approved"
		},
		{
			"id": 82,
			"key": "global.metadatafield.pagestatusmessage",
			"title": "Page Status Message",
			"content": "nothing to do here"
		}]
	}],
	"pager": {
		"currentPage": 1,
		"pageCount": 1,
		"elementsPerPage": 10,
		"totalElementsCount": 1
	}
}