
Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Qlik Sense ODAG API: How to create ODAG links (PowerShell)
Last Update:
Sep 14, 2023 3:20:36 AM
Updated By:
Created date:
Jun 8, 2020 10:21:30 AM
This is a sample to create ODAG links with the ODAG API using PowerShell.
Environment
Qlik Sense Enterprise on Windows
Sample using JWT authentication:
$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'
Sample using ticket authentication:
#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'
Sample using certificates:
$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
2,318 Views
Comments

Contributor II
2023-11-07
07:30 AM
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
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?