Hi, I tried to log in to My RT account and tried to get my account details using API from my python script. I am adding the python code below
url = “http://rt.reflectionsinfo.com/?user=” + username + “&pass=” + password
payload = “”
headers = {
‘Cookie’: ‘RT_SID_rt.reflectionsinfo.com.80=fc2116343824f888681d9261d0fea3f1’,
‘Content-Type’: ‘text/plain’
}
response = requests.request(“POST”, url, headers=headers, data=payload, verify=False)
This is my login API and it’s working fine. After login I tried to get my user details using following API
url = “https://rt.reflectionsinfo.com//REST/1.0/user/”+username
payload = {}
headers = {
‘Cookie’: ‘RT_SID_rt.reflectionsinfo.com.80=fc2116343824f888681d9261d0fea3f1’
}
response = requests.request(“GET”, url, headers=headers, data=payload, verify = False)
Here I am getting the response that “Credentials Needed”. But I already log in using my credentials.
So I tried one more time from POSTMAN using login API and using the new cookie got from the postman into the URL to get user details. Now it’s working. Why this happened. Can’t we directly login from our python code and get the user details using the API. Can Someone please help me?