Create document with PHP
Hi,
I am writing the service to create a document on the content server (16.2) with PHP web application. I found the error {"error":"Could not process object, invalid action \u0027create\u0027"}.
Could you please advise me how to write the service to upload the document through custom web application?
Here is the code
$fields = [
'type ' => 144,
'parent_id' => $nodeid
'name' => $fileName,
'file' => $file
];
$headers = array( 'OTCSTicket: '.$ticket,
'Content-Type: application/x-www-form-urlencoded;');
$tmeCommand2= curl_init('http://localhost/alpha/cs.exe/api/v2/nodes');
curl_setopt($tmeCommand2, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($tmeCommand2, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($tmeCommand2, CURLOPT_TIMEOUT, 10);
curl_setopt($tmeCommand2, CURLOPT_HTTPHEADER, $headers );
curl_setopt($tmeCommand2, CURLOPT_HEADER, false);
curl_setopt($tmeCommand2, CURLOPT_POSTFIELDS, $field);
curl_setopt($tmeCommand2, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($tmeCommand2, CURLOPT_RETURNTRANSFER, true);
curl_setopt($tmeCommand2, CURLOPT_VERBOSE, true);
$raw_response = curl_exec($tmeCommand2);
Comments
-
What is the cut & paste code suggested by Postman that is the best way to diagnose language specific issues …
I have seen Java , c# as as well as many flavors of JavaScript but since I don’t do php don’t remember if postman suggests for that .
Also I see curl used so if you you go to swagger of OTDS Another product you will see the utility using curl. Curl has probably no relation to php .
Those were my thoughts @pookpl1 -
As @Appu Nair recommend, i can write the code to upload the document.
Thanks @Appu Nair
0
Categories
- All Categories
- 122 Developer Announcements
- 53 Articles
- 151 General Questions
- 147 Thrust Services
- 56 OpenText Hackathon
- 37 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Cloud Fax and Notifications
- 84 Digital Asset Management
- 9.4K Documentum
- 31 eDOCS
- 184 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 7 XM Fax
- Follow Categories