Common APIs to use
Discover frequently used Bonita APIs to efficiently build complex applications in the UI Builder.
Bonita APIs combined with JS objects allow for building all kind of applications, such as: account management dashboard, custom CRM, HR Management tool, invoice processing dashboard, and many more.
Commonly used APIs
While how JS objects are designed highly depends on your need, here are the most frequently used Bonita APIs you will very likely need for your applications.
Session
The session API is useful for retrieving session information for the current user.
For example:
-
GET |
/API/system/session/unusedId
For more detailed information, refer to the session API documentation.
Users
The users API is useful for retrieving a list of users by applying pagination parameters and filters.
For example:
-
GET |
/API/identity/user?c=10&p=0&time=0&o=lastname+ASC&f=enabled=true
For more detailed information, refer to the users API documentation.
Human tasks
The human tasks API is useful to retrieve a list of human tasks by applying pagination parameters and filters.
For example:
-
GET |
/API/bpm/humanTask?c=10&p=0&f=state=ready&f=caseId=[caseId]
For more detailed information, refer to the human tasks api documentation.
User task execution
The user task execution API executes a task identified by its id. The task contract values have to be provided.
For example:
-
POST |
/bonita/API/bpm/userTask/[taskId]/execution
For more detailed information, refer to the task execution api documentation.
User task context
The user task context API provides the context for a specific user task identified by its id.
For example:
-
GET |
/bonita/API/bpm/userTask/[taskId]/context
For more detailed information, refer to the context by userTask id api documentation.
Processes
The process API is used to retrieve a list of process by applying pagination parameters and filters.
For example:
-
GET |
/bonita/API/bpm/process?c=10&p=0&f=name=[processName]&f=activationState=ENABLED
retrieves a list of specific process. -
POST |
/bonita/API/bpm/process/[processId]/instantiation
is used to instantiate a process.
For more detailed information, refer to the processes API documentation.
Business data
The business data is useful to find business data with pagination params and filters by invoking a Named Query
. It allows to call either default or custom business data queries.
For example:
-
GET |
/API/bdm/businessData/[businessObject]?q=[query]&p=0&c=10&f=[filterString]=[filterParam]
-
GET |
/API/bdm/businessData/com.company.model.Claim?c=1000&p=0&q=find
q=[query]
is a mandatory parameter. Queries are used to get information about data objects stored in the database. A set of default queries, find
and find_by
, is defined automatically for each object in the BDM. You can also create custom queries.
For more detailed information, refer to the business data api documentation.
Professional contact data
The professional contact data is useful to retrieve the professional contact details of a user by their id.
For example:
-
GET |
/API/identity/professionalcontactdata/[userId]
For more detailed information, refer to the professional contact data api documentation.
Group
The group api is used to retrieve a list of groups by applying pagination params and filters.
For example:
-
GET |
/API/identity/group?c=10&p=0&d=parent_group_id&t=0&o=displayName%20ASC
For more detailed information, refer to the groups api documentation.
Upload file
The upload file api is used to upload a file of any type, typically before submitting a process or task form that includes a document in its contract.
For example:
-
POST |
/bonita/API/formFileUpload
For information on uploading multiple files, refer to the upload multiple files.
In addition to the commonly used APIs, JS objects can also be created to meet specific application needs. |
Troubleshooting
The APIs declare from the Bonita Datasource are not working properly.
Cause These errors are likely related to the permissions of the user that is trying to access the APIs.
Solution Ensure that the user has the correct permissions to access the APIs. See more details in this how-to guide: How to grant permissions to perform request to Bonita REST API.