Request records with OData

Completed 100 XP

To request records with OData, you need to know the structure of the different OData services and the fields that it returns. This information can be found in the EDM document.

When requesting records, you must always provide the company before you can request a specific service. The following example shows a request of all customer records. When requesting these records, you must first define the default company in the URI. Because the primary key of the Company table is Name, you need to provide the name to select a specific company.

The base URL that you should use is: https://api.businesscentral.dynamics.com/v2.0/\<tenant\>/Sandbox/ODataV4/Company('CRONUS%20USA%2C%20Inc.')/Customers

To retrieve on a specific customer record, you can provide the value of the primary key of the record that you want to select. For the Customer table, the primary key is No., and it has a data type of Code. Therefore, you need to specify the value between two single quotation marks.

The base URL that you should use is: https://api.businesscentral.dynamics.com/v2.0/\<tenant\>/Sandbox/ODataV4/Company('CRONUS%20USA%2C%20Inc.')/Customers('10000')


Next unit: Work with OData query options

Previous Next