Skip to main content

Cannot load .docx attachment via API due to Content-Type exceeding 50 characters

Written by Petr Pech

The solution is to use a shorter form of the content-type.

Long forms:

"application/vnd.openxmlformats-officedocument.wordprocessingml.document" (for .docx files)
"application/vnd.openxmlformats-officedocument.wordprocessingml.template" (for .dotx files)
"application/vnd.openxmlformats-officedocument.presentationml.presentation" (for .pptx files)
"application/vnd.openxmlformats-officedocument.presentationml.slideshow" (for .ppsx files)
"application/vnd.openxmlformats-officedocument.presentationml.template" (for .potx files)
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" (for .xlsx files)
"application/vnd.openxmlformats-officedocument.spreadsheetml.template" (for .xltx files)

Short forms:
"vnd.ms-word.document.macroEnabled.12"
"vnd.ms-word.template.macroEnabled.12"
"vnd.ms-powerpoint.template.macroEnabled.12"
"vnd.ms-powerpoint.addin.macroEnabled.12"
"vnd.ms-powerpoint.slideshow.macroEnabled.12"
"vnd.ms-powerpoint.presentation.macroEnabled.12"
"vnd.ms-excel.addin.macroEnabled.12"
"vnd.ms-excel.sheet.binary.macroEnabled.12"
"vnd.ms-excel.sheet.macroEnabled.12"
"vnd.ms-excel.template.macroEnabled.12"

Did this answer your question?