SSRS Rest API - Patch Method Not Working

robert gama 1 Reputation point
2021-02-03T22:50:06.463+00:00

I am trying to make a call to /Subscription as Patch. https://app.swaggerhub.com/apis/microsoft-rs/SSRS/2.0#/Subscriptions/UpdateSubscription

The description of the call states that "Definition of the Subscription that updates the current item on the server. It is only necessary to include properties to be updated. All other property values will be left unchanged."

so my call is being made to http://localhost/reports/api/v2.0/Subscriptions(2615574b-ed92-4c5f-876b-3b33e6428379)
and the body im testing with is

{  
    "Id": "2615574b-ed92-4c5f-876b-3b33e6428379",
    "Description": "Edited Subscription"
}

to test the patch call to change the description field. I get a 204 returned, which is successful call.
However there are no changes made to the subscription when I look at it?

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,951 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ZoeHui-MSFT 38,626 Reputation points
    2021-02-04T06:29:24.763+00:00

    Hi @robert gama ,

    Please use powershell to change the parameter for a try like below.

    $jsonSubParameters=
    '
    {
    "Id": "12c53503-8a9c-4bf3-a7fa-c906ce6c8830",
    "ParameterValues": [
    {
    "Name": "Parameter1",
    "Value": "test1",
    "IsValueFieldReference": true
    },
    {
    "Name": "Parameter2",
    "Value": "test2",
    "IsValueFieldReference": true
    },
    {
    "Name": "Parameter3",
    "Value": "test3",
    "IsValueFieldReference": true
    }
    ]
    }
    '
    Invoke-RestMethod "http://reportserver/reports/api/v2.0/Subscriptions(12c53503-8a9c-4bf3-a7fa-c906ad6c8830)" -Method patch -body $jsonSubParameters -UseDefaultCredentials -ContentType 'application/json'

    A tool for testing HTTP request/response messages is Fiddler. Fiddler is a free web debugging proxy that can intercept your REST requests, making it easy to diagnose the HTTP request/ response messages.

    Regards,
    Zoe


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    What can I do if my transaction log is full?--- Hot issues November

    How to convert Profiler trace into a SQL Server table -- Hot issues November


Your answer

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