I have a python app that i am building that needs to delete and upload images to SSRS.
The issue i have is to authenticate against the ssrs api the documentation says i should specify username, password and domain and should get a token back.
For some reason i keep getting 401 or 400 error when i try to generate a session.
i am using the api documentation here: https://app.swaggerhub.com/apis/microsoft-rs/SSRS/2.0#/Session/CreateSession
Here is the part of my code that will not authenticate i have no idea why
user = ''
pwd = ''
domain = ''
report_url = ''import requests
import json
class ssrs():def __init__(self,Org,user,pwd):self.org = Orgself.user = userself.pwd = pwdself.verifcationErrors = []def authorize(self):try:self.url = f"http://{self.org}/reports/api/v2.0/Session"self.payload = json.dumps({"username": f"{self.user}","password": f"{self.pwd}"})self.header = {'Content-Type': 'application/json', 'Accept': 'application/json'}self.response = requests.request("POST", self.url, headers=self.header, auth=self.payload)return self.response.status_codeexcept Exception as e:return evar = ssrs(Org=report_url,user=user, pwd = pwd).authorize()
print(var)
Looking for some help on others that have been able to successfully connect to ssrs and run rest api commands
pd: i also tried using
from requests_negotiate_sspi import HttpNegotiateAuth
auth=HttpNegotiateAuth()
to provide credentials and it didn't work either