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

REST - change class of document

Hello,

my question is simply "how to change the class of an object via the REST API". I didn't found the answer in the documentation nor in this forum.

When I tried to just POST the new value of the property class, it don't want to.

Thanks for the help,

Amaury 

Parents
  • The issue is that under the bonnet this ends up calling M-Files API - SetProperty Method.  That COM API method has a note to say that you can't use it to change a class.

    I don't know whether I've tried this, but I think the only possibility would be to do a PUT to M-Files Web Service: Object properties.  It means you need to provide all the properties, not just the class, though.

  • Hello,

    We also face this issue but we didn't manage to correctly use the "Set All Properties" collection as it's in the Postman collection provided through GitHub.

    Is it possible that you give me a simple example of the body code needed for this to work?

    Thanks in advance

  • The Postman collection should include the "Set all Properties" example:

  • It does but I get a "Malformed data" error using the below body code:

    [
        {
            "PropertyDef": 0,
            "TypedValue": {
                "Value": "New Test",
                "DataType": 1
            }
        },
        {
            "PropertyDef": 100,
            "TypedValue": {
                "Lookup": {
                    "Item": 97
                },
                "DataType": 9
            }
        }
    ]

  • That's because there's a bug in the collection!  Thank you for highlighting it!

    The endpoint should be this one: M-Files Web Service: Object properties (i.e. remove the /100 from the end of the path).

    Note that you have to include all of the properties, not just name and class, otherwise the not-included properties will be dropped.

Reply Children