This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

mfws and python

Former Member
Former Member
I'm currently starting a project to interact with mfiles using python.  I've managed to get authentication tokens with this code:

#testbed for requests (http api) and mfiles REST interface
import requests
import json
#try to retrieve authentication tokens
authentication = 'localhost/.../authenticationtokens.aspx'
data = json.dumps({"Username":"yourname", "Password":"yourpassword"})
h= requests.post(authentication, data = data)
print(h.reason,'reason')
print('#')
print(h._content)

Anyone interested in working on this jointly?

New discovery.  The data line must be changed to :

data = json.dumps({"Username":"yourname", "Password":"yourpassword",
                  "VaultGuid":"{1E5F2435-AFB8-4A7D-92D3-45B04D1268D9}"})

or the token won't work for individual vault access.

  • Former Member
    Former Member
    I had some problems with Microsoft Visual Studio Professional 2019 | Version 16.4.5. It was pointing at import mfiles and saying that module mfiles is not supported/recognized. I was trying with package version mfiles 0.4.0. Then I have started Visual Studio as an administrator, removed old package and installed newer version 0.5.0. Also had some problems with logging in using personal account via REST API. In our case users are synchronized with M-Files from another system. We use Azure AD for web access that is logging in basically automatically. So I used M-Files user details that was created directly from M-Files manually (this user account is used for automation purposes) and everything worked for file download at least :)

    Thumbs up for your work! I think M-Files should give some "support" for effort given!

    I will read documentation in more detail and come back with questions if there will be any.