REST API for Categories for Bitbucket (v 1.4)

Information

On this page you will find the REST API documentation for Categories for Bitbucket. 


Further links regarding the REST API browser:

Not all requests may be available on all versions of Categories for Bitbucket.

The paths have been changed on version 1.3.0.

Version - 1.2.1 /rest/projectCategories/latest/...
Version 1.3.0+  /rest/categories/latest/...

Type: GET
Path: /rest/categories/latest/categories

Parameter:  

  • type QueryParam - Categories for "project" or "repository". (only since 1.3.0, default: project)
  • query QueryParam - Search in category names for this string

Description: Search for categories. SINCE VERSION 1.3.0

GET /rest/categories/latest/categories
{
 "data":[],
 "query": String input query,
 "suggestions":[
	{
		"id": int Id of the category,
		"title":String Title of the category
	},
	...	
 ]
}


Type: GET
Path: /rest/categories/latest/project

Description: List all projects and their categories.

GET /rest/categories/latest/project
{
 "message": String Error or hint message,
 "result":[
	{
		"projectId": int Id of the project,
		"projectKey": String Key of the project,
		"projectName": String Name of the project,
		"categories":[
			{	
				"id":int Id of the category,
				"title": String Title of the category
			},
			...
		]
	},
	...
 ]
}

Categories

Type: GET
Path: /rest/categories/latest/project/{projectKey}

Description: List all categories of a project.

GET /rest/categories/latest/project/{projectKey}
{
 "message": String Error or hint message,
 "result":
	{
		"projectId": int Id of the project,
		"projectKey": String Key of the project,
		"projectName": String Name of the project,
		"categories":[
			{	
				"id":int Id of the category,
				"title": String Title of the category
			},
			...
		]
	}
}


Type: POST
Path: /rest/categories/latest/project/{projectKey}

Parameter:

  • categories QueryParam - The category or categories you want to set for this project.

Return: List all categories of the project.

Description: Set the categories of a project.

POST /rest/categories/latest/project/{projectKey}
curl -u username:password -X POST -H "Content-Type: application/json" http://localhost:7990/rest/categories/latest/project/{projectKey}?categories={categorie1}&categories={categorie2} ...
Return
{
 "message": String Error or hint message,
 "result":
	{
		"projectId": int Id of the project,
		"projectKey": String Key of the project,
		"projectName": String Name of the project,
		"categories":[
			{	
				"id":int Id of the category,
				"title": String Title of the category
			},
			...
		]
	}
}


Repositories

All repositories

Type: GET
Path: /rest/categories/latest/repositories

Parameter:

  • projectkey -  key of the project
  • start - starting point for paging through the results. Defaults to 0.
  • limit (required) - maximum number of results to return. Has to be a value greater than 0.

Description: List all repositories of the project with the given key and their categories.

BROKEN Categories are not returned

DEPRECATED This endpoint is known to have performance issues on bigger systems. 

GET /rest/categories/latest/repositories?projectkey={projectKey}&limit=10
{
 "message": String Error or hint message,
 "result":[
	{
		"repositoryId": int Id of the repository,
		"repositoryName": String Name of the repository,
		"repositorySlug": String Slug of the repository,
		"categories":[
			{
				"id": int Id of the repository category,
				"title": String Title of the repository category
			},
			...
		]
	},
	...
 ]
}

Repository Categories

Type: GET
Path: /rest/categories/latest/project/{projectKey}/repository{repositorySlug}

Description: List all categories of a repository.

GET /rest/categories/latest/project/{projectKey}/repository/{repositorySlug}
{
 "message": String Error or hint message,
 "result":
	{
		"repositoryId": int Id of the repository,
		"repositoryName": String Name of the repository,
		"repositorySlug": String Slug of the repository,
		"categories":[
			{
				"id": int Id of the repository category,
				"title": String Title of the repository category
			},
			...
		]
	}
}


Type: POST
Path: /rest/categories/latest/project/{projectKey}/repository{repositorySlug}
Parameter:

  • categories QueryParam - The category or categories you want to set for this repository.

Return: List all categories of the repository.

Description: Set the categories of a repository.

POST /rest/categories/latest/project/{projectKey}/repository/{repositorySlug}
curl -u username:password -X POST -H "Content-Type: application/json" http://localhost:7990/rest/categories/latest/project/{projectKey}/repository/{repositorySlug}?categories={categorie1}&categories={categorie2} ...
Return
{
 "message": String Error or hint message,
 "result":
	{
		"repositoryId": int Id of the repository,
		"repositoryName": String Name of the repository,
		"repositorySlug": String Slug of the repository,
		"categories":[
			{
				"id": int Id of the repository category,
				"title": String Title of the repository category
			},
			...
		]
	}
}




Back to Top