Where To Find Details on IDM REST API /Items Endpoint
I'm trying to add documents to Infor Document Management system using the REST API. Swagger document example is not very helpful.
Does anyone know where to find details and examples on what elements are required for /Items POST body for IDM API?
Best Answer
-
The Example provided in the Swagger documentation should give you all the elements you need to pass to the API.
The Attributes (attrs) are the Attributes of the Document Type in IDM. You can see these in OS→Document Management→Administration→Document Type. You need to supply all required attributes.
The Resource (resrs) is the actual file you upload with filename and the data base64 encoded.
The ACL (acl) is the Access Control List you want to assign to the Document. Which ones are available depends again on the Document Type. If left out, IDM will assign the default ACL.
Entity Name in the /item request is the Document Type.
0
Answers
-
{ "item": { "attrs": { "attr": [{ "name": "Company_Number", "value": "1000" },{"name": "Order_Number", "value": "1111" }] }, "resrs": { "res": [{ "filename": "TestFile.pdf", "base64": "YmFzZTY0ZW5jb2RlZF9zdHJpbmc=" }] }, "acl": { "name": "Public" }, "entityName": "Quote" }}
I dont like to use the application/xml type, so I switch to application/json, but above is an example of the json request I would use to Upload a pdf document to Quote Document Type with the given attribute values, Company Number and Order Number.
0 -
Try retrieving a document for some example data of your Document Type.
1 -
You can view couple of request payloads directly in the IDM application using developer tools, as it is built on Angular.
1 -
Thank you Kevin!
I'm looking more for an Infor reference guide or tutorial for the required format of the /Items POST payload that includes attributes, resources, and more.
I get an error message
The document could not be created. Make sure that all attributes are correct.
from the /Items POST endpoint when I attempt to add an item to IDM
I assume it's because I'm not including the correct data in the payload. I can get an item (document) I manually loaded into IDM using Item/PID endpoint just fine.
I even tried crafting a new payload by starting with some of the XML from the Get of a valid document, including but altering the attrs elements and some other elements
I'm hoping to find an Infor reference guide containing information about how to add a document instead of playing my guessing game of what elements the /Items endpoint requires
I'm very new to Infor and I'm just unaware of where such a guide might be. For example, it would be helpful to see the MDS_GenericDocument schema that these IDM documents appear to be
0 -
Thank you Rinjin Lama! I'm new to Infor and am not aware of the developer tools. Is it a desktop application? I don't see anything about it in Infor Developer Portal or this Infor LN Development Tools Development Guide I found.
0 -
In your payload you need to include all the documet attributes in the document type.
0 -
There is a tutorial on the Developer Portal that goes into this, https://developer.infor.com/tutorials/robotic-process-automation/uploading-documents-to-idm-using-infor-rpa/
0 -
Chrome Developer Tools are primarily used by developers to build frontend applications. You can view several request payloads directly in the IDM application. Here is a tutorial on using Developer Tools.. https://www.youtube.com/watch?v=fxplz32rgEQ
1 -
@rgcanpres maybe this video from Infor can also help you on how to use the post api to upload document in ION, in the video there is an example of the request body, https://www.youtube.com/watch?v=2AbW8uVp5Kk
0