<?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: Save (current) script via API with PATCH to /api/v1/apps/{id}/scripts/current in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Save-current-script-via-API-with-PATCH-to-api-v1-apps-id-scripts/m-p/2442404#M20384</link>
    <description>&lt;P&gt;Ok, I found something really confusing. I only get 200 OK, if I use (what I consider) a malformatted json..&lt;/P&gt;
&lt;P&gt;This gives 200 OK, note the semi-colon outside of the last json bracket...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[{ "op": "replace", "path": "/", "value": { "qScript": "///$tab Section\r\nNEW STUFF;"} };]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, this (without the last semi-colon) gives 500 INTERNAL ERROR:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[{ "op": "replace", "path": "/", "value": { "qScript": "///$tab Section\r\nNEW STUFF;"} } ]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That was a complete fluke, that I accidentally tried this.. but I can't explain it. &lt;/P&gt;
&lt;P&gt;None of the requests changes anything.&lt;/P&gt;
&lt;P&gt;Is my url correct? I'm just assuming that /current is what to put in for /{version} in the url, given that's what I use when using GET on /apps/id/scripts.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Apr 2024 06:52:47 GMT</pubDate>
    <dc:creator>StefanBackstrand</dc:creator>
    <dc:date>2024-04-18T06:52:47Z</dc:date>
    <item>
      <title>Save (current) script via API with PATCH to /api/v1/apps/{id}/scripts/current</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Save-current-script-via-API-with-PATCH-to-api-v1-apps-id-scripts/m-p/2442142#M20373</link>
      <description>&lt;P&gt;I'm trying to save a script in an app, via the REST API. However, everytime I do POST to /api/v1/apps/{id}/scripts ( ) it saves a new version of the script that shows up in the history. I would rather want to update the current script.&lt;/P&gt;
&lt;P&gt;So, using PATCH to api/v1/apps/{id}/scripts/current - but cannot get it to work. I'm getting a 200 but nothing changes. Docs: &lt;A href="https://qlik.dev/apis/rest/apps/#%23%2Fentries%2Fv1%2Fapps%2F-appId%2Fscripts%2F-version-patch" target="_blank" rel="noopener"&gt;https://qlik.dev/apis/rest/apps/#%23%2Fentries%2Fv1%2Fapps%2F-appId%2Fscripts%2F-version-patch&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This is the REST call definition of my call (wget):&lt;/P&gt;
&lt;DIV style="color: #000000; background-color: #fffffe; font-family: 'IBMPlexMono, Monaco, 'Courier New', monospace', Menlo, Monaco, 'Courier New', monospace; font-weight: normal; font-size: 12px; line-height: 18px; white-space: pre;"&gt;
&lt;DIV&gt;&lt;SPAN&gt;wget --no-check-certificate --quiet \&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; --method PATCH \&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; --timeout=&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt; \&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; --header &lt;/SPAN&gt;&lt;SPAN&gt;'Content-Type: text/plain'&lt;/SPAN&gt;&lt;SPAN&gt; \&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; --header &lt;/SPAN&gt;&lt;SPAN&gt;'Authorization: Bearer TOKEN_REDACTED'&lt;/SPAN&gt;&lt;SPAN&gt; \&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; --body-data &lt;/SPAN&gt;&lt;SPAN&gt;'{ "Op": "add", "Path": "/versionMessage", "Value": "MY NEW SCRIPT" };'&lt;/SPAN&gt;&lt;SPAN&gt; \&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;'&lt;A href="https://mytenant.eu.qlikcloud.com/api/v1/apps/45bfcace-d167-4861-a0d1-deb9123b1739/scripts/current" target="_blank" rel="noopener"&gt;https://mytenant.eu.qlikcloud.com/api/v1/apps/45bfcace-d167-4861-a0d1-deb9123b1739/scripts/current&lt;/A&gt;'&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried all kinds of syntax for the NxPatch structure in the body of the request, but cannot figure it out. I can't find any documentation of NxPatch and coming up short in my Devtools in browser. &lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 13:40:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Save-current-script-via-API-with-PATCH-to-api-v1-apps-id-scripts/m-p/2442142#M20373</guid>
      <dc:creator>StefanBackstrand</dc:creator>
      <dc:date>2024-04-17T13:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Save (current) script via API with PATCH to /api/v1/apps/{id}/scripts/current</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Save-current-script-via-API-with-PATCH-to-api-v1-apps-id-scripts/m-p/2442256#M20374</link>
      <description>&lt;P&gt;Try enclosing your body in brackets ([]). Example:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;.\curl.exe "https://&amp;lt;tenant&amp;gt;/api/v1/apps/&amp;lt;appid&amp;gt;/scripts/&amp;lt;scriptid&amp;gt;" -X PATCH -H "Authorization: Bearer &amp;lt;api key&amp;gt;" -H "Content-type: */*" -d '[{"op":"replace","path":"/versionMessage","value":"example3"}]'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like the docs mistakenly don't express that the body needs to be array not a set of objects.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 17:16:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Save-current-script-via-API-with-PATCH-to-api-v1-apps-id-scripts/m-p/2442256#M20374</guid>
      <dc:creator>Levi_Turner</dc:creator>
      <dc:date>2024-04-17T17:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Save (current) script via API with PATCH to /api/v1/apps/{id}/scripts/current</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Save-current-script-via-API-with-PATCH-to-api-v1-apps-id-scripts/m-p/2442396#M20383</link>
      <description>&lt;P&gt;Hey Levi!&lt;/P&gt;
&lt;P&gt;I did, but no change. I'm pretty sure the body content itself (NxPatch struct) is not in the right format to begin with. I'm i finding it hard to understand how it's supposed to be formatted. I've tried similar to these combinations:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[{ "op": "replace", "path": "/", "value": { "qScript": "///$tab Section\r\nNEW STUFF;"} };]

{ "Op": "replace", "Path": "/", "Value": { "qScript": "///$tab Section\r\nNEW STUFF;"} };

{ "Op": "replace", "Path": "/", "Value": "MY NEW SCRIPT" };&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;...and more. I just can't seem to get it to work..&lt;/P&gt;
&lt;P&gt;NxPatch does not provide any specific example: &lt;A href="https://qlik.dev/apis/rest/apps/#%23%2Fdefinitions%2FNxPatch" target="_blank" rel="noopener"&gt;https://qlik.dev/apis/rest/apps/#%23%2Fdefinitions%2FNxPatch&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;However, I'm pretty sure the operations are lowercase (or at least camelCase), given this: &lt;A href="https://qlik.dev/apis/rest/apps/#%23%2Fdefinitions%2FNxPatchOperationType" target="_blank" rel="noopener"&gt;https://qlik.dev/apis/rest/apps/#%23%2Fdefinitions%2FNxPatchOperationType&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 06:23:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Save-current-script-via-API-with-PATCH-to-api-v1-apps-id-scripts/m-p/2442396#M20383</guid>
      <dc:creator>StefanBackstrand</dc:creator>
      <dc:date>2024-04-18T06:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Save (current) script via API with PATCH to /api/v1/apps/{id}/scripts/current</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Save-current-script-via-API-with-PATCH-to-api-v1-apps-id-scripts/m-p/2442404#M20384</link>
      <description>&lt;P&gt;Ok, I found something really confusing. I only get 200 OK, if I use (what I consider) a malformatted json..&lt;/P&gt;
&lt;P&gt;This gives 200 OK, note the semi-colon outside of the last json bracket...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[{ "op": "replace", "path": "/", "value": { "qScript": "///$tab Section\r\nNEW STUFF;"} };]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, this (without the last semi-colon) gives 500 INTERNAL ERROR:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[{ "op": "replace", "path": "/", "value": { "qScript": "///$tab Section\r\nNEW STUFF;"} } ]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That was a complete fluke, that I accidentally tried this.. but I can't explain it. &lt;/P&gt;
&lt;P&gt;None of the requests changes anything.&lt;/P&gt;
&lt;P&gt;Is my url correct? I'm just assuming that /current is what to put in for /{version} in the url, given that's what I use when using GET on /apps/id/scripts.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 06:52:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Save-current-script-via-API-with-PATCH-to-api-v1-apps-id-scripts/m-p/2442404#M20384</guid>
      <dc:creator>StefanBackstrand</dc:creator>
      <dc:date>2024-04-18T06:52:47Z</dc:date>
    </item>
  </channel>
</rss>

