Python Microsoft Dynamic 365 FrameWork
Python Microsoft Dynamic 365 FrameWork
The Microsoft Dynamics 365 FrameWork is a basic REpresentational State
Transfer (REST) Application Programming Interface (API). It provides
integration to
Microsoft Dataverse Web API
resources.
Table of Contents
Quick Start
Installation
D365FW can be installed with
python -m pip install d365fw
or
pip install d365fw
Import the module
from D365FW.D365FW import D365FW
Authentication
The D365FW
framework allows user to authenticate the system using
OAuth. It accepts a fix list of
valid credentials to login to the system.
- hostname: the unique organization name for the environment
- client_id: the client (application) ID of the Azure registered application
- client_secret: the client secret (key) of the Azure registered application
- tenant_id: the tenant (directory) ID of the environment
d365fw = D365fw(hostname=hostname,
client_id=client_id,
client_secret=client_secret,
tenant_id=tenant_id)
Usage
Create
payload = {
'name': f'Microsoft Dynamics'
}
account_id = d365fw.accounts.create(json.dumps(payload))
Read
read_account = d365fw.accounts.read(account_id)
Update
payload = {
'name': f'Power Platform'
}
update_account = d365fw.accounts.update(account_id, json.dumps(payload))
Delete
delete_account = d365fw.accounts.delete(account_id)