Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
Azure Active Directory is now Microsoft Entra ID. Learn more
Standard APIs for Business Central are available as an OpenAPI Specification (OAS). OAS defines a standard interface to RESTful APIs, providing a uniform access to APIs and documentation.
API Version | YAML |
---|---|
1.0 | Download |
The OAS is set up to use OAuth2 and accessing the default sandbox environment. Details can be changed in the contact to connect to specific environments (servers URL). YAML can be converted to JSON if needed.
There are extensions for Visual Studio Code that enable previewing and editing. SwaggerHub enables previewing and editing online.
To run SwaggerUI locally, node.js can be used to serve the SwaggerUI, by following the steps below:
Download OAS for Business Central as shown above.
Install Node.js.
Copy the javascript code shown below and save it to a file with the filename BC_OAS.js
.
const express = require('express');
const app = express();
const port = 3000;
const swaggerUi = require('swagger-ui-express');
const YAML = require('yamljs');
const swaggerDocument = YAML.load('./BCOAS1.0.yaml');
//const swaggerDocument = require('./BCOAS1.0.json');
var options = { };
app.use('/', swaggerUi.serve, swaggerUi.setup(swaggerDocument, options));
app.listen(port, () => console.log(`Swagger UI for Business Central listening on port ${port}!`))
Install the required node packages by running npm from the command line:
npm install express swagger-ui-express yamljs
Run the node app created. From the command line run the following:
node BC_OAS.js
Browse to https://localhost:3000
.
To use Try it out authorization in SwaggerUI, a Microsoft Entra app must be created. Follow these steps to create a Microsoft Entra app, with access to Business Central. Copy and paste the client ID from the Microsoft Entra app into the authorization dialog of SwaggerUI.
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in