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 :
Microsoft Dynamics NAV (Archived)

Creating customers using Odata web service (Id 21 - Customer Card) with Postman

(0) ShareShare
ReportReport
Posted on by

Trying to use Postman to create a customer in NAV 2017.  Currently just trying to pass in 3 fields and keep getting the error "An error occurred while processing this request."  Anyone have an example/advice using Postman to test creating data with the NAV Odata services?  I can successfully GET data from my published Odata services no problem.

NavOdata.JPG

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Marcellus Profile Picture
    2,735 on at

    Hi JDX,

    Can you catch the error if you open the debugger, click debug next and run your request with postman?

    Regards,

    Marcell

  • Suggested answer
    Colome Profile Picture
    35 on at

    Hi JDX, I was the same error like you, after a couple of hours I found the trick:


    4606.1.png

    If you use php with Guzzle, this is the sintax:

    $apiRequest = $client->request('POST', 'www.myserver.com/.../Company(\'MyCompany\')/Table',[
                'auth' => 'username','password', 'ntlm' ],
                 'headers' => ['Content-Type' => 'application/json', 'Accept' => 'application/json'],
                 'body'    => '{"Cliente":"'.$currentuserid.'", "Descripcion":"'.$missatge.'"}',
                 //'body' => '{\'Cliente\':\''.$currentuserid.'\',\'Descripcion\':\''.$missatge.'\'}',
                
                'debug' => true                                  //If needed to debug   
          ]);

    Rememenber to activate NTLM on the webservice

  • Suggested answer
    Zaid Tariq Profile Picture
    2,274 on at

    Hi,

    Make sure these is not special character in your Company Name. Thanks

  • Community Member Profile Picture
    on at

    Hi Experts,

    Good day!

    I would like to ask if we need to register first the nav web service on azure before we can test it on Postman?

    TIA!

    Regards,

    Allan

  • Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Azure is absolutely not necessary. Just publish your WS (also on intranet) and call it.

  • Community Member Profile Picture
    on at

    Thank you so much for the quick reply!

    Can I know what are the needed authentication and header?

    Regards,

    Allan

  • Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    You can user windows authentication, so passing the credentials of the current users that executes the request. This is the default with POSTMan (no need to insert an Authorization in the Request Header).

  • sdfs Profile Picture
    25 on at

    Sorry,

    I have also the same problem with the same error: which was the issue? My json is the following:

    {

        "odata.metadata": "",

        "value":

           {

           "Prod_Order_No": "177642",

           "Line_No": 10000,

           "Operation_No": "10",

           "Item_No": "08692",

           "Quantity": "200",

           "Work_Center_No": "P2",

           "Standard_Task_Code": "",

           "Sales_Order_No": "ODV20-0030",

           "Sales_Order_Line_No": "10000",

           "Creation_Date": "2020-06-07T00:00:00"

           }

       }

    Thank you and best regards

  • Srdjan Grandic Profile Picture
    95 on at

    I would strongly advise not to use the standard page Customer Card for write operations via any web service. This page is designed to be used manually, by a real, live person, from the Windows or the web client. You may have issues when used via web service. It's a best practice to develop new, dedicated pages whenever you need to pass the data from some web service.

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 > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans