I am working on helpshift api and trying to find an accurate request call that will return an the Issue metadata. I have tried many examples but it always returns 401 status.
However I was able to get the curl command to work
Things provided to me is : apikey, url, and return is json response
the working CURL command is :
curl -X GET --header 'Accept: application/json' --header 'Authorization: Basic <base64_encoded_version_of_api_key_for_basic_auth>' '<helpshift_url>'
The things I have tried are as follow:
>>> api_key = "ABCDEFGH"
>>> issue = '<helpshift_url>'
>>>
>>> r = requests.get( issue, auth = ( api,"" ))
>>> r.status_code
401
>>>
>>> import base64
>>> api_new = base64.b64encode(api_key.encode("UTF-8"))
>>>
>>> r = requests.get( issue, auth = ( api_new,"" ))
>>> r.status_code
401
what I am trying to get is json response printed