Bitbucket

FREE
By stefan.skliarov
Updated 5 months ago
Storage
-/10
Popularity Score
-
Latency
-
Success Rate

Bitbucket API Documentation

Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps

View API Details
POSTaddBranchRestrictions
POSTaddCommitBuild
POSTaddDefaultReviewer
POSTaddDownload
POSTaddIssueAttachement
POSTaddIssueVote
POSTaddIssues
POSTaddRepository
POSTaddTag
POSTaddTeamWebhook
POSTaddUserWebhook
POSTaddWebhook
POSTapproveCommit
POSTapprovePullrequest
POSTcheckIssueVote
POSTcheckIssueWatching
POSTcreatePullrequest
POSTdeclinePullrequest
POSTdeleteBranchRestriction
POSTdeleteDefaultReviewer
POSTdeleteDownload
POSTdeleteIssueAttachement
POSTdeleteIssueVote
POSTdeletePipelineSChedule
POSTdeleteProject
POSTdeleteRepository
POSTdeleteRepositoryKnownHost
POSTdeleteRepositorySSHCredentials
POSTdeleteRepositoryVariable
POSTdeleteSingleIssue
POSTdeleteTeamVariable
POSTdeleteTeamWebhook
POSTdeleteUserVariable
POSTdeleteUserWebhook
POSTdeleteWebhook
POSTgetAccessToken
POSTgetCurrentUserInfo
POSTgetCurrentUserSingleEmail
POSTgetIssueSingleAttachement
POSTgetIssueSingleComment
POSTgetPipelineSingleSchedule
POSTgetPipelineSingleStep
POSTgetPipelineStepLog
POSTgetPullrequestActivity
POSTgetPullrequestDiff
POSTgetPullrequestSingleComment
POSTgetRepositoryKnownHost
POSTgetRepositorySSHCredentials
POSTgetRepositoryVariable
POSTgetSingleBranch
POSTgetSingleBranchRestriction
POSTgetSingleCommit
POSTgetSingleCommitBuild
POSTgetSingleCommitComment
POSTgetSingleComponent
POSTgetSingleDefaultReviewer
POSTgetSingleDiff
POSTgetSingleDownload
POSTgetSingleIssue
POSTgetSingleMilestone
POSTgetSinglePatch
POSTgetSinglePipeline
POSTgetSingleProject
POSTgetSinglePullrequest
POSTgetSingleRepository
POSTgetSingleTag
POSTgetSingleVersion
POSTgetSingleWebhook
POSTgetSrc
POSTgetTeamFollowers
POSTgetTeamFollowing
POSTgetTeamInfo
POSTgetTeamSingleVariable
POSTgetTeamSingleWebhook
POSTgetUserFollowers
POSTgetUserFollowing
POSTgetUserInfo
POSTgetUserSingleVariable
POSTgetUserSingleWebhook
POSTlistBranchRestrictions
POSTlistBranches
POSTlistCommitComments
POSTlistCommitStatuses
POSTlistCommits
POSTlistComponents
POSTlistCurrentUserEmails
POSTlistDefaultReviewers
POSTlistDownloads
POSTlistForks
POSTlistHookEvents
POSTlistHookEventsByType
POSTlistIssueAttachements
POSTlistIssueComments
POSTlistIssues
POSTlistMilestones
POSTlistPipelineConfig
POSTlistPipelineScheduleExecutions
POSTlistPullrequestComments
POSTlistPullrequestCommits
POSTlistPullrequestPatches
POSTlistPullrequestStatuses
POSTlistPullrequests
POSTlistPullrequestsActivity
POSTlistRefs
POSTlistRepositories
POSTlistRepositoriesByUsername
POSTlistSnippets
POSTlistTags
POSTlistTeamMembers
POSTlistTeamRepositories
POSTlistTeamWebhooks
POSTlistTeams
POSTlistUserRepositories
POSTlistUserWebhooks
POSTlistVersions
POSTlistWatchers
POSTlistWebhooks
POSTmergePullrequest
POSTstopPipeline
POSTunapproveCommit
POSTunapprovePullrequest
POSTunwatchIssue
POSTupdateBranchRestriction
POSTupdateBuildNumber
POSTupdateCommitBuild
POSTupdatePipelineConfig
POSTupdatePipelineSchedule
POSTupdateProject
POSTupdatePullrequest
POSTupdateRepository
POSTupdateRepositoryKnownHost
POSTupdateRepositorySSHCredentials
POSTupdateRepositoryVariable
POSTupdateTeamVariable
POSTupdateTeamWebhook
POSTupdateUserVariable
POSTupdateUserWebhook
POSTupdateWebhook
POSTuploadCommit
POSTwatchIssue
POSTwebhookEvent
POSTaddBranchRestrictions

Creates a new branch restriction rule for a repository.

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
reposlugSTRING
REQUIREDRepository slug
accessTokenSTRING
REQUIREDoAuth 2 access token
patternSTRING
REQUIREDPattern for restriction
kindSELECT
REQUIREDkind describes what will be restricted. Allowed values are: push, force, delete, and restrict_merges.
usernameSTRING
REQUIREDUsername of the user
Optional Parameters
usersLIST
OPTIONALUser objects
groupsLIST
OPTIONALGroup objects
valueNUMBER
OPTIONALValue with kind-specific semantics: "require_approvals_to_merge" uses it to require a minimum number of approvals on a PR; "require_passing_builds_to_merge" uses it to require a minimum number of passing builds.
Code Snippet
unirest.post("https://Bitbucketstefan-skliarovV1.p.rapidapi.com/addBranchRestrictions")
.header("X-RapidAPI-Host", "Bitbucketstefan-skliarovV1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://Bitbucketstefan-skliarovV1.p.rapidapi.com/addBranchRestrictions
Request Method: POST
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://Bitbucketstefan-skliarovV1.p.rapidapi.com/addBranchRestrictions")
.header("X-RapidAPI-Host", "Bitbucketstefan-skliarovV1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication