BAQ Odata help

Hi Guys,
I finally got to 10.2.
I am trying to get a basic baq into excel like we did at insights last year!

I can view the baq in swagger and it works.
When I run it in postman it’s fine.

When i try and ran it through excel odata Data → New Query → From OData Feed I get 500 - Internal server error
“There is a problem with the resource you are looking for, and it cannot be displayed”

I have fiddler running for both postman and excel.
Postman header is
GET https://myurl/Epicor/api/v1/BaqSvc/MyQuery(MYCOMP)/ HTTP/1.1
cache-control: no-cache
Postman-Token: 5f753083-68f7-4a58-b1ce-f912f420fd2f
Authorization: Basic bG
User-Agent: PostmanRuntime/7.1.1
Accept: /
Host: epic101.mag.milne.com.au
accept-encoding: gzip, deflate
Connection: close

Excel header is
GET https://myurl/Epicor/api/v1/BaqSvc/MyQuery(MYCOMP)/ HTTP/1.1
User-Agent: Microsoft.Data.Mashup (Power Query documentation - Power Query | Microsoft Learn)
OData-MaxVersion: 4.0
Accept: application/json;odata.metadata=minimal
Accept-Encoding: gzip, deflate
Authorization: Basic bGFpdHRwOmJsYWg=
Host: myurl

So I then tried to use the ?Company=‘COMP’ syntax and it fails on the metadata call.

Any ideas?
Is Excel/the api broken.
I can use a macro to work around this.

Is anything in the Servers Windows Event Log?

Download / Run Fidller and see what that request / response looks like.

Version of Excel?

I do this ALL the time. No more copy/paste from dashboards…

Mark W.

excel is 2016.
This query is only in one company but when i make a request in excel it’s in the other company so I need to pass the company parameter. I think this is the issue.

Jose: fiddler header is in first post. response is 500 “There is a problem with the resource you are looking for, and it cannot be displayed”

Bart: Windows epicor server event log has nothing.
I have rest trace on and get the following over and over ( I guess it’s retrying)

Not sure if it matters, i use this syntax for company selection:

$URI/api/v1/BaqSvc/$BAQ?Company=‘compID’&…

Mark W.

Thanks Mark,
Yeah using that syntax gets me a little bit further but it’s now failing on the metadata call
For some reason it’s trying
https://Server/Epicor/api/v1/BaqSvc/$metadata
I thought it should try
https://Server/Epicor/api/v1/BaqSvc/BAQName$metadata

How do i post xml in here?
Trying to post the log file for Bart.

unfortunately, our BAQ data is not completely compliant to OData standard.
That is why new Excel products cannot get BAQ result (IIRC when Company is specified in parenthesis). Try to call BAQ without company name. will it help?

1 Like

image

Thanks Mark.
This forum needs a code tag.

Thanks Olga - yes it seems to be broken on the newest version of excel with the company selector.
if i remove the company selector it works fine.

I can work around it by using a macro but it would be great to fix this!
Cheers
Patrick

1 Like

It has one
See FAQ Code Syntax Highlighting in Posts - FAQ - Epicor User Help Forum

Well if this works for someone, this is what I have for OData with Excel. I don’t use Postman