CubeDrive   ->   API

Word to online document【importDocx】


With this API, users can upload Word file(.docx) and create an online document。

Name:

{{baseuri}}/editor-v2/importDocx

Parameter:

http method: POST

Steps


The following lists the steps

@baseuri = http://localhost:8080/cubedrive-webapp
@username= admin
@password= abcabc
@xAuthToken=bbb6c793-832c-4733-9601-a023366d918f

###
GET {{baseuri}}/getLogin?j_username={{username}}&j_password={{password}}

###
POST {{baseuri}}/editor-v2/importDocx
X-Auth-Token: {{xAuthToken}}
Content-Type: multipart/form-data; charset=utf-8; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

X9IxyAGE5PQ
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="filePath"; filename="周报.docx"
Content-Type: application/octet-stream

< /home/test.docx
------WebKitFormBoundary7MA4YWxkTrZu0gW--    
    

Result


{
  "success": true,
  "documentId": "xxxxxxxxx"
}    
    

Open file


User can open the file with the documentId

    {{baseuri}}/editorNew?fileId=xxxxxxxxx