RestAPI : Set the CreatedBy

Is there any equivalent of the SetCreationInfoAdmin method in the Rest API ?

M-Files API - SetCreationInfoAdmin Method (m-files.com)

I've tried setting the Property 25 but the value never changed.

We are planning to create document from an external application using a custom application user but need to associate the document to an actual M-Files user.

Parents
  • Hi Sebastien,

    Actually, if you set the "Created By" property to correct MFilesUserID, you should be able to set correctly "Created By" property. I have used it during some migration tasks where I needed to take over information who created a document. It is important that your logic maps external user to M-Files user ID (usually if you have object type Employee or similar you have behind reference to M-Files user). When you upload your document, you should provide "Created By" in the list of properties and it should do the job.

    What how ever not works always is setting up "Last Modifed By" property when you upload from external a document with properties. In that case that worker process/admin user is assigned, even though you set your specific user.

    Another problems are "Created" and "Last Modifed" timestamps which I am unfortunately not aware how to set.

    I am using M-Files REST Library (C#).

    Dejan

  • That's the first thing I've tried before posting in the forum.

    For me it doesn't work as I received an error 500 "Access denied. You do not have the access rights required by this operation." when setting property 25.

    I'm using Postman to build my scenario. I will take a look at the REST library.

  • What type of user are you making this request with? What rights do they have in the vault? 

  • Well, I use a normal user rights (aka nothing checked on the user). I thought I have test it with full control after that... must have made a mistake in my multi-server env because now it works.

    Do you know if there is a special permission I can set? I'd rather not give that user Fullcontrol on the vault.

  • Look like that's the only permission needed

  • So, in general this is what I would expect.  I wouldn't expect a standard user to be able to create objects and state that they were created by another user.

    I do have a deep-seated concern about creating objects that, according to the audit trail, were created by other users.  But maybe that's a topic for another time and place.

Reply
  • So, in general this is what I would expect.  I wouldn't expect a standard user to be able to create objects and state that they were created by another user.

    I do have a deep-seated concern about creating objects that, according to the audit trail, were created by other users.  But maybe that's a topic for another time and place.

Children
No Data