Adds an attachment to a document.
POST <webiURL>/documents/{documentId}/attachments
Where:
Request type: multipart/form-data
Request body:
--------------------####boundary123456798 Content-Disposition: form-data; name=""attachmentInfos"" Content-Type: application/xml <attachment> <name>sales_report</name> <mimeType>image/png</mimeType> <!--Optional--> <size>123</size> </attachment> --------------------####boundary123456798 Content-Disposition: form-data; name=""attachmentContent""; filename=""logo_picture.png"" Content-Type: image/png (Content of file) --------------------####boundary123456798
The multipart body request allows at least two parts:
In case of image upload, the mime types accepted are the following:
Response type: application/xml or application/json
The response is a message stating the success or failure of the request.
CURL command:
curl -i -X "POST" -H "accept:application/xml" -H "content-type:multipart/form-data" -H X-SAP-LogonToken:"""%tokenValue%""" -d "@attachment.xml" "<webiURL>/documents/3422/attachments"
Request body:
<attachment> <mimeType>image/png</mimeType> <name>myResourceName</name> <description>myResourceDescription</description> </attachment>
Response:
<success> <message>The resource of type "Attachment" has been successfully created.</message> <id>9994</id> </success>