Accessing Articles/Knowledge Base via REST API
Hello, I'm looking to integrate with YouTrack InCloud via OAuth2.0 and cannot find information in the REST API documentation (https://www.jetbrains.com/help/youtrack/incloud/youtrack-rest-api-reference.html) about accessing articles.
Is that supported?
Thanks in advance!
Please sign in to leave a comment.
Hello Mitko,
There are no public docs at the moment, but we are looking forward to publishing them.
Thank you Sergey Kochetkov - does that mean that the API exists, but it is just not documented yet?
Hello Mitko,
Yes, you are correct.
Do you have any timeline for publishing the docs?
Hi!
I'm Sergey from the Youtrack team.
This is on our short-term list and we plan to start working on it in the near future, though I'm afraid, there's no exact timeline for it. Please stay tuned for further updates.
Here's the REST API for articles:
"https://example.myjetbrains.com/youtrack/api/articles?fields=id,summary,project(name),content"
It gets the articles for all projects gives a JSON with the ID of article, summary(title) of article, contents of that respective article and the name of the project they are in. Also replace "example" with your YT url.
And if you want the articles of a certain project the API is:
"https://example.myjetbrains.com/youtrack/api/admin/projects/<project_id>/articles?fields=id,summary,content"
Where you have to replace project_id with the ID of the project whose articles you want.
Thank you for sharing this.
One can always find the API endpoints in the browser's network requests, as Youtrack's frontend calls them. However, generally, we don't recommend relying on them unless they are officially documented, as non-documented APIs can be subject to change.
Thanks for the suggestion Sergey. Also is there a way I can help out in updating the documentation.
We should be good. Thank you very much for your offer, though. We really appreciate it!
Hi, i'm using the REST API suggested by Nirajnandish.
Are there other fields available besides id, summary and content?
Also I would need to get the document tree in the left column
If you can help me I would be very grateful
In any case, are you going to publish official documentation on the rest api for the knowledge base?
Thanks
Ok I solved by myself finding them in the network requests as suggested by Sergey Merzlov. I leave here the fields that I am using in case they are useful to someone else
articles?fields=id,summary,content,parentArticle(id),ordinal
Thanks for the update. Glad to hear you found the supported fields in the network requests. That's currently the way to go until official documentation is published.
We surely are, though no timetable for this yet, I'm afraid. I may also suggest following our blog where we post all the major Youtrack updates so that you won't miss it.
I have a quick question about creating articles. I'm able to view/list articles based on the methods and approaches above but is it possible currently to create an article using a POST call? I don't think that's something I can use the network requests to identify
Hi!
It's also available in the network requests when you create a new article. You need to send a POST request to youtrack/api/articles. Here's the sample request body with a minimum amount of data:
That's great - thanks!
Just in case, the related documentation was published a while ago and is available at https://www.jetbrains.com/help/youtrack/devportal/resource-api-articles.html
404 error
Volkov A
I have fixed the link, please check it now.
Super, thnx