Get app installation and licensing details

By providing example requests to and responses from the Google Workspace Marketplace API, this guide shows how to get Google Workspace Marketplace app installation and licensing details.

The application has not been installed yet

licenseNotification.list request

This request calls the licenseNotification.list method to retrieve a list of licensing notifications for a specific application.

GET /appsmarket/v2/licenseNotification/{applicationId}

curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/licenseNotification/{applicationId}

Response body

Since the application has not been installed yet, the response to this request does not include any licensing notifications.

{
  "kind": "appsmarket#licenseNotificationList",
  "nextPageToken": ""
}

The application is individually installed

A user, user1@domain1.com, individually installed the application from Google Workspace Marketplace.

licenseNotification.list request

This request calls the licenseNotification.list method and retrieves the list of licensing notifications for the application that has been installed by the user.

GET /appsmarket/v2/licenseNotification/{applicationId}

curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/licenseNotification/{applicationId}

Response body

Since user1@domain1.com installed the application, the response includes one license notification. The license notification includes a provision notification since a new license was provisioned for user1@domain1.com when they installed the application.

{
  "kind": "appsmarket#licenseNotificationList",
  "notifications": [
    {
      "kind": "appsmarket#licenseNotification",
      "id": "{LICENSE_NOTIFICATION_ID}",
      "applicationId": "{APPLICATION_ID}",
      "customerId": "user1@domain1.com",
      "timestamp": "1641318266998",
      "provisions": [
        {
          "kind": "appsmarket#provisionNotification",
          "editionId": "default_edition",
          "seatCount": "1"
        }
      ]
    }
  ],
  "nextPageToken": "{NEXT_PAGE_TOKEN}"
}

The application is admin installed

The administrator of domain1.com installed the application for everyone in the organization.

userLicense.get request

This request calls the userLicense.get method to get the licensing status of user1@domain1.com and determine if they have permission to use the application.

GET /appsmarket/v2/userLicense/{applicationId}/{userId}

curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/{applicationId}/user1@domain1.com

Response body

Since domain1.com has admin installed the application, the response returns the user license for user1@domain1.com where enabled is true, indicating that the domain administrator for domain1.com has activated the application for this domain, and state is ACTIVE, indicating that user1@domain1.com has a valid license and should be permitted to use the application.

{
  "kind": "appsmarket#userLicense",
  "enabled": true,
  "state": "ACTIVE",
  "editionId": "default_edition",
  "customerId": "user1@domain1.com",
  "applicationId": "{APPLICATION_ID}",
  "id": "{USER_LICENSE_ID}",
  "userId": "user1@domain1.com"
}

customerLicense.get request

This request calls the customerLicense.get method to get the licensing status of domain1.com to determine if they have access to the application.

GET /appsmarket/v2/customerLicense/{applicationId}/{customerId}

curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/customerLicense/{applicationId}/domain1.com

Response body

The response returns the customer license for domain1.com where state is ACTIVE, indicating that the customer has a valid license.

{
  "kind": "appsmarket#customerLicense",
  "id": "{CUSTOMER_LICENSE_ID}",
  "applicationId": "{APPLICATION_ID}",
  "customerId": "domain1.com",
  "state": "ACTIVE",
  "editions": [
    {
      "editionId": "default_edition",
      "seatCount": -1
    }
  ]
}

The application is only admin installed for a specific user's organizational unit (OU)

The application is now only admin installed for user2@domain1.com's OU. It is no longer admin installed for everyone in the organization.

userLicense.get request

This request calls the userLicense.get method to get the licensing status of user3@domain1.com and determine if they have permission to use the application.

GET /appsmarket/v2/userLicense/{applicationId}/{userId}

curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/{applicationId}/user3@domain1.com

Response body

Since the application is only admin installed for user2@domain1.com, the response returns a user license for user3@domain1.com where enabled is false, indicating that the domain administrator for domain1.com has not activated the application for this domain, and state is ACTIVE, indicating that the user has a valid license and should be permitted to use the application.

{
  "kind": "appsmarket#userLicense",
  "enabled": false,
  "state": "ACTIVE",
  "editionId": "default_edition",
  "customerId": "domain1.com",
  "applicationId": "{APPLICATION_ID}",
  "id": "{USER_LICENSE_ID}",
  "userId": "user3@domain1.com"
}

userLicense.get request

This request calls the userLicense.get method to get the licensing status of user2@domain1.com and determine if they have permission to use the application.

GET /appsmarket/v2/userLicense/{applicationId}/{userId}

curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/{applicationId}/user2@domain1.com

Response body

Since the application is only admin installed for user2@domain1.com, the response returns a user license for user2@domain1.com where enabled is true and state is ACTIVE.

{
  "kind": "appsmarket#userLicense",
  "enabled": true,
  "state": "ACTIVE",
  "editionId": "default_edition",
  "customerId": "domain1.com",
  "applicationId": "{APPLICATION_ID}",
  "id": "{USER_LICENSE_ID}",
  "userId": "user2@domain1.com"
}

The application is deleted for everyone in the organization

The application was deleted for everyone in the organization. The user, user1@domain1.com, still has access to the application because they previously individually installed the application.

userLicense.get request

This request calls the userLicense.get method to get the licensing status of user2@domain1.com and determine if they have permission to use the application.

GET /appsmarket/v2/userLicense/{applicationId}/{userId}

curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/{applicationId}/user2@domain1.com

Response body

Since the application was deleted for everyone in the organization, the response returns a user license for user2@domain1.com where enabled is false and state is UNLICENSED, indicating that the administrator of this user's domain did not assign a seat for the application to this user.

{
  "kind": "appsmarket#userLicense",
  "enabled": false,
  "state": "UNLICENSED",
  "applicationId": "{APPLICATION_ID}",
  "id": "{USER_LICENSE_ID}",
  "userId": "user2@domain1.com"
}

userLicense.get request

This request calls the userLicense.get method to get the licensing status of user1@domain1.com and determine if they have permission to use the application.

GET /appsmarket/v2/userLicense/{applicationId}/{userId}

curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/userLicense/{applicationId}/user1@domain1.com

Response body

Since user1@domain1.com previously individually installed the application, they still have permission to use it. The response returns a user license where enabled is true and state is ACTIVE.

{
  "kind": "appsmarket#userLicense",
  "enabled": true,
  "state": "ACTIVE",
  "editionId": "default_edition",
  "customerId": "user1@domain1.com",
  "applicationId": "{APPLICATION_ID}",
  "id": "{USER_LICENSE_ID}",
  "userId": "user1@domain1.com"
}

The license notifications from all above actions

licenseNotification.list request

A request to the licenseNotification.list method retrieves all of the licensing notifications for the application.

GET /appsmarket/v2/licenseNotification/{applicationId}

curl -H "Authorization: Bearer {TOKEN}" https://appsmarket.googleapis.com/appsmarket/v2/licenseNotification/{applicationId}

Response body

The response returns a list of license notifications for all of the actions performed above.

{
  "kind": "appsmarket#licenseNotificationList",
  "notifications": [
    {
      "kind": "appsmarket#licenseNotification",
      "id": "{LICENSE_NOTIFICATION_ID}",
      "applicationId": "{APPLICATION_ID}",
      "customerId": "user1@domain1.com",
      "timestamp": "1641318266998",
      "provisions": [
        {
          "kind": "appsmarket#provisionNotification",
          "editionId": "default_edition",
          "seatCount": "1"
        }
      ]
    },
    {
      "kind": "appsmarket#licenseNotification",
      "id": "{LICENSE_NOTIFICATION_ID}",
      "applicationId": "{APPLICATION_ID}",
      "customerId": "domain1.com",
      "timestamp": "1641318351038",
      "provisions": [
        {
          "kind": "appsmarket#provisionNotification",
          "editionId": "default_edition",
          "seatCount": "-1"
        }
      ]
    },
    {
      "kind": "appsmarket#licenseNotification",
      "id": "{LICENSE_NOTIFICATION_ID}",
      "applicationId": "{APPLICATION_ID}",
      "customerId": "domain1.com",
      "timestamp": "1641318858349",
      "deletes": [
        {
          "kind": "appsmarket#deleteNotification",
          "editionId": "default_edition",
        }
      ]
    },
  ],
  "nextPageToken": "{NEXT_PAGE_TOKEN}"
}