0

On the security part of an account details we can find the Connected applications section where all the third-party applications are listed.

How can I retrieve this list via the API ou SDK ?

enter image description here

Ôrel
  • 7,044
  • 3
  • 27
  • 46

1 Answers1

1

You can use the Reports API tokens.list. This returns a list of all active tokens (or connected apps) for a particular user. The resource looks something like this:

  "items": [
    {
      "kind": "admin#directory#token",
      "etag": "...",
      "clientId": "...apps.googleusercontent.com",
      "displayText": "Some app",
      "anonymous": false,
      "nativeApp": false,
      "userKey": "...",
      "scopes": [
        "https://mail.google.com/",
        "..."
      ]
    }
  ]

And just like the Admin console menu in your screenshot you can also revoke the tokens for each user by using tokens.delete.

Reference:

Daniel
  • 3,157
  • 2
  • 7
  • 15