Hello Everyone , I am encountering a 500 Internal Server Error
while trying to add a comment to a pull request using the Bitbucket API. I have been using the following endpoint and request format:
Endpoint: POST https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pullRequestId}/comments
Request Body:
{ "content": { "raw": "Test comment from bot" } }
Details:
{workspace}
{repo_slug}
{pullRequestId}
f9f2948716a144c3927b477d12992011
Issue: I receive the following error response:
{ "type": "error",
"error": { "message": "Something went wrong",
"id": "f9f2948716a144c3927b477d12992011"
} }
I have verified that:
Could you please help me understand what might be causing this error and how I can resolve it?
THANK YOU.
Hello @BrahimDev ,
and welcome to the Community!
Since the repository you're testing with seems to be a public repository, I suspect this error has to do with the authentication not being provided.
Could you confirm if you are authenticating the request? If not, could you try authenticating using basic auth (username and app password) or a repo access token and let us know if the error persists?
Even though the repository is public, the API call to add a comment needs to come from an authenticated user/token bot.
Thank you, @BrahimDev !
Patrik S
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Patrik S I'm having a similar issue, but with update pull request where I am just trying to change the title. I am using basic auth, and it works for get pull request. When creating the app password, I checked the options for pull request.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Anthony Nguyen ,
I would like to ask if you could please create a new question for your issue, providing details on the errors you see.
We generally encourage users to create a new question for their issue instead of posting on someone else’s question, because:
1) the root cause and resolution may be different for each case
2) a question can become cluttered and difficult to follow if we try to troubleshoot multiple users’ issues in it.
Please feel free to let me know if you have any questions.
Thank you, @Anthony Nguyen !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have but no one has responded so I am trying to find similar problems or someone who can provide some answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.