REST APIs for Slack notifications for Bitbucket app
The REST APIs are primary for the internal use and can be changed without notice.
Slack notifications for Bitbucket REST APIs
Slack notifications for Bitbucket provides the following endpoints:
Get all configurations
CODEGET <BITBUCKET_BASE_URL>/rest/mwf-slack/1.0/configurations
Permission: Global admin permissions are required.
Get configurations for a project
CODEGET <BITBUCKET_BASE_URL>/rest/mwf-slack/1.0/configurations?projectKey=PROJECT_KEY
Permission: Global or project admin permissions are required.
Get configurations for the repository
CODEGET <BITBUCKET_BASE_URL>/rest/mwf-slack/1.0/configurations?projectKey=PROJECT_KEY&repositorySlug=REPOSITORY_SLUG
Permission: Global, project or repository admin permissions are required.
Get configuration by ID
CODEGET <BITBUCKET_BASE_URL>/rest/mwf-slack/1.0/configurations/ID
Permission: Global, project or repository admin permissions are required.
Create new configuration
CODEPOST <BITBUCKET_BASE_URL>/rest/mwf-slack/1.0/configurations
Permission: Admin on the level (global, project, repository) the configuration is created.
Update configuration by ID
CODEPUT GET <BITBUCKET_BASE_URL>/rest/mwf-slack/1.0/configurations/ID
Permission: Admin on the level (global, project, repository) the configuration is created.
Delete configuration by ID
CODEDELETE <BITBUCKET_BASE_URL>/rest/mwf-slack/1.0/configurations/ID
Permission: Admin on the level (global, project, repository) the configuration is created.
Configuration scheme
{
"id": integer,
"enabled":boolean,
"lastModified":long, //readonly timestamp
"destinations":[
{
"url": string, // URL
"slackUserName":string,
"channelName":string,
"channelSource": enum, // "FROM" or "TO"
"slackApi":enum, //"WEBHOOK", "OAUTH"
"token":string,
"tenantId": string,
"channelId": string
}
],
"users":[
string // usernames
],
"ignoredUsers":[
string // usernames
],
"groups":[
string // user groups
],
"ignoredGroups":[
string // user groups
],
"projectKey": string, // project key
"repositorySlug": string, // optional repository slug
"eventTypes":[
enum // "PULL_REQUEST_ACTIVITY", "REPOSITORY_PUSH", "BUILD_STATUS_SET"
],
"pullRequestBranchSource": enum, // "FROM" or "TO"
"overrideEnabled": boolean,
"notificationLevel": enum, // "VERBOSE", "COMPACT", "MINIMAL"
"notificationPrLevel": enum, // "VERBOSE", "COMPACT", "MINIMAL"
"slackIconUrl": string,
"slackIconEmoji": string,
"pullRequestActions":[
enum // "OPENED", "REOPENED","UPDATED","APPROVED","UNAPPROVED","DECLINED","MERGED","COMMENTED","REVIEWED"
],
"pullRequestReviewersAdded":boolean,
"pullRequestReviewersRemoved":boolean,
"enabledForPersonal":boolean,
"alwaysAddPrReviewers":boolean,
"level": enum, //readonly "REPOSITORY", "REPOSITORY", "GLOBAL"
}
Updated: