- Business Central integration
12.1. Knowledge Store REST API for Business Central spaces and projects
jBPM provides a Knowledge Store REST API that you can use to interact with your projects and spaces in jBPM without using the Business Central user interface. The Knowledge Store is the artifact repository for assets in jBPM. This API support enables you to facilitate and automate maintenance of Business Central projects and spaces.
With the Knowledge Store REST API, you can perform the following actions:
Retrieve information about all projects and spaces
Create, update, or delete projects and spaces
Build, deploy, and test projects
Retrieve information about previous Knowledge Store REST API requests, or jobs
Knowledge Store REST API requests require the following components:
Authentication
The Knowledge Store REST API requires HTTP Basic authentication or token-based authentication for the user role rest-all. To view configured user roles for your jBPM distribution, navigate to ~/$SERVER_HOME/standalone/configuration/application-roles.properties and ~/application-users.properties.
To add a user with the rest-all role, navigate to ~/$SERVER_HOME/bin and run the following command:
$ ./add-user.sh -a --user <USERNAME> --password <PASSWORD> --role rest-all
For more information about user roles and jBPM installation options, see Installing the KIE Server.
HTTP headers
The Knowledge Store REST API requires the following HTTP headers for API requests:
Accept: Data format accepted by your requesting client:
application/json (JSON)
Content-Type: Data format of your POST or PUT API request data:
application/json (JSON)
HTTP methods
The Knowledge Store REST API supports the following HTTP methods for API requests:
GET: Retrieves specified information from a specified resource endpoint
POST: Creates or updates a resource
DELETE: Deletes a resource
Base URL
The base URL for Knowledge Store REST API requests is http://SERVER:PORT/business-central/rest/, such as http://localhost:8080/business-central/rest/.
The REST API base URL for the Knowledge Store and for the jBPM controller built in to Business Central are the same because both are considered part of Business Central REST services.
Endpoints
Knowledge Store REST API endpoints, such as /spaces/{spaceName} for a specified space, are the URIs that you append to the Knowledge Store REST API base URL to access the corresponding resource or type of resource in jBPM.
Example request URL for /spaces/{spaceName} endpoint
http://localhost:8080/business-central/rest/spaces/MySpace
Request data
HTTP POST requests in the Knowledge Store REST API may require a JSON request body with data to accompany the request.
Example POST request URL and JSON request body data
http://localhost:8080/business-central/rest/spaces/MySpace/projects
{
"name": "Employee_Rostering",
"groupId": "employeerostering",
"version": "1.0.0-SNAPSHOT",
"description": "Employee rostering problem optimisation using Planner. Assigns employees to shifts based on their skill."
}