Forum Discussion
pdbenbow
8 years agoResolver II
Report Server REST API - PUT method failing
Power BI report server version 1.1.6514.9163 (October 2017) I'm writing a Python app to interact with the REST API. I'm pretty new to OData and REST, and so far I've successfully called several G...
Anonymous
7 years agoNot applicable
Hi pdbenbow
Did you resolve this?
I seem to encounter the same issue on our report server when trying to update connectionstring in an embedded datasource. The get request works as expected.
Server Version 1.5.7074.36177 (May 2019)
This is the code I´m using and getting 400 Bad request.
Any ideas?
import json
import requests
from requests_negotiate_sspi import HttpNegotiateAuth
uri = 'http://###/api/v2.0/PowerBiReports(0d78ce2d-35a4-424a-8c4a-42556b91776c)/DataSources'
payload = {'ConnectionString': 'data source=###;initial catalog=###;persist security info=false'}
headers = {'Content-type': 'application/json'}
r = requests.patch(uri, auth=HttpNegotiateAuth(), json=payload, headers=headers)
#r = requests.get(uri, auth=HttpNegotiateAuth())
print(r.status_code)
print(r.content)
print(r.headers)
print(r.json)
pdbenbow
7 years agoResolver II
I never attempted to resolve the issue because this was not a high-priority project for me. I haven't tried any of the suggestions offered by other users, but there's probably some good advice there if you want to try to resolve it.