AdobeDocs/analytics-2.0-apis

404 Error from /users/me

Closed this issue · 2 comments

Hi All,

I am getting a 404 error each time I call the get_users_me function (also in Postman)

File "...\Anaconda3\lib\site-packages\requests\models.py", line 910, in json
return complexjson.loads(self.text, **kwargs)

File "...\Anaconda3\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)

File "...\Anaconda3\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())

File "...\Anaconda3\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None

JSONDecodeError: Expecting value

JSONDecodeError: [Errno Expecting value]

<title>404 Not Found</title>

404 Not Found


openresty : 0

This fixed it for me:

def get_users_me(config, global_company_id, access_token):
response = requests.get(
"{}/api/{}/users/me".format(config["analyticsapiurl"], global_company_id),
headers={
"Authorization": "Bearer {}".format(access_token),
"x-api-key": config["apikey"],
"global_company_id": config["globalcompanyid"]
}
)
return response.json()

Adding the NUMERIC value of the global company ID worked