I'm having an issue figuring out the correct syntax / usage of the submit API call to store an item in IDM. I'm passing XML over to IDM to create a document with a template and I wish to store the result in IDM. I can successfully use the API to print or email the document, I'm just having issues with storing the document via the "item" target.
For example, I can create the document and email it using the following:
{
"input": [
{
"type": "generate",
"data": {
"type": "data",
"filename": "SourceXML.xml",
"base64": "Base64 Encoded XML Source File"
},
"template": {
"type": "xquery",
"xquery": "/Custom_Form_Templates[@Template_Name = "MyTemplateName"]"
},
"filename": "OutputFile.pdf"
}
],
"targets": [
{
"type": "email",
"to": "email@address.com",
"from": "email@address.com",
"subject": "Test Email",
"body": "Please see attachment"
}
]
}
To save the item in IDM, I changed my target to an "item", like this:
"targets": [
{
"type": "item",
"itemdatafile": {
"type": "data",
"base64": "Base64 Encoded XML of Item / Attribute File",
"filename": "AttrFile.xml"
}
}
]
The Base64 encoded data I'm sending here is the following XML:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<item xmlns="">">http://infor.com/daf">
<filename>OutputFile.pdf</filename>
<entityName>Doc_Type_Name</entityName>
<attrs>
<attr>
<name>Attribute_Name</name>
<value>Attribute Value</value>
</attr>
</attrs>
</item>
When I submit though, I receive the following error:
[Could not save document to IDM with CMItem = <?xml version="1.0" encoding="UTF-16" standalone="no"?> <item xmlns="http://infor.com/daf"> <isArchived>false</isArchived> </item> . Could not add items to IDM. 400 Bad Request Caused by: <?xml version="1.0" encoding="UTF-8" standalone="no"?><error xmlns="http://infor.com/daf"><areaCode>ICR012</areaCode><area>ICR</area><code>ADD_ENTITY_NAME</code><message>The entity name must be set before adding an item!</message><detail>The entity name must be set before adding an item!</detail></error>]
So, obviously, I'm missing something here. I've found very little documentation on how to use this API, so I've tried to piece this together from a bunch of different sources.
Can anyone shed some light on what I'm missing?