Embedded Documentation

Community

From Bacula Enterprise 18.2, the REST API contains an endpoint to get the Swagger documentation.

Swagger is a widely used tool for documenting and designing APIs in a clear and structured way. Its main goal is to provide a standard method for describing the functionality of RESTful API, making it easier for developers and other technical users to understand and use.

This endpoint is in:

<http/https>://<ip or hostname>:<port>/docs/

This documentation is interactive, so, you can do HTTP requests directly from this interface. Also, you can use this documentation to learn to use the API.

If you want to use the documentation in interactive mode: - You have to change the server variables. - If you need to use an authorized user, you must create an specific Swagger user in REST API Panel:

  • User Name: Swagger User

  • User ID: Generate new one.

  • User Secret: Generate new one.

  • Redirect URI: <HTTP>://<server>:<port>/docs/oauth2-redirect.html

  • Scope: <Scope>

  • BConfig URI: <BConfig URI>

  • BConfig User: <BConfig User>

  • BConfig Password: <BConfig Password>

    For example, if you have a REST API server in bee-rest:443 and BWeb in bweb:9180, the configuration would be:

  • User Name: Swagger User

  • User ID: 7Ag-QKSDL61yJgAOFTK74muth5fsFE4P

  • User Secret: 283acdsf90deF1855c6C5dcd51dEeC3439ecC114

  • Redirect URI: https://bee-rest/docs/oauth2-redirect.html

  • Scope: /*

  • BConfig URI: http://bweb:9180/

  • BConfig User: admin

  • BConfig Password: admin

  • If you need to authorize to this user, you need to click in Authorize button and put the user credentials and their scopes.

If REST API OAuth is disabled, you only can use the GET requests without authentification.

If REST API OAuth is enabled, you must be authorized.

Go back to: REST API.