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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Business Central forum

Create product with Web API

(0) ShareShare
ReportReport
Posted on by

I try to create a product (item) using OData V4 URL available in Web Services section in Microsoft Dynamics 365 for Financials as shown below.

4.png

I use Postman to execute the POST request. Postman simulates a HTTP request, such as POST, GET and so on.

Each request is proceed with an authenticated and valid account (demo account)

The POST OData V4 URL is taken from the Web Services sections example: https://xyz.financials.dynamics.com:7048/MS/ODataV4/Company('my-company')/Item_Card

I also tried with the entity "Item", I got the same result.

Here is the config set in Postman:

Headers

7411.1.png

Body

6763.2.png

 

When I execute the request, I get the following error:

3.png

What is the missing "Data object"? Is this a standard of OData V4 protocol? Do I must supply a "Data object" into the body?

Is there anyone encountered that error and could explain what is missing/not working?

Any help will be appreciated.

Categories:
  • Jonas Vachal Profile Picture
    on at

    It appears as if the rest endpoints just became available with build 16552.  I'm still trying to dig up the endpoint documentation.  In the meantime can you confirm you are on the latest build?

    Your system information card should give you the build number.

  • Community Member Profile Picture
    on at

    I'm working on build 16259 which is a demo version.

    If you find anything please let me know. I'll do the same thing on my side.

    Thank you Jonas.

  • Community Member Profile Picture
    on at

    I am now on build 16552. I try the same thing as shown above and I still get the "Data object not provided" error.

    Did you successfully reach the endpoint?

  • Community Member Profile Picture
    on at

    Any update on this Jonas?

  • Chris Bulson Profile Picture
    Microsoft Employee on at

    Hello Moerg,

    You can use the new API by hitting:

    xyz.financials.dynamics.com/.../beta

    Thanks,

    Chris

  • Community Member Profile Picture
    on at

    Thank you Chris, your answer is very appreciated. Glad to see improvement on the API side.

    I can't figure out how to create an item with the specified URL. I tried the following URL: xyz.financials.dynamics.com/.../beta with POST, PUT and PATCH method.

    I always get the following error: The requested resource does not support http method 'X', where X is POST, PUT or PATCH method.

    Could you help me on that? How can I create a product with the new URL and which method I should use? Did I miss something?

  • Chris Bulson Profile Picture
    Microsoft Employee on at

    Hello Moerg,

    You can hit the following URL in a browser to download the metadata.

    xyz.financials.dynamics.com/.../beta$metadata

    The documentation on this is still being worked on, but the Metadata should be enough for a developer to take and work with.  There isn't an Item_Card API, it's just 'items'.

    Thanks,

    Chris

  • Community Member Profile Picture
    on at

    Alright, thank you Chris, always appreciated to see your answers.

    Do have a ETA for the documentation?

    Would this URL be valid according to your post to create an item: xyz.financials.dynamics.com/.../Items

    I tried the different URL, e.g xyz.financials.dynamics.com/.../beta$metadata#Items

    and

    xyz.financials.dynamics.com/.../beta

    I still cannot figure out which URL to use and how to create a product with the endpoint.

    Could you give me some explainations? Thank you so much!

  • Suggested answer
    Peter Borring - Microsoft Profile Picture
    156 on at

    Although an old thread, I'll add some info for anyone else reading this.

    We have two stories here:

    • OData web services, which have been supported for a long time on on-premise Dynamics NAV
    • A new REST based standard APIs, which have been added recently to the cloud service Dynamics 365 for Financials and Operations, Business Edition as well as on-premise Dynamics NAV 2018.

    These two APIs have similar entities (e.g., Items), but they are different implementations and object models. The OData web services are mainly samples for partners customizing the on-premise product, whereas the new APIs are provided by us for easy integration to the cloud service.

    If you want to connect to the OData services, you need to access the OData endpoint, which is machine/tenant specific. The urls are as documented in the Web Services page in the first thread post.

    If you are connecting to the new standard REST APIs, then you have two options - for testing you can use basic authentication (username and web service access key) against the online tenant url, and for production you have to use Azure Active Directory and the common (tenant independent) API endpoint api.financials.dynamics.com.

    For more documentation on the new APIs, see

    aka.ms/getstartedwithapis

    docs.microsoft.com/.../endpoints-apis-for-dynamics

    docs.microsoft.com/.../index

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans