Share via

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.

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

Answer accepted by question author

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
}
]
}

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.