curl -u admin:admin -X GET
"http://localhost:8080/confluence/rest/api/content?title=myPage%20Title&spaceKey=TST&expand=history"
| python -mjson.tool
Community moderators have prevented the ability to post new answers.
Well, welcome to the ecosystem and atlassian answers Oleg. Hello and how are you?
Anyway, to answer your questions and more than you even asked: The Confluence REST API itself and Confluence Query Language are currently under development. Soon you should be able to query for things like labels via a stable API path but currently as you noticed, yes those are published under the path
If you're interested in learning more about these concepts and where they are at the moment, I suggest you check out these documents:
Oooh, this is good too: https://developer.atlassian.com/docs/developer-tools/using-the-rest-api-browser
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As @Steven Behnke metioned the documentation to Advanced searching with CQL. This may be what you are looking for and is not supported until version 5.7. This helped me accomplish something similar.
http://servername/rest/api/content/search?cql=type=page%20AND%20label=playground
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't know of a great way to do it with the REST API yet. But here is how I am doing it in our instance.
<script type="text/javascript"> AJS.$.ajax({ dataType: 'json', contentType: 'application/json', type: 'POST', url: '/rpc/json-rpc/confluenceservice-v2/getLabelContentByName', data: '["{your label here}"]', //<-- change this success: function(data){ for(var dat in data) { //Do stuff here } } }); </script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for solution, though they say RPC APIs are going to be deprecated after 5.5: https://developer.atlassian.com/display/CONFDEV/Confluence+REST+API
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It seems I have two options here: either go with deprecated or with experimental API :) building a plugin to provide REST API extension, unfortunately, is not an option in my case due to possible deployment limitations.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The deprecation simply means that they are not adding features to that API right now as they are going to focus on the REST API. However, it cannot go away for a while as there is much functionality in the old APIs that is not in REST yet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is "experimental" API the only way? Guys, today is my first day as "confluence developer" and I'm probably starting with the most "stupid" questions, but, is "experimental" API stable enough for using it in production?
btw, here is what solves my problem:
/rest/experimental/content/?expand=body.storage%2Cversion%2Cancestors%2Cmetadata.labels%2Clabels&cql=label=mylabel
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.