Dynamic 365 可以由外部存取資料, 分為native app / Web API 2 款.

Mircosoft 本身有提供教學: https://github.com/Microsoft/Dynamics-AX-Integration

MAAD1.PNG

下載後只要在 AuthenticationUtility  內填寫返正確的Mircosoft Azure Active Directory 資料.

MAAD2.PNG

Mircosoft Azure Active Directory 資料 : 

1. 登入Mircosoft Azure Active Directory 

2. 選擇 :  Azure Active Directory

3. 選擇 : App registrations

4. 加1個全新的 App registrations

MAAD3.PNG

MS Exmaple 內的都是Native app.

Name : <App registrations name>

Application type: Native

RedirectURI : 如果沒有要LOGIN, 隨便打一個就可以了.

MAAD4.PNG

之後按: Create

Create 完成後就增加premission :

按Settings  > Requried Premission > Add

MAAD5.PNG

選擇: Select an API > Mircosoft Dynamics ERP > Select

MAAD6.PNG

Select Premission > Select all 

MAAD7.PNG

Grant permissions:

MAAD8.PNG

Add Owner:

加返自己入owners list 度

 

最尾將Appliation id 加返入example 度

在Dynamics 365 內也需要加上這個applicationid

將JsonConsoleApplication 設定為 StartUp Project > 再接Start 就能看到來自D365 的資料了.

 

而使用PHP 連接, Mircosoft Azure Active Directory 需要選擇 Web API.

在Settings 中需要多加一個KEYS, 加一個PASSWORD, 記得要儲下來, 因為之後就會HIDED 了.

WEBAPI 除了APPLICATION ID 也需要提供這個KEY 的, 因為D365 是用POST 來收東西,所以HEADER 需要有這個KEY 做AUTH 才可以拿到正確的TOCKEN.

我是把SAMPLE 入面的PHP 搬到IIS 下的FOLDER 內試運行. (IIS 要support PHP & CURL)

 

 

 

 

 

arrow
arrow
    文章標籤
    Dynamic 365 AX D365 PHP
    全站熱搜

    lionlionchopper 發表在 痞客邦 留言(0) 人氣()