Hello,
is there a way how to get or set comment reactions in REST API? This feature is in web app for quite a long time, but there's no mention of it nowhere in API docs.
Thanks!
Hi @Radim ,
I would suggest you create a suggestion for Atlassian to get or set comment reactions in REST API.
I created a suggestion for JIRA REST API here: https://jira.atlassian.com/browse/JRACLOUD-78412. Please revise and vote for it!
I just found @Radim had already created an issue: https://jira.atlassian.com/browse/JRACLOUD-78153.
Hi @Radim,
there are undocumented API for Data Center/Server
/rest/internal/2/reactions [GET, POST, DELETE]
And for Cloud:
/gateway/api/reactions/reactions [GET, POST, DELETE]
That could be used for this.
@Andrea Pannitti can you provide more information, or a link to where you found this? I get a 401 error when trying to access the api you gave for the Cloud, and I can't find any documentation or examples that use /gateway/api/.
Hi @Brent Jenkins ,
I'm sorry I couldn't answer earlier; anyway, try adding the following header to your request:
X-Atlassian-Token: no-check
In the body you have to specify: emojiId, ari and containerAri; for an example, check the network traffic from the console of your browser when you add a reaction manually.
Thanks for your tips and suggesting that header! Unfortunately I still get a 401 unauthorized error. While inspecting the network traffic doing it manually, it appears this api is still using cookie-based authentication. However, that authentication method has been deprecated by Jira for third party clients. So, it doesn't seem like there's a way to access this API any more? Maybe if I use an Admin API token with basic auth instead of a user token it would work?
Hey @Brent Jenkins ,
Why not get a valid cookie from a browser session and use that? I mean since you are already working with undocumented APIs at this point, you might as well start doing the really hackish solution ;-)
Seriously though, the way I would approach this is to look into the browser's web developer tools and then try to mimic what is going on there – including the cookie session. You'd be surprised how often this approach brings stable results.
Hope that helps, Oliver
It looks like you're new here. Sign in or register to get started.