I am facing issue while exporting the file using Rest api it is not giving the exact file what we are exporting manually. please find the command which we are using powershell
$ExportResponse = Invoke-RestMethod -uri "https://qlikmanagerlab.cnppd.lab/attunityenterprisemanager/api/v1/servers/qlikreplicatelab/tasks/DB2..." -Headers $export_headers -Method 'GET' | ConvertTo-JSON | Set-Content "C:\Users\xt28034\Documents\sample1.json"
please find the attachment output of the sample1.json file
kindly help me on this issue
Hey @rsuresh
Thank you for reaching out to the Community.
Are you trying to download the task json file as you would using the "Export Task" button in the Replicate UI?
Here is a community article outlining the steps:
Example:
repctl -d "C:\Program Files\Attunity\Replicate\data" exportrepository task=postie_test_PK include_server_settings=TRUE
Output:
C:\Program Files\Attunity\Replicate\bin>repctl -d "C:\Program Files\Attunity\Replicate\data" exportrepository task=postie_test_PK include_server_settings=TRUE
command exportrepository response:
{
"message": "Export succeeded",
"file_path": "C:\\Program Files\\Attunity\\Replicate\\data\\imports\\postie_test_PK.json"
}
[exportrepository command] Succeeded
Please let us know if you have any additional questions.
Best,
Kelly
Why do you have ConvertTo-JSON in the pipeline?
Per documentation the response is already a JSON stream.
Try again without.
Hein.
Hi @rsuresh
Please note that I have moved the question to the Qlik Replicate community as you are more likely to get an answer here.
Hey @rsuresh
Thank you for reaching out to the Community.
Are you trying to download the task json file as you would using the "Export Task" button in the Replicate UI?
Here is a community article outlining the steps:
Example:
repctl -d "C:\Program Files\Attunity\Replicate\data" exportrepository task=postie_test_PK include_server_settings=TRUE
Output:
C:\Program Files\Attunity\Replicate\bin>repctl -d "C:\Program Files\Attunity\Replicate\data" exportrepository task=postie_test_PK include_server_settings=TRUE
command exportrepository response:
{
"message": "Export succeeded",
"file_path": "C:\\Program Files\\Attunity\\Replicate\\data\\imports\\postie_test_PK.json"
}
[exportrepository command] Succeeded
Please let us know if you have any additional questions.
Best,
Kelly
Why do you have ConvertTo-JSON in the pipeline?
Per documentation the response is already a JSON stream.
Try again without.
Hein.