AXForum  
Вернуться   AXForum > Microsoft Dynamics NAV > NAV: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 29.01.2018, 11:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,617 / 848 (80) +++++++
Регистрация: 28.10.2006
saurav-nav: Microsoft Dynamics NAV 2018 - API Part 3 - Consuming API.
Источник: http://saurav-nav.blogspot.com/2018/...pi-part-3.html
==============

Hi Readers,

We already have two posts about NAV 2018 API listed below -

Microsoft Dynamics NAV 2018 - API Part 1.

Microsoft Dynamics NAV 2018 - API Part 2 - Configure API.


In this article, we will see how we can consume these APIs. For the Demo, I will use Google Chrome App called Postman. I am sure there are great developers out there who know how to consume it but I just wanted to test how it is consumed.

If you are interested in the small demo using Postman then please go further otherwise, i am sure you know how to consume these APIs.



1. Download Google Chrome App "Postman" using this link.

2. Launch App from Google Chrome window.


3. Close first popup/splash screen in-app. We can see that there are so many options (15) to choose from. But I was able to find out that NAV API only support 2 options - GET and POST.

GET is used to read data from NAV API.
POST is used to write data in NAV using APIs.


4. I am choosing one of the API from 44 APIs that we see in the last post. Lets select paymentMethods as highlighted below.



Base URL - http://localhost:11048/DynamicsNAV110/api/beta
Name - paymentMethods

So URL To use in POSTMAN - http://localhost:11048/DynamicsNAV11...paymentMethods

5. Let's try to use GET and compare data with NAV. In NAV Entity is Page - 5486 "Payment Methods Entity".

6. Now let's try to use the POST statement and check data in NAV.
If we choose to post and try to click Send it will not work obviously as it will require some data (at least primary key), as shown below.


Now I am comfortable with JSON, you can choose other forms based on your comfort and assigned value to - code and description. The code is code in API and Description is displayName in API.

In postman select the Body tab, select raw and you can select any of 7 formats. I will select JSON and enter values for both parameters and then click send.

** Just to remember all these are case sensitive.



7. Let's check data in NAV table. Here is what we got in NAV using the POST.


Hope you find the information useful and will be able to consume API In your environment.

In Next article, we will try to create a New simple API. If you have some thoughts please let me know.

Let me know your views.

Regards,
+Saurav Dhyani - Microsoft Dynamics Navision
saurav-nav.blogspot.in


Источник: http://saurav-nav.blogspot.com/2018/...pi-part-3.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
german_nav_developer: Buildnummern-Übersicht Microsoft Dynamics NAV 2013 R2 Blog bot NAV: Blogs 0 15.05.2016 18:12
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 8 Blog bot Dynamics CRM: Blogs 1 30.04.2016 10:26
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 17 Blog bot Dynamics CRM: Blogs 0 10.05.2014 06:30
NAV Team: How to: Set up your Microsoft Dynamics NAV installation for Single Sign-on with Office 365 using Windows PowerShell Blog bot Dynamics CRM: Blogs 0 19.12.2013 15:10
german_nav_developer: Buildnummern-Übersicht Microsoft Dynamics NAV 2009 Blog bot Dynamics CRM: Blogs 0 04.06.2010 13:21

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 12:57.