I’m trying to update specification documents via REST API in Windchill 11.1 M030 and consistently getting HTTP 415 Unsupported Media Type errors. The GET requests work fine for retrieving specification metadata, but PUT requests to update content fail immediately.
Our integration needs to programmatically update specification documents with new PDF versions. We’re setting Content-Type header requirements to application/pdf and including the binary file data in the request body. Here’s the error we’re hitting:
PUT /Windchill/servlet/odata/DocMgmt/Specifications('OR:wt.doc:123456')/content
Content-Type: application/pdf
[binary PDF data]
Response: 415 Unsupported Media Type
The Windchill documentation mentions multipart upload for binary files but doesn’t provide clear examples for the specification API. Are we using the wrong endpoint or content type for updating spec documents?
You need to use multipart/form-data with proper boundaries. The request should have two parts: one for the JSON metadata describing the file (name, format, etc.) and one for the actual binary content. The Content-Type for the overall request must be multipart/form-data, not application/pdf. This is standard for any binary upload through REST APIs.
Check which supported document types are configured for specifications in your Windchill instance. Even if you’re uploading PDF, the specification type might be restricted to certain formats. Go to Type and Attribute Management and verify the allowed content types for your specification subtype. Also, the content upload endpoint is different from the metadata update endpoint - make sure you’re targeting the right URL path.
That makes sense about multipart encoding. So I need to restructure the request completely. Would the JSON metadata part include things like the file name and MIME type? And does the binary part need any specific headers beyond the content disposition?
The specification content API requires multipart/form-data encoding, not direct binary upload. You can’t just PUT raw PDF bytes with application/pdf content type. The API expects a properly structured multipart request with metadata and file parts.