web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

OData with EXPAND query option works from browser but not from code

(0) ShareShare
ReportReport
Posted on by 25

Hi all,

I'm trying to run the following OData query:

What's happening is when I run this URL from a browser, I get the ReleasedProducts in line with retrieved resources. When I run this from my Python test code, I get ProductsV2 records with no problem but no in line records from ReleasedProducts.
These are the headers I'm send along with my GET request:
'Authorization': 'Bearer xxxXXX...'
'Accept': 'application/json'
'Content-Type': 'application/json; charset=utf-8'
'OData-MaxVersion': '4.0'
'OData-Version': '4.0'
My cloud-hosted dev environment is running Update35 (7.0.5644.35548) version.
 
Any advice will be much appreciated.
I have the same question (0)
  • Deekshit Addepalli Profile Picture
    on at

    Can you show a screenshot of what you see via the browser vs what your python code returns? Is it for the same ProductNumber?

  • Anderson Joyle Profile Picture
    25 on at

    There you go.

    Screenshot-from-2020_2D00_08_2D00_24-13_2D00_35_2D00_56.pngScreenshot-from-2020_2D00_08_2D00_24-13_2D00_38_2D00_24.png

    Lighter pic is what I get requesting OData from Firefox. Darker pic is the result from the terminal. eTag value is the same for both results.

    Just a bit more details on this, I also analyzed headers that firefox is using to compose GET request:

    Screenshot-from-2020_2D00_08_2D00_24-13_2D00_51_2D00_46.png

    I tried to use the same headers from my python code (except cookie). The results were the same.

    Thanks for your time.

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Anderson,

    Could you try to narrow both queries (from browser and from your code) using the same product number?

  • Anderson Joyle Profile Picture
    25 on at

    Hi Gunjan,

    Thanks for taking time to responde.

    I already using same product number. In fact, looking closely to my previous response (the one with some screenshots) you can tell that I'm retrieving the same records on both queries based on eTag value.

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Anders,

    Have you tested with any other third party tools? There are some details here -

    docs.microsoft.com/.../third-party-service-test

  • Anderson Joyle Profile Picture
    25 on at

    Yes. I tested with Postman as well. The results are the same as my Python code. I get ProductsV2, but not in line ReleasedProduct record.

  • Verified answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    What is your default company ? May be  the company you are querying does  not have any data ?

  • Suggested answer
    Anderson Joyle Profile Picture
    25 on at

    Spot on! I checked to which user id my Azure Application was assigned to and happens it was set to DAT company. At the end I was using two different users to run the same query.

    Thanh you all for taking your time.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans