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

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Cannot get Item ID from Odata service or Business central V2.0 API

(0) ShareShare
ReportReport
Posted on by 60

Hello Community,

I am trying to get a list of all the items with their respective id's under a specific company, stored in business central.

I tried to use the ODATA API in the following way

https://api.businesscentral.dynamics.com/v2.0/{tenantId}/{environmentName}/ODataV4/Company('{companyName}')/Items

were Items is a Odata service expose through the business central web service configuration targeting object 32

pastedimage1636643427603v1.png

The service works, but I am not able to see the internal ID.

I also tried to switch to the business central v2.0 API and try to get the items that I need by doing the following:

https://api.businesscentral.dynamics.com/v2.0/{tenantId}/{environmentName}/api/v2.0/companies({companyId})/Items
 

but this seems not to be a valid operation because I receive the following error

7776.code.png

How do I get a list of Company Items with their respective Id's?

I have the same question (0)
  • M.Barimah Profile Picture
    60 on at
    RE: Cannot get Item ID from Odata service or Business central V2.0 API

    Hello Zhu,

    Thank you for the post, it pointed me to the right direction. Really nice interesting article by the way. At the end I realized that I was doing a rookie mistake. The business central api was expecting "items" instead of "Items", after the change it worked perfectly.

    Thanks 

  • Verified answer
    YUN ZHU Profile Picture
    92,443 Super User 2025 Season 2 on at
    RE: Cannot get Item ID from Odata service or Business central V2.0 API

    Hi, you can use standard APIs.

    For example: api.businesscentral.dynamics.com/.../items

    pastedimage1636678967815v1.png

    More details: https://yzhums.com/6117/

    Hope this will help.

    Thanks.

    ZHU

  • Suggested answer
    Rob F. Profile Picture
    487 on at
    RE: Cannot get Item ID from Odata service or Business central V2.0 API

    Hi, to use the standard API try using "Item" instead of "Items" in your string.

    api.businesscentral.dynamics.com/.../Item

    item resource type - Business Central | Microsoft Docs

    Rob

  • M.Barimah Profile Picture
    60 on at
    RE: Cannot get Item ID from Odata service or Business central V2.0 API

    Hello Akshay,

    Thanks for your answer,

    do you mean that I need to create a page extension in AL and then add the GUID to the page? I was under the impression that the OData service should return the GUID out of the box without me creating an extension, is this wrong?

  • Suggested answer
    Akshay_Panchal Profile Picture
    402 on at
    RE: Cannot get Item ID from Odata service or Business central V2.0 API

    Hii,

    You have create new field with datatype GUID. system allocate unique GUID for each record.that way you can get the specific item using GUID.

    Thanks.

    Verify, If this answer is helpful to you.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,132

#2
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 3,615

#3
Sumit Singh Profile Picture

Sumit Singh 2,912

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans