Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Sep 14, 2023 3:20:36 AM
Jun 8, 2020 10:21:30 AM
This is a sample to create ODAG links with the ODAG API using PowerShell.
Qlik Sense Enterprise on Windows
$body = '{"name": "ODAGLink",
"selectionApp": "67a7d998-fdcb-414f-9049-7b6350234b9d",
"templateApp": "13617037-cfa5-4205-93a7-87aac10c1676",
"rowEstExpr": "Count(Dim1)",
"properties": {
"rowEstRange": [
{
"context": "*",
"highBound": 100000
}]
}
}'
$hdrs = @{}
$hdrs.Add("X-Qlik-xrfkey","12345678qwertyui")
$hdrs.Add("Authorization","Bearer eyJhbGciOi...GYyMdkVoQLxRFYP7r7mLbGaamCwUIApcHtUc7b3LEg")
$url = "https://qlikserver1.domain.local/jwt/api/odag/v1/links?xrfkey=12345678qwertyui"
Invoke-RestMethod -Uri $url -Method Post -Headers $hdrs -Body $body -ContentType 'application/json'
#Paste the ticket here
$ticket='5PEtidGu2GjhLn2k'
$body = '{"name": "ODAGLink",
"selectionApp": "67a7d998-fdcb-414f-9049-7b6350234b9d",
"templateApp": "13617037-cfa5-4205-93a7-87aac10c1676",
"rowEstExpr": "Count(Dim1)",
"properties": {
"rowEstRange": [
{
"context": "*",
"highBound": 100000
}]
}
}'
$hdrs = @{}
$hdrs.Add("X-Qlik-xrfkey","12345678qwertyui")
$url = "https://qlikserver1.domain.local/api/odag/v1/links?qlikticket="+$ticket
Invoke-RestMethod -Uri $url -Method Post -Headers $hdrs -Body $body -ContentType 'application/json'
$body = '{"name": "ODAGLink",
"selectionApp": "67a7d998-fdcb-414f-9049-7b6350234b9d",
"templateApp": "13617037-cfa5-4205-93a7-87aac10c1676",
"rowEstExpr": "Count(Dim1)",
"properties": {
"rowEstRange": [
{
"context": "*",
"highBound": 100000
}]
}
}'
$hdrs = @{}
$hdrs.Add("X-Qlik-User","UserDirectory=DOMAIN;UserId=Administrator")
$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
$url = "https://qlikserver1.domain.local:9098/v1/links"
Invoke-RestMethod -Uri $url -Method Post -Headers $hdrs -Body $body -ContentType 'application/json' -Certificate $cert
I have been using your code, and it appears that the odag apps are being made but nothing visually is appearing in the apps, how do I make it so that the button for app generation is also made, it just seems that the objects are being made in the QRS/backend but not appearing in the front?