GET users endpoint returns 200 but the user list is empty

新規投稿

コメント

1件のコメント

  • Rui Barbosa

    Hi,

    Trying using the manage_managed users:

    curl --location 'https://api.box.com/oauth2/token' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data-urlencode 'grant_type=client_credentials' \
    --data-urlencode 'client_id=h...qi' \
    --data-urlencode 'client_secret=T...38' \
    --data-urlencode 'box_subject_type=enterprise' \
    --data-urlencode 'box_subject_id=877840855' \
    --data-urlencode 'scope=manage_managed_users'

    I get a token, not an error:

    {
    "access_token": "W...j",
    "expires_in": 4303,
    "restricted_to": [],
    "token_type": "bearer"
    }

    Was there any other detail on the "unsupported scope" error message. Could it be you are asking for multiple scope and some other is unsupported?

    For example:

    curl --location 'https://api.box.com/oauth2/token' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data-urlencode 'grant_type=client_credentials' \
    --data-urlencode 'client_id=h5z4c7jqyn95dh3n06tv92x3ceztj0qi' \
    --data-urlencode 'client_secret=TqbUwNZpmnINazieMaKAXRKR7wTZxA38' \
    --data-urlencode 'box_subject_type=enterprise' \
    --data-urlencode 'box_subject_id=877840855' \
    --data-urlencode 'scope=manage_managed_users admin_read_write'

     I get:

    {
        "error": "invalid_scope",
      "error_description": "Unsupported scope admin_read_write"
    }

    I can also confirm that the manage_managed_users scope does list all the users:

    {
        "total_count": 7,
        "entries": [
            {
                "type": "user",
                "id": "18662105676",
                "name": "Administrator"
            },
            {
                "type": "user",
                "id": "18662356345",
                "name": "Administrator"
            },
            {
                "type": "user",
                "id": "18661971368",
                "name": "Administrator"
            },
            {
                "type": "user",
                "id": "22240548078",
                "name": "Investment User"
            },
            {
                "type": "user",
                "id": "22240405099",
                "name": "Wealth User"
            },
            {
                "type": "user",
                "id": "22240545678",
                "name": "Wholesale User"
            },
            {
                "type": "user",
                "id": "18622116055",
                "name": "Rui Barbosa"
            }
        ],
        "limit": 100,
        "offset": 0
    }

     

    The most common issue here is when we change the application configurations, for example, the application scopes, and then forget to re-submit the app.

    Would you try to re-submit the app on the authorization tab, have your administrator approve it, and then try again.

    Let us know if this helps.

     

    0
    コメントアクション パーマリンク

サインインしてコメントを残してください。