Resp API create document with multilangual metadata

Hello Community,

I want to create an object with multilingual metadata in M-Files using the POST API, but I'm unsure about the correct format. I used the request body below, but an error occurred.

String body = """
{
"PropertyValues": [
{
"PropertyDef": 0,
"TypedValue": {
"DataType": 1,
"Value": {
"1033": "Invoice",
"1036": "Facture",
"1034": "Factura"
}
}
},
{
"PropertyDef": 22,
"TypedValue": { "DataType": 8, "Value": false }
},
{
"PropertyDef": 100,
"TypedValue": { "DataType": 9, "Lookup": { "Item": 0 } }
}
],
"Files": []
}
""";


{"ErrorCode":"393221","Status":500,"URL":"/objects/0","Method":"POST","Exception":{"Name":"COMException","Message":"Type mismatch.","InnerException":{"Name":"MFilesException","Message":"Type mismatch.","StackText":"Error reference ID: 06c99fa6-e93d-4007-bbe0-5c2dc5b1f8f6","ErrorCode":"393221"}},"Stack":"Error reference ID: 06c99fa6-e93d-4007-bbe0-5c2dc5b1f8f6","Message":"Type mismatch.","IsLoggedToVault":true,"IsLoggedToApplication":true,"ExceptionName":"COMException"}


Thanks for help

Parents
  • You are setting 3 property and one or more has incorrect datatype. I'd first try "False" and "FALSE"..

  • Hello  I tried with "False" and "FALSE" and I got the same result : 

    {"Status":400,"URL":"/objects/0","Method":"POST","Exception":{"Name":"ArgumentException","Message":"Malformed data.","InnerException":{"Name":"JsonReaderException","Message":"Unexpected character encountered while parsing value: F. Path 'PropertyValues[1].TypedValue.Value', line 16, position 48.","StackText":"Error reference ID: 095fa2c4-0b85-4491-b198-04163d5f1ef4"}},"Stack":"Error reference ID: 095fa2c4-0b85-4491-b198-04163d5f1ef4","Message":"Malformed data.","IsLoggedToVault":true,"IsLoggedToApplication":true,"ExceptionName":"ArgumentException"}

Reply
  • Hello  I tried with "False" and "FALSE" and I got the same result : 

    {"Status":400,"URL":"/objects/0","Method":"POST","Exception":{"Name":"ArgumentException","Message":"Malformed data.","InnerException":{"Name":"JsonReaderException","Message":"Unexpected character encountered while parsing value: F. Path 'PropertyValues[1].TypedValue.Value', line 16, position 48.","StackText":"Error reference ID: 095fa2c4-0b85-4491-b198-04163d5f1ef4"}},"Stack":"Error reference ID: 095fa2c4-0b85-4491-b198-04163d5f1ef4","Message":"Malformed data.","IsLoggedToVault":true,"IsLoggedToApplication":true,"ExceptionName":"ArgumentException"}

Children