question

StevenFayers-1867 avatar image
0 Votes"
StevenFayers-1867 asked saldana-msft edited

Graph API convert to other formats xlsx reporting "Incorrect format specified"

Using graph API, I have a CSV file stored on SharePoint, and I'm trying to convert the content to xlsx following this page:
https://docs.microsoft.com/en-us/graph/api/driveitem-get-content-format?view=graph-rest-1.0&tabs=http


using

 GET           https://graph.microsoft.com/v1.0/drives/(driveid)/items/(itemid)/content 

I get the content returned, but using

 GET           https://graph.microsoft.com/v1.0/drives/(driveid)/items/(itemid)/content?format=xlsx 

I get an error:

 "code": "invalidRequest",
 "message": "Incorrect format specified"

I tried PDF as well:

 GET           https://graph.microsoft.com/v1.0/drives/(driveid)/items/(itemid)/content?format=pdf

I get a different type of error,



  "code": "notSupported",
   "message": "csv",
   "innererror": {
     "code": "InputFormatNotSupported"

Can anybody advise me if the graph API can convert CSV to XLSX, and if so, what is wrong with my request?



microsoft-graph-filesmicrosoft-graph-sites-lists
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Adding right tags/teams to answer

0 Votes 0 ·

Share requestid, timestamp for the above issue repro

0 Votes 0 ·
   "date": "2021-02-08T09:18:31",
   "request-id": "5091c391-c793-420e-b165-12bbbcff7b34",
   "client-request-id": "5091c391-c793-420e-b165-12bbbcff7b34"
0 Votes 0 ·

@StevenFayers-1867 did you find an answer to this? We're running in to the same issue when trying to convert .csv files to .pdf using the same endpoint you're using.

0 Votes 0 ·

No, unfortunately not, and radio silence from MS.

0 Votes 0 ·

0 Answers