Alex
Alex

Reputation: 21

creating a report/catalog item using REST API in SSRS 2017

I am trying to create a report/catalog item using the SSRS REST APIs documented here.

I can successfully create folders and resources using the json:

{
"Name": "Test_Report",
"Description": "",
"Path": "MyFolder/Test_Report",
"Type": "ReportModel",
"Hidden": false,
"ModifiedBy": "User",
"CreatedBy": "User",
"ParentFolderId": null,
"IsFavorite": false,
"ContentType": null,
"Content": "" }

However when creating a report or catalog item, I am getting HTTP 500 or 400 errors like: this

My questions are:

  1. what should be the values for "ContentType" and "Content"
  2. In the server stub generated from the swaggerhub, the description for "Content" is:

A string value that contains binary encoding by base64url encoding rules

what does this mean exactly? and what should be the "ContentType" for this?

  1. Is there any other way to create a report or catalog item using the REST API?

Upvotes: 1

Views: 461

Answers (1)

Alex
Alex

Reputation: 21

Turns out it the issue is with Newtonsoft.Json.JsonConvert.SerializeObject() and HttpClient.PostAsync() methods.

Sending a request with Restsharp does the job

Upvotes: 1

Related Questions