How can I get/update the DataSource linked to a SSRS Subscripton via API 2.0?

Kalata, Wesley 0 Reputation points
2024-07-25T18:38:09.8266667+00:00

I have a subscription that has its data source connection severed every time I update the source report (the subscription is on a linked report).

I want to get the DataSource so that I can verify it exists and then reassociate it to the subscription.

If I run the following command:

$targetSubscriptionID='xxx'

$checkSubscriptionURI = "http://localhost/reports/api/v2.0/subscriptions($targetSubscriptionID)

$checkSubscriptionResponse = Invoke-RestMethod -Uri $checkSubscriptionURI -Method GET -Credential $creds -ContentType 'application/json'

I get everything EXCEPT the DataSource linked to the subscription....

$checkSubscriptionResponse

 

@odata.context                 : `http://localhost/reports/api/v2.0/$metadata#Subscriptions/$entity`

Id                             : xxx

Owner                          : xx

IsDataDriven                   : True

Description                    : DailyGeneration

Report                         : /Reports/ReportLetterDaily

IsActive                       : True

EventType                      : TimedSubscription

Schedule                       : @{ScheduleID=; Definition=}

ScheduleDescription            :

LastRunTime                    : xxx

LastStatus                     : Done: 0 processed of 0 total; 0 errors.

DataQuery                      : @{CommandText=XXX; Timeout=300}

ExtensionSettings              : @{Extension=Report Server FileShare; ParameterValues=System.Object[]}

DeliveryExtension              : Report Server FileShare

LocalizedDeliveryExtensionName :

ModifiedBy                     : xxx

ModifiedDate                   : 2024-07-24T21:34:56.223-04:00

ParameterValues                : {@...}

How do I get the DataSource? How can I update to reassociate?

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,878 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,331 questions
0 comments No comments
{count} votes