Details
-
Bug
-
Resolution: Handled by Support
-
Medium
Description
I am getting a 403 Forbidden error when calling Diff and DiffStat APIs from C# client. I am able to do the following calls successfully in C#.
POST: GET TOKEN: https://bitbucket.org/site/oauth2/access_token
GET: GET BRANCHES: [https://api.bitbucket.org/2.0/repositories/
POST: CREATE PULL REQUEST: [https://api.bitbucket.org/2.0/repositories/{accountId}
/
{repository}/pullrequests|https://api.bitbucket.org/2.0/repositories/%257B%257BaccountId%257D%257D/%257Brepository%257D/pullrequests]The following requests are failing from C# although they succeed from POSTMAN and Node.JS:
GET: GET PULL REQUEST DIFF: [https://api.bitbucket.org/2.0/repositories/{accountId}/{repository}
/pullrequests/
{pullRequestId}/diff/|https://api.bitbucket.org/2.0/repositories/%257B%257BaccountId%257D%257D/%257Brepository%257D/pullrequests/%257BpullRequestId%257D/diff/]GET: GET PULL REQUEST DIFFSTAT: [https://api.bitbucket.org/2.0/repositories/{accountId}/{repository}/pullrequests/{pullRequestId}
/diffstat|https://api.bitbucket.org/2.0/repositories/%257B%257BaccountId%257D%257D/%257Brepository%257D/pullrequests/%257BpullRequestId%257D/diffstat]
I am using the following as the Authorization Header:
Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);