Quickly scanning the documentation it seems that the part of the json message contains this:
file: { value: chunk,
the ‘chunk’ should be a base64encoded representation of the document. So create an unlimited attribute ‘chunk’ for that data. Before calling the API call the community commons StringFromFile and then Base64Encode, put the value in chunk, map that attribute, call the API and clear the field (preventing unneeded database growth), or use NP objects.
Thank you for the response, Chris. I like the idea of using a non-persistable entity to keep the Mendix database small.
I ended up using two different API calls to accomplish the upload of the file to DocuWare and the update of the index/attribute values of the DocuWare record.
There’s probably a better way to do this, but I couldn’t get the JSON that the DocuWare API wants properly mapped in Mendix. The JSON template represents the actual field names and values in attributes instead of key/value pairs so the Mendix JSON interpreter just showed a bunch of FieldName objects.
{
"Field":[
{ "FieldName":"COMPANY", "Item": "Company 1", "ItemElementName":"String"},
{ "FieldName":"CONTACT", "Item": "Company 2", "ItemElementName":"String"}
]
}
Thanks again,
Dan