Is it possible to create views using the REST API?

I cannot find any documentation that explicitly states whether or not it is possible to create views using the REST API (or programmatically in general). 

I have a use case where I need to create a large number of views, and using the REST API I can navigate through the views/folders/locations where these new views need to be created.  Ideally I would be able to create the new views as my program walks through the existing vault structure.

I have tested some code (python) and I am able to create objects of various classes and assign properties, but I have not found a way to create a view from the REST API.

Is this possible?

Thanks!

Parents Reply Children
  • It can be done using our COM API...

    What exactly is the use-case here?  Why are you copying views?

  • We have a large numbers of virtual folders (hundreds) that are divided into many categories (dozens).  Each of these virtual folders needs a set of views underneath them that are filtered based on the name of the folder above them.

    - Category View
         - Virtual Folder 1
              - View 1 (filtered for name of Virtual Folder 1)
              - View 2 (filtered for name of Virtual Folder 2)
         - Virtual Folder 2
              - View 1 (filtered for name of Virtual Folder 1)
              - View 2 (filtered for name of Virtual Folder 2)
         ....

    We have template views created but we need to edit the Filter on that view once it is copied or created underneath the Virtual Folder so that Filter uses the name of the Virtual Folder.

    I'm open to any suggestions to make this easier/faster/more efficient!

  • I'm assuming you cannot construct the view in such a way that the second level can also be a grouping?

    If not then our COM API definitely allows creation of views natively.  Another alternative would be to add your "view creation" code - which would use the COM API - to a vault application and expose it as a vault extension method.  You could then call this via the REST API.

  • We could not get a second grouping level to function the way we needed it to.  I believe it had something to do with the way the views were set up relative to the classes being used, but I am not 100% sure.

    I will look into both the COM API and creating an extension method to use with the REST API.

    Thank you very much for pointing me in the right direction!

  • Whilst the views are very flexible there are some situations where it's difficult to create a very specific folder structure, so I do believe you.  If you have a service manager here at M-Files then it may be worth double-checking with them that there's nothing you've missed.

    Good luck!