4

I'm trying to retrieve all the 3rd party connected apps in my Google workspace admin SDK using API. Does anybody know how?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
shakatechi
  • 51
  • 3

1 Answers1

2

The Google Admin SDK doesn't have a method that only retrieves the 3rd party connected apps, but you could use the method activities.list using applicationName=token once you have the Oauth tokens you can filter out third party applications based on the product_bucket .

=========

Edit:

You could try this example on App Script, that will display the token authorized for your users in the organization.

function myFunction() {
  let request = {
    "eventName": "authorize"
  };
  let appsList = [];
  let response = AdminDirectory.Activities.list("all", "token", request);
  for(let i=0; i< response.items.length; i++)
  {
    if(appsList.includes(response.items[i].events[0].parameters[1].value)==false)
    {
      appsList.push(response.items[i].events[0].parameters[1].value);
    }
  }
  Logger.log(appsList);
}

======

Before you run the code remember to add the advance service Admin SDK

enter image description here

Then, change the Version to Reports_v1

enter image description here

References:

Milagro Sosa
  • 424
  • 1
  • 10
  • Thank you very much man! Now the question that i'm interested in is how to filter the results out? i'm new to api calls so i dont have a big idea on how to filter the results that an api call should deliver in the end. Thank you very much – shakatechi Aug 03 '22 at 09:27
  • If this answered your question, please click the accept button on the left (check icon). By doing so, other people in the community, who may have the same concern as you, will know that theirs can be resolved. If the accept button is unavailable to you, feel free to tell me. [How to accept answer](https://stackoverflow.com/help/accepted-answer) – Milagro Sosa Aug 04 '22 at 21:38