We're sorry AsposeCloud doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.cloud

ConvertDocumentRequest doc to docx

I have an error in this code, really no idea why

error: KeyError: ‘RequestId’

code:
import os
import asposewordscloud
from asposewordscloud import models
import asposewordscloud.models.requests
from shutil import copyfile

client_id = ‘xxx’
client_secret = ‘xxx’

words_api = asposewordscloud.WordsApi(client_id,client_secret)
words_api.api_client.configuration.host=‘https://api.aspose.cloud

convert_request = models.requests.ConvertDocumentRequest(document=open(‘input.doc’, ‘rb’), format=‘docx’)
convert_response = words_api.convert_document(convert_request)

copyfile(convert_response, ‘output.docx’)

Please, how can I fix it?

@sophiasophia

We are investigating the issue. Meanwhile, can you please also share your input document?

Thanks!
Yes, I was trying to convert file like input.doc in zip belowinput.doc.zip (64.4 KB)

@sophiasophia

Thanks for sharing the input file. I have tested the scenario using the latest version of the Aspose.Words Cloud SDK for Python and have been unable to find any issues. Please ensure you are using the latest version of the Aspose.Words Cloud SDK for Python.

words_api = asposewordscloud.WordsApi(client_id,client_secret)
words_api.api_client.configuration.host='https://api.aspose.cloud'

inputFileName = 'C:/Temp/input.doc'
outputFileName = 'C:/Temp/output.docx'
#Convert Document without cloud storage
request = asposewordscloud.models.requests.ConvertDocumentRequest(document=open(inputFileName, 'rb'), format='docx')
result = words_api.convert_document(request)
open(outputFileName,'wb').write(result)