Uploaded document conversion status
Is there any way to know a file's conversion status when uploading it to Box? I am looking for the equivalent on the new Box API v2 to the v1 Box API document status.
status: An enum indicating the conversion status of this document. Can be queued, processing, done, or error. Type: string
The purpose is to know if a document has finished converting after uploading it using the new Upload File API. I am using the box-node-sdk to upload the file:
Files.prototype.uploadFile = function(parentFolderID, filename, content, callback)
-
If you call the Representations endpoint with the `X-Rep-Hints: [pdf]` header, it will return the document's conversion status in the state property for the file. It will also return a URL in the info.url property, which you can poll to get the document's conversion status.
{ "type": "file", "id": "123456", "etag": "5", "representations": { "entries": [ { "representation": "pdf", "properties": {}, "info": { "url": "https:\/\/api.box.com\/2.0\/internal_files\/123456\/versions\/789\/representations\/pdf" }, "status": { "state": "pending" }, "content": { "url_template": "https:\/\/dl3.boxcloud.com\/api\/2.0\/internal_files\/123456\/versions\/789\/representations\/pdf\/content\/{+asset_path}" } } ] } }
Please sign in to leave a comment.
Comments
1 comment