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

This widget could not be displayed.

Solved:

For anyone who is looking for a solution

 

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

 use 

This widget could not be displayed.

 

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

135 views 2 0
Join discussion

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