Title: Dynamics 365 SSRS Report generated as an Excel document via a WebAPI call
Tags: c#;reporting-services;dynamics-crm;microsoft-dynamics
Question: We are currently using an SSRS report that connects to Azure Devops on site. We have an application that downloads the SSRS report via a call to the SSRS report server, this call has all the parameters filled in and just requests a file in the format selected (PDF or Excel).
We're now moving over to Dynamics 365 Online and are using a similar SSRS report that is uploaded into Dynamics 365 Online. The report works fine and I can download the report in the formats I need when I use the front-end provided by Dynamics 365, but I can't seem to download this report via a Web API call from a project that integrates with Dynamics 365
What I have found so far is a post on a Microsoft forum stating that I would need to simulate a user trying to access the front-end via a browser by signing in and doing a HTTP Get on the report URL.
The reason the above needs to happen is because in order for me to download the report I need a session ID and a ControlID which gets passed into the response of that API call. This is unfortunately the call that fails with no real details about the error. The closest to a real error I've gotten is &quot;You () only have SDK access to this organization. You don't have the necessary privileges to view, create, edit, or delete data&quot;. I'm not logging in as a user on Dynamics 365, I'm logging in as an integration within the organization. I'm using a ClientId, TenantId, and Client Secret to generate a token.
Is there a better way to generate this report? Or should I just try and get around the SDK access error I'm getting by creating a dummy user that has access to the data that is needed for this report? My current approach feels very hacky and I'd prefer using something that is made for this instead



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2022:00:01/29/22', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<c#><reporting-services><dynamics-crm><microsoft-dynamics>', 'Title': 'Dynamics 365 SSRS Report generated as an Excel document via a WebAPI call', 'ViewCount': 259, 'id': 70901607, 'user_AboutMe': None, 'user_AccountId': 24088853.0, 'user_DisplayName': 'Deon Du Preez', 'user_Reputation': 1.0, 'user_Views': 2.0, 'user_id': 18062417.0}}