Begin by creating the BAQ that has the data you need in the chart. Next create a user dedicated to this API account. I called mine ‘datapuller’. Set this user as ‘Integration Account’. Next create an Access Scope, include the BAQ with your data in the Access Scope. Next setup an API key and include your Access Scope in the API Key setup.
Then head over to your swagger/REST API help webpage and login with your Epicor creds. Find your BAQ and test it there. You can put in the API key and run a GET test. If it works, then you are well on your way to pulling the data into Excel using a blank Power Query.
In Excel, go to Data > Get Data > Other Data Sources > Blank Query. Use the Advanced Editor to paste in your MCode. Something like this:
let
Base64Auth = "Basic " & Binary.ToText(Text.ToBinary("datapuller:mydatapullerpassword"), BinaryEncoding.Base64),
ApiKey = "MYWHOLEACTUALAPIKEY",
Headers = [
#"Authorization" = Base64Auth,
#"X-API-Key" = ApiKey,
#"Content-Type" = "text/plain"
],
paramQuery = "MYBAQNAME",
Source = OData.Feed("https://MYSERVER/api/v2/odata/COMPANY/BaqSvc/" & paramQuery & "/Data?", Headers, [Implementation = "2.0"])
in
Source
Good luck!