Skip to content

API Reference

Jan S edited this page Jun 10, 2021 · 23 revisions

The MBP REST API is documented using the OpenAPI specification. The OpenAPI document is created automatically and can be accessed when the MBP is started. A Swagger UI is also automatically created and available when the MBP is running.

Overview

  • OpenAPI document: http://[MBP-Host]:8080/MBP/v2/api-docs
  • Swagger UI: http://[[MBP-Host]:8080/MBP/swagger-ui.html

As the admin user, it is also possible to access them through Main Navigation > Settings > REST API Documentation.

MBP REST api documentation

Authentication

Most endpoints of the API are restricted to authenticated users and cannot be used anonymously. Formerly, authentication was possible by extending the HTTP headers of all requests with fields related to basic HTTP authentication, i.e. username and password of a user as base64-encoded string. Since Pull Request #588 however, authentication is only possible via cookies carrying valid session IDs. In order to authenticate yourself as a registered user onthe MBP via the REST API, please follow the subsequently listed steps:

  1. Execute the login request by providing the username and the password of the registered user that is supposed to be authenticated:
  --data-raw '{"username":"admin","password":"12345"}'