<?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 Re: Not authorized for REST API command in ONTAP Rest API Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Not-authorized-for-REST-API-command/m-p/438008#M364</link>
    <description>&lt;P&gt;Are you using a LIF that belongs to vs1.example.com to access the API? Did you try the same pattern with some other API (unrelated to snaplock) as a test and see if that allowed access?&lt;/P&gt;</description>
    <pubDate>Tue, 06 Sep 2022 12:31:07 GMT</pubDate>
    <dc:creator>RobertBlackhart</dc:creator>
    <dc:date>2022-09-06T12:31:07Z</dc:date>
    <item>
      <title>Not authorized for REST API command</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Not-authorized-for-REST-API-command/m-p/437950#M363</link>
      <description>&lt;P&gt;We are currently trying to use the REST webservice to get and adjust the retention time of a document, but always get the response that the user isn't authorized for that command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We started by creating a role on our vserver like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;security login rest-role create -role snaplockall -api /api/storage/snaplock  -access all -vserver vs1.example.com&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We called that role "snaplockall" and it looks like this in the GUI:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="grafik.png" style="width: 605px;"&gt;&lt;img src="https://community.netapp.com/t5/image/serverpage/image-id/24268i9D82738AF5A60568/image-size/large?v=v2&amp;amp;px=999" role="button" title="grafik.png" alt="grafik.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We then assigned the role as a HTTP-role to a newly created user called "snaplocktest" and gave a password to the user.&lt;/P&gt;&lt;P&gt;With that user we are trying a GET method on:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/storage/snaplock/file/{volume.uuid}/{path}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and always get&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "error": {
    "message": "not authorized for that command",
    "code": "6"
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are we missing a role or is there anything else we could try?&lt;/P&gt;&lt;P&gt;EDIT: We are using ONTAP Verison 9.7&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 09:57:01 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Not-authorized-for-REST-API-command/m-p/437950#M363</guid>
      <dc:creator>tmkhrg</dc:creator>
      <dc:date>2025-06-04T09:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: Not authorized for REST API command</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Not-authorized-for-REST-API-command/m-p/438008#M364</link>
      <description>&lt;P&gt;Are you using a LIF that belongs to vs1.example.com to access the API? Did you try the same pattern with some other API (unrelated to snaplock) as a test and see if that allowed access?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 12:31:07 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Not-authorized-for-REST-API-command/m-p/438008#M364</guid>
      <dc:creator>RobertBlackhart</dc:creator>
      <dc:date>2022-09-06T12:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Not authorized for REST API command</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Not-authorized-for-REST-API-command/m-p/438043#M365</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/83550"&gt;@RobertBlackhart&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Are you using a LIF that belongs to vs1.example.com to access the API? Did you try the same pattern with some other API (unrelated to snaplock) as a test and see if that allowed access?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes, we do.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/83550"&gt;@RobertBlackhart&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Are you using a LIF that belongs to vs1.example.com to access the API? Did you try the same pattern with some other API (unrelated to snaplock) as a test and see if that allowed access?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I just tried "/api/security/roles" and get the same message. Even if I just try "/api" I get that message.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 09:34:03 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Not-authorized-for-REST-API-command/m-p/438043#M365</guid>
      <dc:creator>tmkhrg</dc:creator>
      <dc:date>2022-09-07T09:34:03Z</dc:date>
    </item>
  </channel>
</rss>

