Fisheye rest status code 403

 

Hello

I have generated authentication token and able to make REST calls from my browser and get response.

Now I am trying to make the same thing work from my python program and I get status code 403

Why is it forbidden?

when I tried both user/pass and token combinations as shown below.

Please let me know.

 

import requests

print "hello world"
# r = requests.get("http://myfisheye:2003",auth=("myuser","mypass"))
# r = requests.get("http://myfisheye:2003/rest-service-fecru/admin/groups?FEAUTH=myuser:1:xxxx50713b31b7859c9c0cd6f19e4568b372e992")
r = requests.get("http://myfisheye:2003/rest-service-fecru/admin/repositories?FEAUTH=modha.k:1:xxxx50713b31b7859c9c0cd6f19e4568b372e992")
print r.status_code

 

Thanks

Abe

2 answers

1 accepted

Solved:

For anyone who is looking for a solution

 

/rest-service-fecru/auth/login
in conn.request.

 use 

 

I have tried this varient

 

import httplib
import urllib


conn = httplib.HTTPConnection("myfisheye:2003")
args = urllib.urlencode({'userName':'myuser', 'password':'mypassword'})
#args = urllib.urlencode({'FEAUTH':'myuser:1:xxxx50713b31b7859c9c0cd6f19e4568b372e992'})
headers = {'Accept':'application/json'}
r1 = conn.request("post","/rest-service/auth/login",args,headers)

#conn.request("get","/rest-service-fecru/admin/groups",args,headers)
r2 = conn.getresponse()
print r1,r2.status,r2.reason,r2






Got this as response:
====================
/home/myuser/env3/bin/python /home/modha.k/PycharmProjects/mysample/test.py
None 404 Crucible is not enabled <httplib.HTTPResponse instance at 0xc29248>
hello world

Process finished with exit code 0

 

 

I have also added IPAddress of fisheye in Jira user server.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

581 views 6 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you