SSRS 2017 Subscription Rest error

Shaun Mosher 96 Reputation points
2020-10-26T16:10:44.253+00:00

I have PowerShell script to update Report subscriptions en masse. I'm trying to use the PATCH method. (https://app.swaggerhub.com/apis/microsoft-rs/SSRS/2.0#/Subscriptions/UpdateSubscription)
However I'm getting a HTTP 405 Method Not Allowed. What am I doing wrong?

Here is the Rest URL example:

$uri = 'http://localhost/reportserver/reports/api/v2.0/Subscriptions(f6b3ff9a-9844-4d11-a61b-d2bfc02c84f4)'
Invoke-RestMethod -Uri $uri -UseDefaultCredentials -ContentType 'application/json' -Method Patch -Body $Body

Here is the JSON Body:
{
"Id": "f6b3ff9a-9844-4d11-a61b-d2bfc02c84f4",
"ExtensionSettings": {
"ParameterValues": {
"Name": "pRegion",
"Value": "Atlantic",
"IsValueFieldReference": false
}
}
}

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,799 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,364 questions
0 comments No comments
{count} votes

Accepted answer
  1. Shaun Mosher 96 Reputation points
    2020-10-26T18:00:11.337+00:00

    I figured it out.
    First, the URL should be: http://localhost/reports/api/v2.0/Subscriptions(f6b3ff9a-9844-4d11-a61b-d2bfc02c84f4)

    Second, the body should be:

    {
    "Id": "96ad5f4e-da19-41a2-8fed-9929105b37a8",
    "ParameterValues": [
    {
    "Name": "pRegion",
    "Value": "Atlantic",
    "IsValueFieldReference": true
    }
    ]
    }

    0 comments No comments

0 additional answers

Sort by: Most helpful