I am working with magento's REST API. I am trying to add a product to cart and uploading a non image file as product's custom attribute (after converting the file content to base64) but its not working , The API send an error "The image content must be valid base64 encoded data." If I upload an image it works fine, but my end goal is to upload different formats like pdf, txt etc. Does the API support uploading of non image file formats via API ?
Request Body
{
"cartItem": {
"sku": "test-product",
"qty": 1,
"quote_id": "199",
"product_option": {
"extension_attributes": {
"customOptions": [
{
"optionId": "1925",
"optionValue": "file",
"extensionAttributes": {
"fileInfo": {
"base64EncodedData": "SGVsbG8=",
"type": "Text",
"name": "text.txt"
}
}
}
]
}
}
}
}