<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Write File to netapp using rest api in ONTAP Rest API Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Write-File-to-netapp-using-rest-api/m-p/457428#M709</link>
    <description>&lt;P&gt;I am currently migrating our old code accessing netapp using ontap and replacing it by using REST.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to write a file to netapp using POSTMAN by calling the following URL (http method POST):&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://ms-netapp.m-s.ch/api/storage/volumes/{volumeid}/files/{path}" target="_blank" rel="noopener"&gt;https://ms-netapp.m-s.ch/api/storage/volumes/{volumeid}/files/{path}&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My content type is multipart-formdata and I have two elements in it&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;first element: Json with the following content.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;"target": "Test",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;"is_empty": "",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;"name": "Test.pdf",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;"path": "TestPH",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;"type": "file"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;second element: my actual file&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;this leads to an http-400 error without further information about the cause. The funny thing about it is, that if I remove the second element, it creates a file that contains the submitted json.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried to implement the api using the following information: &lt;A href="https://docs.netapp.com/us-en/ontap-restapi-9121/ontap/swagger-ui/index.html#/storage/file_info_create" target="_blank" rel="noopener"&gt;https://docs.netapp.com/us-en/ontap-restapi-9121/ontap/swagger-ui/index.html#/storage/file_info_create&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Dec 2024 14:32:48 GMT</pubDate>
    <dc:creator>Philippschumacher</dc:creator>
    <dc:date>2024-12-17T14:32:48Z</dc:date>
    <item>
      <title>Write File to netapp using rest api</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Write-File-to-netapp-using-rest-api/m-p/457428#M709</link>
      <description>&lt;P&gt;I am currently migrating our old code accessing netapp using ontap and replacing it by using REST.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to write a file to netapp using POSTMAN by calling the following URL (http method POST):&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://ms-netapp.m-s.ch/api/storage/volumes/{volumeid}/files/{path}" target="_blank" rel="noopener"&gt;https://ms-netapp.m-s.ch/api/storage/volumes/{volumeid}/files/{path}&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My content type is multipart-formdata and I have two elements in it&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;first element: Json with the following content.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;"target": "Test",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;"is_empty": "",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;"name": "Test.pdf",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;"path": "TestPH",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;"type": "file"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;second element: my actual file&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;this leads to an http-400 error without further information about the cause. The funny thing about it is, that if I remove the second element, it creates a file that contains the submitted json.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried to implement the api using the following information: &lt;A href="https://docs.netapp.com/us-en/ontap-restapi-9121/ontap/swagger-ui/index.html#/storage/file_info_create" target="_blank" rel="noopener"&gt;https://docs.netapp.com/us-en/ontap-restapi-9121/ontap/swagger-ui/index.html#/storage/file_info_create&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 14:32:48 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Write-File-to-netapp-using-rest-api/m-p/457428#M709</guid>
      <dc:creator>Philippschumacher</dc:creator>
      <dc:date>2024-12-17T14:32:48Z</dc:date>
    </item>
  </channel>
</rss>

