A Python Module that utilises Dynamics365 WebApi
and connects via Azure App Token
. The basic design around Microsoft Project
MS Developer Documentation.
Also what you will need to do is to create a Azure App Token
, see this blog here from my friends at Magnetism Solutions
Blog.
Simple syntax of using the package.
python WebApi.py -h
, Show the package argument help.
python WebApi.py -v
, Show the current installed version of this package.
python WebApi.py -i <xxx.dynamcis.com>
, Change the Dynamics365 instance of what is listed in the Config.yaml file.
python WebApi.py -t
, Test Connection to your Dynamics365 instance.
python WebApi.py -c <file location>
, Change the default location of the Config.yaml file.
python WebApi.py -x <other arguments>
, Query the Dynamics365 Instance from the CLI.
You are able also to the the CLI interface to perform basic queries. Here is an example of Querying Dynamics365 and return you a result of all the Account Name in the Dynamics365 Instance.
python WebApi.py -x retrievemultiplerecords -e accounts -q "?$select=name"
Or here to show the CLI Options
python WebApi.py -x options
You will need to create a yaml config file that includes all your creds to connect to your instance of Dynamics CRM. The default file name should be called xrm_config.yaml
Example config.yaml file.
Download config.yaml
from pyDynamicsWebApi.WepApi import WebApi
webapi = WebApi(' _location for your config file_ '})
webapi.__connection_test__()
response = webapi.retrieve_multiple_records('accounts', options="?$filter ???")
Rather than always stressing my brain creating querys to get the data required I have always found FetchXML Builder developed by Jonas Rapp that is part of the XrmToolBox extreamly helpful. Simply use the GUI to create your query, then copy out the query string and place in where needed in your project.
- delete_record
- is_avaiable_offline
- execute
- execute_multiple
- Generic other stuff (Tidy Code.)
- Updated webapi.retrieve_multiple_records to retreave all records based on next_link prama.