Rest-API Version 1.0.0

Endpoint /jhfb/1.0.0/check/commit

Post request

The rest endpoint offers a post method. As input the method needs the following JSON as request body

{	
	"message": "The commit message",
	"project-slug": "the project slug",
	"repository-slug": "the repository slug"	
} 


KEY

Description

project-slug

The project key of your Bitbucket project. It is needed to access the hook configuration.

e.g. PROJECT_1

You can access this key in the URL of your repository:

https://bitbucket-server/projects/PROJECT_1/repos/rep_1/

repository-slug



The repository key of your Bitbucket repository. It is needed to access the hook configuration.

e.g. rep_1

You can access this key in the URL of your repository:

https://bitbucket-server/projects/PROJECT_1/repos/rep_1/

message

The commit message you would like to check

Request answer

As answer you will get the following JSON

{
	"error": true,
	"answers": [
		{
			"title": "Error title",
			"message": "Detailed error message"
		}
	]
}


KEY

Description

error

If false, the evaluation of the commit messages failed. Otherwise true.

answers

A array of answers:

  • title: Error title

  • message: Detailed error message


Return codes

CODE

Description

200

Evaluation of the commit message successful

400

Evaluation of the commit message not successful


POST example (valid commit message)

RestAPIDocOkay.png


POST example (invalid commit message)

RestAPIDocError.png