Dear Sir or Madam, There is an error appearing from converting pptx to pdf from o365 office via Graph API. We use a sharepoint from which we can read data via an o365 app registration. The error appears with documents starting form > 100 pages. The document which failed had 170 slides of the size 19,4 MB. Setting up a timeout for the request did not solve the problem. Please, see the attached code and the error message:
```
url = f"https://graph.microsoft.com/v1.0/sites/{sharepoint_id}/drive/items/{document_id}/content?format=pdf"
headers = {'Authorization': 'Bearer ' + access_token}
response = requests.get(url, headers=headers)#, timeout = 10) # in minutes, default 30 sec
if response.ok:
content_stream = BytesIO(response.content)
else:
print("Failed to retrieve document:", response.status_code)
print(response.content)
content_stream = None
```
The error message is:
```
Failed to retrieve document: status code 500
b'{"error":{\r\n "code": "generalException",\r\n "message": "Error from Office Service. Url=https://euc.pptcs.officeapps.live.com/document/export/pdf HttpCode=InternalServerError cert=subject:;thumbprint: ResponseHeaders=X-ErrorCode: Service_Timeout\r\nX-ErrorCategory: Fatal\r\nX-IsRetriable: False\r\nX-FileDownloadTimeInMs: 1439.3197\r\nX-ClientCorrelationId: 06524ba1-f01a-0000-1ec4-6e5e55678cec\r\nX-ServiceCorrelationId: 06524ba1-f01a-0000-1ec4-6e5e55678cec\r\nX-ConversionTimeInMs: 28111\r\nCache-Control: private\r\nDate: Fri, 30 Aug 2024 11:03:04 GMT\r\nETag: ce20b453b92a5c7fd1763d507747c787d4220f5c2a782dbef02f35059f20b1de\r\nServer: Microsoft-IIS/10.0\r\nX-AspNet-Version: 4.0.30319\r\nX-Powered-By: ASP.NET\r\n",\r\n "innererror": {\r\n "code": "OfficeConversion_Fatal"\r\n }\r\n}}'
```
I have also tried using Graph SDK and it returned the same status_code:
```
from msgraph import GraphServiceClient
from msgraph.generated.drives.item.items.item.content.content_request_builder import ContentRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
query_params = ContentRequestBuilder.ContentRequestBuilderGetQueryParameters(
format = "pdf",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.drives.by_drive_id(drive_id).items.by_drive_item_id(document_id).content.get(request_configuration = request_configuration)
```
Output:
```
APIError Code: 500 message: None error: MainError(additional_data={'innererror': {'code': 'OfficeConversion_Fatal'}}, code='generalException', details=None, inner_error=None, message='Error from Office Service. Url=https://euc.pptcs.officeapps.live.com/document/export/pdf HttpCode=InternalServerError cert=subject:;thumbprint: ResponseHeaders=X-ErrorCode: Service_Timeout\r\nX-ErrorCategory: Fatal\r\nX-IsRetriable: False\r\nX-FileDownloadTimeInMs: 1531.2778\r\nX-ClientCorrelationId: 21524ba1-f036-0000-1ee9-fc1fb99d1922\r\nX-ServiceCorrelationId: 21524ba1-f036-0000-1ee9-fc1fb99d1922\r\nX-ConversionTimeInMs: 28136\r\nCache-Control: private\r\nDate: Fri, 30 Aug 2024 11:04:56 GMT\r\nETag: 2a0def08fe76865e45d6f5d4f3227822036da8ccfb5beee8002cb72bc182f4d0\r\nServer: Microsoft-IIS/10.0\r\nX-AspNet-Version: 4.0.30319\r\nX-Powered-By: ASP.NET\r\n', target=None)
```
Best regards,
Maryna