Unable to retrieve the members of an organization

Hi,
I am trying to retrieve the organisation members but I am getting the error ConnectionRefusedError: [Errno 61] Connection refused

Below is the code to retrieve the organisation members,

def get_users(mgmt_access_token,org_id,my_tenant):

conn = http.client.HTTPSConnection("")

headers = {"authorization": f"Bearer {mgmt_access_token}"}

conn.request(
    "GET",
    f"/{my_tenant}.us.auth0.com/api/v2/organizations/{org_id}/members",
    headers=headers,
)

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

return data.decode("utf-8")

Thank you in advance.

Hi @rami.reddy ,

Welcome to the Auth0 Community!

I searched the error on our community and found this topic. The solution is adding Auth0_domain in the connection.

connection = http.client.HTTPSConnection(AUTH0_DOMAIN)

Do you want to give it a try?

Thank you so much for your reply, I am not getting the error now. but I am receiving Not Found, no data is getting recieved

Found the fix. Thank you.

@rami.reddy , could you please share the solution/fix with our community? Thanks!