409 conflict error is returned when running a PUT request towards the Qlik Sense Repository Service API.
Environments:
- Qlik Sense Enterprise for Windows
Parameter "modifiedDate" is stated as optional on the help site, however it is compulsory for PUT requests and optional for POST requests.
The parameter "modifiedDate" needs to be specified, it doesn't need to be the exact current time, just a time newer that the current time, the repository service will automatically update this to the correct time when it receives and validates the request.
Here is a PowerShell sample to update the Scheduler service settings:
$hdrs = @{}
$hdrs.Add("X-Qlik-xrfkey","12345678qwertyui")
$hdrs.Add("X-Qlik-User","UserDirectory=DOMAIN;UserId=Administrator")
$cert = Get-ChildItem -Path "Cert:\CurrentUser\My\" | Where {$_.Subject -like '*QlikClient*'}
$url = "https://qlikserver2.domain.local:4242/qrs/SchedulerService/befac0e7-047b-4f57-87c0-df9474321550?xrfkey=12345678qwertyui"
$body = '{"serverNodeConfiguration":{"name": "Central","hostName": "qlikserver2.domain.local","serviceCluster":{"name":"ServiceCluster"}},
"settings":{"logVerbosity":{"logVerbosityTaskExecution":1}},"modifiedDate":"2020-05-20T09:25:35.647Z"}'
Invoke-RestMethod -Uri $url -Method Put -Headers $hdrs -Certificate $cert -Body $body -ContentType 'application/json'