I am using bitbucket's PR difference endpoint to get the differences for a PRID , it works on postman but the same call returns 404 via code.
I have checked the URL, Headers also has access token
This api runs via Postman though. Also on checking the http response message, request message absolute is a different uri : https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/diffstat/{workspace}/{repo_slug}:30cff0b24f9a%0D6f7a3ddc9d21?from_pullrequest_id=1&topic=true
Hello @Marilyn Pulinthitta and welcome to the Community!
As per the Bitbucket API documentation, the endpoint Get diffstat for a Pull Request will return an HTTP Status Code 302 redirecting to Repository Diff stat with the commits that correspond to the Pull Request.
By default Postman follow redirects, so when you originally make a request to the pull request endpoint, bitbucket will respond with a redirect URL, and Postman will automatically make a new request to this redirect URL.
What might be happening is that your C# application is not configured to follow redirects. In this case, you might need to find any setting available on the tool you are using to enable follow redirects (HTTP 3xx responses), or you will need to make a second call to the API endpoint returned in the response message you shared in the description.
Hope that helps! Let me know in case you have any questions.
Thank you, @Marilyn Pulinthitta !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.