Using REST API to add a version to a document
Options
Hi,
Looking at the API documentation, it appears that creating a new document is supported (POST), as is updating the metadata on a document (PUT), but I cannot find an entry for appending a new version. If the correct place is the PUT API (Update document), which field does the new file go into?
While I'm asking, is it possible to specify the MIME type, or at least instruct Content Server in the AddVersion to *not* change the existing MIME Type? The use case is that a CSV file needs to be uploaded by API call to be processed by a WebReport. Since WebReports can take a CSV file as a data source only for the case of a static DAPI node, I need to have the leading application append versions to an existing node rather than upload a new file. When I do this through the web UI, it always clobbers what I have preset for MIME type with the Microsoft-friendly MIME type for CSV files. WebReports can only deal with text/csv not application/vnd.microsoft-excel
Thanks in advance
-Hugh
Looking at the API documentation, it appears that creating a new document is supported (POST), as is updating the metadata on a document (PUT), but I cannot find an entry for appending a new version. If the correct place is the PUT API (Update document), which field does the new file go into?
While I'm asking, is it possible to specify the MIME type, or at least instruct Content Server in the AddVersion to *not* change the existing MIME Type? The use case is that a CSV file needs to be uploaded by API call to be processed by a WebReport. Since WebReports can take a CSV file as a data source only for the case of a static DAPI node, I need to have the leading application append versions to an existing node rather than upload a new file. When I do this through the web UI, it always clobbers what I have preset for MIME type with the Microsoft-friendly MIME type for CSV files. WebReports can only deal with text/csv not application/vnd.microsoft-excel
Thanks in advance
-Hugh
1
Comments
-
Hugh, I did a POST on api/v2/nodes/DataId/versions. As for the file I have a form with an objid text field and an input (type=file) field. Also form has an enctype="multipart/form-data". I have not tried to specify the MIME type.
Cheers...2 -
John is right. You can try adding a new version using Smart UI and "spy" on the network communication too.
The MIME type comes from the `Content-Type` header of the request body part with the file content. If code in JavaScript, you can change the `type` property of the file blob, before you add it to `FormData`. If it is a general type, it will work, vendor-specific types may require the application installed, which handles those file types.0 -
Hi,
I suggest you to visit the below link where they have explained about the API Versioning.
https://www.meritedin.com/blogs/api-versioning
Please don't forget to check the videos listed in their playlist.
Regards,
Sowthri S
-4 -
Comentario.
0 -
Comentario
0 -
0
Categories
- All Categories
- 111 Developer Announcements
- 49 Articles
- 104 General Questions
- 123 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 897 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 123 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 1 XM Fax