Search code examples
google-workspacegoogle-admin-sdk

Is there a way to find the service associated with a serviceId on google admin?


By running Privileges.list on google admin sdk we get a JSON looking like this:

    {
      "kind": "admin#directory#privilege",
      "etag": "\"JCPRxFaiNR1s5TJ6ecIH8OpGdY4efiOYXbIB65itOzY/l3mP5LVwu5mUzpHpCwuZ6dUl8sQ\"",
      "serviceId": "00tyjcwt49hs5nq",
      "serviceName": "play_for_work",
      "privilegeName": "MANAGE_EXTERNALLY_HOSTED_APK_UPLOAD_IN_PLAY",
      "isOuScopable": false
    },
    {
      "kind": "admin#directory#privilege",
      "etag": "\"JCPRxFaiNR1s5TJ6ecIH8OpGdY4efiOYXbIB65itOzY/0pXB8E7QTg03vLTGIizjP3RJ_KM\"",
      "serviceId": "02w5ecyt3pkeyqi",
      "privilegeName": "MANAGE_PLAY_FOR_WORK_STORE",
      "isOuScopable": false
    }

Where the second privilege doesn't contain a serviceName, just a serviceId.

What can we do with that serviceId? Is there a way to find the associated service using it?


Solution

  • I've inquired with some Google sources and it appears that they are aware that some serviceNames are not available, and there's no public list available. It may be confidential for some reason or they just prefer to keep it internal for now and they may or may not have plans for it in the future. Even the privileges.list API documentation mentions that the serviceId is an "obfuscated ID of the service", so we can at least tell that services and their IDs are important to them. This is a common practice.

    The good thing is that, as far as I could tell, these service IDs and their names are only used in the privileges list API and they seem there mostly for descriptive purposes. The list also rarely changes so if you need to list them in your application you could assign them your own names if they are missing. You can use the privilegeName field as a guide, for example.

    If you still have questions about it you can try to file a post in their issue tracker at the product feedback link at the bottom of the page.