We’re integrating with Oracle Fusion Cloud SCM supplier collaboration module via REST API to automate document uploads. When attempting to upload PDF attachments to supplier records, the API consistently returns a 415 Unsupported Media Type error.
Here’s our current request structure:
POST /fscmRestApi/resources/11.13.18.05/suppliers/{supplierId}/child/Attachments
Content-Type: application/json
Body: { "FileName": "contract.pdf", "FileContents": "<base64_data>" }
The attachment upload documentation mentions Content-Type headers but doesn’t clarify the multipart handling for binary files. We’ve tried various Content-Type combinations without success. The REST API error handling seems inconsistent-sometimes we get detailed validation messages, other times just generic 415 errors.
Has anyone successfully implemented attachment uploads through the supplier collaboration REST API? What’s the correct approach for handling binary file uploads with proper Content-Type headers?
Thanks for the pointer. So we need to switch from JSON to multipart/form-data entirely? Does that mean the metadata (filename, description) also goes in separate parts of the multipart body? I’m concerned about how this affects our existing framework which is built around JSON payloads.
Yes, multipart is required for binary attachments. However, you can still use JSON for metadata by creating a hybrid approach. Send the attachment metadata as JSON in one part and the file binary in another. This is actually more efficient than base64 encoding which inflates file size by about 33%. The REST API error handling improves significantly once you use the correct content type-you’ll get proper validation messages instead of generic 415 errors. Make sure your HTTP client library supports multipart requests natively.
We’ve refactored to use multipart/form-data but still getting 400 errors now instead of 415. Progress, I guess? The error message mentions “Invalid attachment metadata” but doesn’t specify what’s invalid. Are there required fields beyond FileName that we might be missing?
I ran into this exact issue last quarter. The problem is you’re sending the attachment as JSON payload when it should be multipart/form-data. Oracle Fusion REST API for attachments requires a different approach than standard JSON requests. You need to construct a multipart request with the file as binary data, not base64 encoded in JSON. The Content-Type header for the overall request should be multipart/form-data with a boundary parameter. Each part of the multipart body needs its own Content-Type declaration.
The 400 error usually indicates you’re close but missing required metadata fields. For supplier collaboration attachments, you typically need: FileName, Title, CategoryName, and DatatypeCode. The DatatypeCode is particularly important-it tells Oracle what type of attachment you’re uploading. Common values are ‘FILE’ for general documents or ‘WEB_PAGE’ for URLs. CategoryName must match predefined attachment categories in your Fusion instance.