I am using Business Central SaaS. In Visual Studio Code, I can run "Download Symbols" to download the Application and System app shipped by Microsoft. I now want to do this outside of Visual Studio Code within a github workflow. In VS Code, I can see that the URL looks like this
GET https://api.businesscentral.dynamics.com/v2.0/Dev/dev/packages?publisher=Microsoft&appName=Application&versionText=18.0.0.0
I use a HTTP-Client to test the URL, but I always get an HTTP 401 Unauthorized as response. I tried the folowing credentials:
bcuser | bcpassword
bcuser | Web Service Access Key
The user I am testing this is a SUPER user on the sandbox. It is the same user I use when I download symbols within VS Code. I tested it with and without domain name.
Any ideas what I am doing wrong?
JenKoc's answer put me on the right track. I had to add the Tenant-ID to the URL. Downloading Symbols does work with Basic Auth. This is how it works:
Get Credentials from Business Central's User page. If the Web Service Access Key is empty, just click on the three dots and craete a new one.
Create a HTTP GET Request with Basic Auth
User: <User Name>
Password: <Web Service Access Key>
URL:
https://api.businesscentral.dynamics.com/v2.0/<tenant-id>/<sandboxname>/dev/packages?publisher=Microsoft&appName=Application&versionText=18.0.0.0