Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now

QRS API: Remove/delete a file from a content library (PowerShell)

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Joseph_Musekura
Support
Support

QRS API: Remove/delete a file from a content library (PowerShell)

Last Update:

May 10, 2022 3:01:03 PM

Updated By:

Jamie_Gregory

Created date:

Mar 6, 2021 9:05:13 AM

The article upload a file to a content library demonstrates how to add a file to content library.

As opposite, the code-extract below provides a way to remove a file from a content library using PowerShell (check  Qlik Community for alternative api).

Example: using "deletecontent" to remove image "flagB.png" from "Default" in content library.

 

 

# use deletecontent o remove image
    $img = "flagB.png"
    $hdrs = @{}
    $hdrs.Add("X-Qlik-xrfkey","12345678qwertyui")
    $url = "https://qlikserver1.domain.local/qrs/contentlibrary/Default/deletecontent?externalpath=$($img)&xrfkey=12345678qwertyui"
    Invoke-RestMethod  -WebSession $session -UseDefaultCredentials -Uri $url -Method Delete -Headers $hdrs  

 

 

 

Environment

Labels (2)
Version history
Last update:
‎2022-05-10 03:01 PM
Updated by: