Hi Folks i want to know does Confluence API support or provide results for full text data ie. content of documents. I can see for blogs and pages we can retrieve the body, but not sure is it possible for uploaded word or pdf documents.
thanks,
Raj
Hey Raj,
Welcome to the Community! You can indeed use the API to search the text of documents for indexable content (Word, Text, PowerPoint, Excel, PDF, and HTML). The mechanism for searching via API is CQL - here are the documents on all the available search operators.
The text parameter includes the contents of attachments. For example, if I've got a text attachment that contains the word "potato", this search will return it:
https://mysite.atlassian.net/wiki/rest/api/content/search?cql=text ~ "potato"
For completeness (although you're asking about Cloud), I'll mention that Confluence Server would use the contentBody parameter for searching instead of the text parameter. Just a slight difference to note for anyone else finding this via Google search and looking for Server help.
Hope that helps!
Cheers,
Daniel
Hey Daniel,
I am using CQL search, but sometimes the results for the search term return empty. When I do the same search manually in Confluence, I get loads of results. So, is there a way to replicate the manual search with the API?
Here's an example for the search term: "What is the per diem costs allowed to be reimbursed for business trips to Paris?"
Manual search returning multiple results:
API search returning zero results:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.