How can I get 'Reports To' attribute from domo people?

Best Answer

  • ArborRose
    ArborRose Coach
    Answer ✓

    One way you might be able to get it would be through the Domo API using Python.

    import requests

    Set up authentication

    headers = {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
    }

    Make API request to retrieve user profile

    response = requests.get('https://api.domo.com/v1/users', headers=headers)

    Check if request was successful

    if response.status_code == 200:
    # Extract "Reports To" field from the response
    user_profiles = response.json().get('users', [])
    for user_profile in user_profiles:
    reports_to = user_profile.get('companyDetails', {}).get('reportsTo', 'N/A')
    print(f"User: {user_profile['name']}, Reports To: {reports_to}")
    else:
    print(f"Error: {response.status_code}")

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

Answers

  • ArborRose
    ArborRose Coach
    Answer ✓

    One way you might be able to get it would be through the Domo API using Python.

    import requests

    Set up authentication

    headers = {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
    }

    Make API request to retrieve user profile

    response = requests.get('https://api.domo.com/v1/users', headers=headers)

    Check if request was successful

    if response.status_code == 200:
    # Extract "Reports To" field from the response
    user_profiles = response.json().get('users', [])
    for user_profile in user_profiles:
    reports_to = user_profile.get('companyDetails', {}).get('reportsTo', 'N/A')
    print(f"User: {user_profile['name']}, Reports To: {reports_to}")
    else:
    print(f"Error: {response.status_code}")

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

  • dmurgit1
    dmurgit1 Contributor

    Thank you. So not straight forward as the other attributes. Why is that?

  • That's a question for Domo. Possibly someone else can comment with another way.

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **