I need to use a search API for retrieving the page by using text search.
There is a v2 rest API to get Page by title (https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-get). But this does not satisfy my use case.
It seems there are 2 v1 rest APIs with the same use case. Can anyone please explain me which is preferable. And are these safe to use or it may be soon deprecated ?
And I need to construct the download, redirect and copy url from these result. Please help me on a workaround for this scenarios.
The best way to search for Confluence content using various fields, operators is the CQL query language.
This is the end-point you should use to run CQL searches using the REST API: https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content/#api-wiki-rest-api-content-search-get
For example, this search will find you all pages with a title that contains "Data":
https://YOUR_SITE_NAME_HERE.atlassian.net/wiki/rest/api/content/search?cql=title~Data
@Aron Gombas _Midori_ Appreciate your reply. But I need to do a search across keyword and get their redirect url, download url and copy content. Is there any way to get those details on the API you have suggested.
Thanks in Advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, the response returned by the `/content/search` REST API end-point does include content IDs!
Using the IDs you can build all the URLs you mentioned.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got the html content from the search API using the query param expand=content.body.storage which can be used for copy.
I constructed the redirect url, I have appended the base in _links and also webui or should I use the field url or tinyui instead of webui.
I constructed the download url by appending the base in _links and exportword?pageId={page_id}
Is this fine as the base in _links is https://{domain}.atlassian.net/wiki
Is it safe to use this url /wiki/rest/api/search as this is not mentioned in Deprecation note ?
@Aron Gombas _Midori_ Thanks for your continuous assistance
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.