locked
SSRS 2017 REST API - PUT method doesn't seems to be working RRS feed

  • Question

  • Hi - Has anyone tried SSRS 2017 rest api and was able to successfully make a api call using PUT method to update any of the report / folder property.

    I am able to successfully do a GET,POST, DELETE but not PUT, not sure if I am missing anything here.

    Any help !!


    sathya - My blog ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **.

    Saturday, May 30, 2020 12:51 PM

Answers

  • Thank you it worked by adding below highlighted to request header

    User-Agent: Fiddler
    Host: localhost
    Content-Type: application/json
    Content-Length: 42


    sathya - My blog ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **.

    Monday, June 1, 2020 10:31 AM

All replies

  • A REST API request/response pair can be separated into five components:

    The request URI, which consists of: {URI-scheme} :// {URI-host} / {resource-path} ? {query-string}. Although the request URI is included in the request message header, we call it out separately here because most languages or frameworks require you to pass it separately from the request message.

    URI scheme: Indicates the protocol used to transmit the request. For example, http or https.
    URI host: Specifies the domain name or IP address of the server where the REST service endpoint is hosted, such as myserver.contoso.com.
    Resource path: Specifies the resource or resource collection, which may include multiple segments used by the service in determining the selection of those resources. For example: CatalogItems(01234567-89ab-cdef-0123-456789abcdef)/Properties can be used to get the specified properties for the CatalogItem.
    Query string (optional): Provides additional simple parameters, such as the API version or resource selection criteria.
    HTTP request message header fields:

    A required HTTP method (also known as an operation or verb), which tells the service what type of operation you are requesting. Reporting Services REST APIs support DELETE, GET, HEAD, PUT, POST, and PATCH methods.
    Optional additional header fields, as required by the specified URI and HTTP method.
    Optional HTTP request message body fields, to support the URI and HTTP operation. For example, POST operations contain MIME-encoded objects that are passed as complex parameters. For POST or PUT operations, the MIME-encoding type for the body should be specified in the Content-type request header as well. Some services require you to use a specific MIME type, such as application/json.

    HTTP response message header fields:

    An HTTP status code, ranging from 2xx success codes to 4xx or 5xx error codes. Alternatively, a service-defined status code may be returned, as indicated in the API documentation.
    Optional additional header fields, as required to support the request's response, such as a Content-type response header.
    Optional HTTP response message body fields:

    MIME-encoded response objects are returned in the HTTP response body, such as a response from a GET method that is returning data. Typically, these objects are returned in a structured format such as JSON or XML, as indicated by the Content-type response header.
    Saturday, May 30, 2020 1:18 PM
  • Hi sathya,

    For POST or PUT operations, the MIME-encoding type for the body should be specified in the Content-type request header as well. Some services require you to use a specific MIME type, such as application/json.   

    For PUT method, you need to specify the Folder GUID ID (you can run a GET request to get the folder GUID) and the Properties element in the request. For example, the command takes the following format: http://localhost/Reports_SSRS/api/v2.0/Folders(d3b75510-fcd4-499e-81fa-deed5b416f4f)/Properties while the request body details take this format: [{"Name":"Description","Value":"Projects just for Scotts Tips"}]. 

    Below links will help:

    Develop with the REST APIs for Reporting Services

    SQL Server Reporting Services Rest API

    Hope it will help

    Best Regards

    Dawn


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, June 1, 2020 6:23 AM
  • Thank you it worked by adding below highlighted to request header

    User-Agent: Fiddler
    Host: localhost
    Content-Type: application/json
    Content-Length: 42


    sathya - My blog ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **.

    Monday, June 1, 2020 10:31 AM
  • Hi Sathya,

    Glad to hear that you solved the question.

    Could you please help mark the useful reply as answer? This can be beneficial to other community members finding and reading the thread easily. In addition, if you have another questions, please feel free to ask.
    Thanks for your contribution.

    Best Regards

    Dawn


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, June 2, 2020 12:59 AM