Set up and access APIs in Wiise
How to set up an API
To learn how to set up an API for Wiise, refer to Microsoft's developer documentation:
Welcome to the API(v2.0) for Business Central.
This documentation explains how to build custom APIs using the AL API pages and publish them as part of an extension.
How to access API endpoints
APIs in Wiise are enabled by default through the Business Central API framework. Use the following base endpoints:
- Production: https://api.businesscentral.dynamics.com/v2.0/[tenant-id]/production/api/v2.0/
- Sandbox: [https://api.businesscentral.dynamics.com/v2.0/[tenant-id]/sandbox/api/v2.0]
Note: Replace [tenant-id] with your Microsoft Entra tenant ID
For more information, see How to enable and access API endpoints on Microsoft Docs.
How to retrieve data using the Business Central API
Business Central APIs expose entities such as:
• companies
• customers
• vendors
• items
• salesOrders
• purchaseOrders
You can query these entities using OData query parameters.
Example: Retrieve the Item ID using the Item Number.
https://api.businesscentral.dynamics.com/v2.0/[tenant-id]/[production/sandbox]/api/v2.0/companies([company-id])/items?$select=id&$filter=number eq '1906-S'
How to test an API
1. You can access the APIs using any library of your choosing. We use Postman for this purpose.
2. Open Postman and create a new GET request by typing this URL on your internet browser: [https://api.businesscentral.dynamics.com/v2.0/[tenant_id]/[production/sandbox]/api/v2.0/companies]
3. Configure OAuth and create an access token
- Under the Authorization tab, set Type to OAuth 2.0.
- Under Add authorization data to, choose Request Headers.
- Enter a Token Name.
- Under Grant Type, choose Client Credentials.
- Under Access Token URL, enter: [https://login.microsoftonline.com/[tenant_id]/oauth2/v2.0/token]
- Your Client ID is the Application (client) ID you copied from the Azure Active Directory app.
- Your Client Secret is the client secret Value you copied from the Azure Active Directory app.
- Under Scope, enter: [https://api.businesscentral.dynamics.com/.default in the field].
- Under Client Authentication, choose Send Client Credentials in body.
- Select Get New Access Token.
- Select Use Token.
- Send the request to call the API and retrieve data.
Troubleshooting API access
If you cannot connect to the API:
-
Confirm the Microsoft Entra app registration is configured correctly
-
Ensure the correct API permissions are granted
-
Verify the tenant ID and environment name are correct
-
Test the request using Postman
Postman responses will show error messages that help identify authentication or configuration issues.
Microsoft APIs in Wiise
Microsoft's Business Central API v2.0 endpoints are included by default in Wiise environments.
You do not need to install any extensions to access the standard APIs.
Additional developer resources
These resources provide guidance on creating custom APIs, extensions and integrations.
- To find more information on API development, head to Frequently Asked Questions for Dynamics 365 Business Central Developer and ITPro Experiences.
- For more API information from Microsoft, go to Welcome to the API(v2.0) for Dynamics 365 Business Central.
- Click here for more information on Development in AL from Microsoft.
- Find out more about Using Service to Service Authentication - Business Central | Microsoft Docs from Microsoft Docs.
- Find out more about Using OAuth to Authorize Business Central Web Services (OData and SOAP) from Microsoft Docs.