Seems like the documentation is missing some key concepts of how Documents and Files works in the API and there is some confusion related to their API names vs their names in the UI.
Let me try to explain:
Let's assume you have a Request object in Clarizen to which you would like to attach a File. A file "content" in Clarizen can have different storage backends: Google Doc, Box or an uploaded file. Let's map those UI names to API names:
- Request in the UI is called EnhancementRequest in the API
- File in the UI is called Document in the API
- Attached file in the UI is called "AttachmentLink" in the API
- File Content (Or uploaded file) in the UI is called File in the API
(Sorry about this confusion but that happens when we're changing entity names in the UI to make them easier to understand but need to maintain API compatibility)
So now you should follow these steps in order to attach a file to a request:
- Assuming you have a Request with ID "5bzijon2unjqiuxngci7kj3by7186"
- Create a Document object via the API (let's assume this document ID is "abc123"
- Create an AttachmentLink between the Request and the new Document (5bzijon2unjqiuxngci7kj3by7186 to abc123)
- Now that you have a document, you want to populate it with content. This is where the 3 steps you mentioned above kick in. You will need to perform them again but make sure to change the documentId parameter to use the Document you just created and not the Request
Hope this is clearer now.
The next issue there is with your request is that we are not able to parse it because it is not in JSON format.
According to our logs it is sent using urlencoded form format.