-
Hello, I am attempting to Reactions on a PullRequest Comment and I’m seeing this “Resource not accessible by integration” error. I’ve seen that people get that error when trying to write when they only have read access. I would think this API only needs read access though. I believe I’m using My
In another action in the same workflow, I’m successfully modifying a PR comment, so I seem to have write access on my token. I’m pretty confused what’s going on here. I’m creating my octokit like this in my js code following https://github.com/actions/toolkit/tree/main/packages/github since that API needs the preview parameter:
Calling the API with something like this:
I’m not sure if the curl works on the endpoint even. Trying to follow the docs here https://docs.github.com/en/rest/reference/reactions#list-reactions-for-an-issue.
Seeing:
Am I using the incorrect? I’m not sure what I’m missing. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Hi @myyk, Glad to see you in Github Community Forum! The API url should be “/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions”, in your curl command, it’s ‘pulls’ which is not correct. In your action index.js line 13, please add issues as well, should be:
Thanks |
Beta Was this translation helpful? Give feedback.
-
Hi @weide-zhou , Thank you for your response! Sorry for the confusing link above, the docs should be at https://docs.github.com/en/rest/reference/reactions#list-reactions-for-a-pull-request-review-comment since I am in trying to list reactions on a pull request comment (not on an issue’s comment as the link was). I must be using the API incorrectly. I think if we solve why the curl request is failing it might become obvious what’s wrong in code.
This returns Do you see anything wrong here? |
Beta Was this translation helpful? Give feedback.
-
Hi @myyk, Thanks for your quick reply! pull request is actually an issue. The comment on your pull request is not a review comment, you can confirm with rest api here. Hence, you should use the api below for comment reaction:
|
Beta Was this translation helpful? Give feedback.
-
Hi @weide-zhou, Oh yeah, those are do use that different API, thanks for helping me understand that github nomenclature. I have a small follow up question that. In the API docs, I see this:
But in my request, I don’t a
|
Beta Was this translation helpful? Give feedback.
-
Hi @myyk, As the API doc mentioned, this reaction object exists in issue coment payload, you can get it via list the issue comment with media type: Issue CommentsGet started with one of our guides, or jump straight into the API documentation. Thanks |
Beta Was this translation helpful? Give feedback.
-
Thank you @weide-zhou! I was able to make a request exactly as I wanted to. Thank you for your help! To summarize what you showed me in regard to getting reaction summary info from myyk/git-democracy#10 (comment)
I ended up with something like this:
|
Beta Was this translation helpful? Give feedback.
Thank you @weide-zhou! I was able to make a request exactly as I wanted to. Thank you for your help!
To summarize what you showed me in regard to getting reaction summary info from myyk/git-democracy#10 (comment)
I was using the wrong API since the comment uses the issue comments API, not the pull request comments API even though it appears on the Pull Request page. https://developer.github.com/v3/issues/comments/#get-an-issue-comment
I needed to add the
Accept: application/vnd.github.squirrel-girl-preview
header.I ended up with something like this: