Hello Everyone,
Is it possible to disable/enable the schedule of report via API endpoint. I was able to connect to Cognos server and get items of report using Gateway/v1/content/<OBJECT ID>/items. From there I took scheduleID value and used here Gateway/v1/content/<SCHEDULE ID>/items, but this didn't give any result. If you can give any suggestions about this, that would be great.
Here is t he code I'm using:
$headers = @{
"IBM-BA-Authorization" = "Generated_API_KEY"
"Content-Type" = "application/json"
}
$body = "{
`n `"parameters`": [
`n {
`n `"name`": `"CAMNamespace`",
`n `"value`": `"<Our_Namespace>`"
`n },
`n {
`n `"name`": `"CAMUsername`",
`n `"value`": `"<UserName>`"
`n },
`n {
`n `"name`": `"CAMPassword`",
`n `"value`": `"<Password>`"
`n }
`n ]
`n}'"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$response = Invoke-RestMethod 'https://<cognos_server_url>/api/v1/session' -Method 'PUT' -Headers $headers -Body $body
$response | ConvertTo-Json
$NewAuthorization=$response.session_key
$newheaders = @{
"IBM-BA-Authorization" = "$NewAuthorization"
"Content-Type" = "application/json"
}
$response1 = Invoke-RestMethod 'https://<cognos_server_url>/api/v1/content/<ScheduleID>/items' -Method 'GET' -Headers $newheaders
$response1 | ConvertTo-Json
Write-Host $response1
![](https://dw1.s81c.com//IMWUC/MessageImages/63dba680a85b498fb378229149f4af47.png)
Thank you
------------------------------
Bek Ibragimov
------------------------------