Auth0 Home Blog Docs

Object didn’t pass validation format user id


#1

Does anyone know how to fix error 401 when I use the api to call the get user profile endpoint?

It says error 401 invaild_uri

The url is https://violetwears.auth0.com/api/v2/users/13119283746

I’m new to this and need help on fixing this error.


#2

can you explain more of what you want to do and how are you doing it? The endpoint you mentioned require the authentication header to be present etc. How are you creating the management client to call this url?


#3

I hope this helps.

I am following the steps on this page. I am trying to get the full user profile to extract IdP access token for facebook:
https://auth0.com/docs/connections/calling-an-external-idp-api

I am at step two on this page. I am clicking on the Get a user endpoint of the management api :https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id

This is where I am getting stuck. Everytime I try to call the get a full user endpoint the response comes back as an invalid_uri


#4

Are you providing the authorization token as mentioned here?
image


#5

Yes but I am using python.


#6

Can you share a code snippet you’re using?


#7

import http.client

conn = http.client.HTTPSConnection("")

headers = { ‘authorization’: “Bearer YOUR_ACCESS_TOKEN” }

conn.request(“GET”, “/violetwears.auth0.com/api/v2/users/USER_ID”, headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode(“utf-8”))

That’s what I am typing. Not sure if that’s correct.


#8

where are you getting YOUR_ACCESS_TOKEN from?


#9

From here: https://manage.auth0.com/#/apis/5af66bd868d9444fbbaf8022/test/C1J0HmkyVYfoBAsW2MRIXvCR4XyuTWb4


#10

Can you try with regular curl to make sure it works? Are you regenerating the token each time? It might be that the token is expired.


#11

Yes I have regenerated the token. But I will try with curl.


#12

I am using this curl command but I keep getting an error.
curl --request GET
–url ‘https://violetwears.auth0.com/api/v2/users/USER_ID
–header ‘authorization: Bearer YOUR_ACCESS_TOKEN’

The error says curl: (6) could not resolve host
curl: (1) protocol " 'https" not supported or disabled in libcurl


#13

https://curl.haxx.se/docs/faq.html#curl_1_SSL_is_disabled_https