Enterprise License Manager API: 개발자 가이드

이 문서에서는 계정 수준 및 리셀러 관리자가 Enterprise License Manager API를 사용하여 사용자 라이선스 할당을 관리하는 방법을 설명합니다. 계정의 제품 SKU 라이선스가 사용 설정되고 사용자가 생성된 후에는 Enterprise License Manager API를 사용하여 계정 사용자의 라이선스를 할당, 업데이트, 검색, 삭제할 수 있습니다.

이 버전에서는 계정 및 리셀러 관리자가 Enterprise License Manager API를 사용합니다. 위임된 계정 License Management 권한이 있는 관리자는 Enterprise License Manager API도 사용할 수 있습니다.

참고: Enterprise License Manager API는 Google 고객이 사용합니다. Google 서드 파티 애플리케이션 개발자가 라이선스를 관리하는 방법에 관한 자세한 내용은 Google Workspace Marketplace API를 참고하세요.

Enterprise License Manager API는 웹 서비스에 대한 RESTful (Representational State Transfer) 설계 접근 방식을 기반으로 합니다.

라이선스 관리

라이선스 할당

이 작업 이전에는 고객이나 리셀러가 Google 제품 라이선스를 주문하고 사용자를 만들었습니다. 이러한 제품 라이선스 중 하나를 이 사용자에게 할당하려면 다음 POST HTTP 요청을 사용하세요. 요청 승인에 설명된 대로 Authorization 헤더를 포함합니다. 제품 및 SKU ID는 API에서 사용할 수 있는 제품 및 SKU를 참고하세요.

POST https://www.googleapis.com/apps/licensing/v1/product/productId/sku/skuId/user

참고: 한 사용자에게 광범위한 Google 제품의 라이선스를 할당할 수 있습니다. 하지만 사용자에게는 한 번에 제품당 하나의 SKU 라이선스만 할당됩니다. API를 사용하여 사용자의 SKU 라이선스를 제품 내의 다른 SKU 라이선스에 재할당할 수 있습니다.

이 예에서는 기본 이메일 주소가 alex@example.com인 사용자에게 Google-Drive-storage-20GB SKU를 할당합니다.

POST https://www.googleapis.com/apps/licensing/v1/product/Google-Drive-storage/sku/Google-Drive-storage-20GB/user

JSON 요청 본문:

{
  "userId" : "alex@example.com",
}

성공 응답은 200 HTTP 상태 코드를 반환합니다. 가능한 오류 코드는 API의 오류 코드를 참고하세요. 성공하면 응답은 JSON 데이터 형식으로 라이선스 할당 상태를 반환합니다.

JSON 응답

{
  "kind": "licensing#licenseAssignment",
  "etags": "etag value",
  "selfLink": "https://www.googleapis.com/apps/licensing/v1/product/Google-Drive-storage/sku/Google-Drive-storage-20GB/user/alex@example.com",
  "userId": "alex@example.com",
  "productId": "Google-Drive-storage",
  "skuId": "Google-Drive-storage-20GB",
  "skuName": "Google Drive storage 20 GB",
  "productName": "Google Drive storage"
}

자세한 내용은 LicenseAssignments insert 메서드 참조 페이지를 확인하세요.

사용자의 제품 SKU를 동일한 제품 내 다른 SKU로 재할당

동일한 제품 내의 새 라이선스 SKU에 사용자 라이선스를 재할당하려면 다음 PUT HTTP 요청을 사용하세요. API는 패치 구문도 지원합니다. 요청 승인에 설명된 대로 Authorization 헤더를 포함합니다. 제품 및 SKU ID는 API에서 사용할 수 있는 제품 및 SKU를 참고하세요.

PUT https://www.googleapis.com/apps/licensing/v1/product/productId/sku/the current skuId/user/user's email

이 예에서는 현재의 Google-Drive-storage-20GB SKU를 Google-Drive-storage-50GB로 업데이트합니다. 현재 라이선스 SKU는 요청 URI에 있고 새 라이선스 SKU는 요청 본문에 있습니다.

PUT https://www.googleapis.com/apps/licensing/v1/product/Google-Drive-storage/sku/Google-Drive-storage-20GB/user/alex@example.com

JSON 요청 본문에는 다음이 포함됩니다.

{
  "kind": "licensing#licenseAssignment",
  "etags": "etag value",
  "selfLink": "https://www.googleapis.com/apps/licensing/v1/product/Google-Drive-storage/sku/Google-Drive-storage-50GB/user/alex@example.com",
  "userId": "alex@example.com",
  "productId": "Google-Drive-storage",
  "skuId": "Google-Drive-storage-50GB",
  "skuName": "Google Drive storage 50 GB",
  "productName": "Google Drive storage"
}

성공 응답이 수신되면 200 HTTP 상태 코드가 반환됩니다. 가능한 오류 코드는 API의 오류 코드를 참고하세요. 성공하면 응답은 라이선스 할당 상태를 JSON 데이터 형식으로 반환합니다.

JSON 응답

{
  "kind": "licensing#licenseAssignment",
  "etags": "etag value",
  "selfLink": "https://www.googleapis.com/apps/licensing/v1/product/Google-Drive-storage/sku/Google-Drive-storage-50GB/user/alex@example.com",
  "userId": "alex@example.com",
  "productId": "Google-Drive-storage",
  "skuId": "Google-Drive-storage-50GB",
  "skuName": "Google Drive storage 50 GB",
  "productName": "Google Drive storage"
}

자세한 내용은 LicenseAssignments 업데이트 메서드패치 메서드 참조 페이지를 확인하세요.

특정 제품의 라이선스가 할당된 모든 사용자 검색

특정 제품의 모든 사용자 라이선스를 가져오려면 다음 GET HTTP 요청을 사용하세요. 요청 승인에 설명된 대로 Authorization 헤더를 포함합니다. customerId 쿼리 문자열은 고객의 기본 도메인 이름입니다. maxResults 쿼리 문자열은 API의 응답에 반환되는 사용자 라이선스 항목 수를 결정합니다.

GET https://www.googleapis.com/apps/licensing/v1/product/productId/users?customerId=primary domain name&maxResults=max results per page

제품 및 SKU ID는 API에서 사용 가능한 제품 및 SKU를 참고하세요.

이 예에서는 Google Drive 스토리지 제품에 대한 라이선스가 할당된 example.com 도메인의 모든 사용자에 대한 결과의 첫 번째 페이지를 나열합니다.

GET https://www.googleapis.com/apps/licensing/v1/product/Google-Drive-storage/users?customerId=example.com&maxResults=2

성공 응답은 200 HTTP 상태 코드를 반환합니다. 가능한 오류 코드는 API의 오류 코드를 참고하세요. 성공하면 응답은 JSON 형식의 라이선스 목록을 반환합니다.

JSON 응답

{
  "kind" : "licensing#licenseAssignmentList",
  "etag": "etag value",
  "nextPageToken" : "the next page token value",
  "items": [
  {
    "kind": "licensing#licenseAssignment",
    "etags": "etag value",
    "selfLink": "https://www.googleapis.com/apps/licensing/v1/product/Google-Drive-storage/sku/Google-Drive-storage-50GB/user/alex@example.com",
    "userId": "alex@example.com",
    "productId": "Google-Drive-storage",
    "skuId": "Google-Drive-storage-50GB",
    "skuName": "Google Drive storage 50 GB",
    "productName": "Google Drive storage"
  },
  {
    "kind": "licensing#licenseAssignment",
    "etags": "etag value",
    "selfLink": "https://www.googleapis.com/apps/licensing/v1/product/Google-Drive-storage/sku/Google-Drive-storage-200GB/user/keshav@example.com",
    "userId": "keshav@example.com",
    "productId": "Google-Drive-storage",
    "skuId": "Google-Drive-storage-200GB",
    "skuName": "Google Drive storage 200 GB",
    "productName": "Google Drive storage"
  },
  ...
}

자세한 내용은 LicenseAssignments listForProduct 메서드 참조 페이지를 확인하세요.

특정 제품 SKU에 대해 라이선스가 할당된 모든 사용자를 검색합니다.

특정 제품 SKU에 대한 라이선스가 있는 모든 사용자 목록을 가져오려면 다음 GET HTTP 요청을 사용하세요. 요청 승인에 설명된 대로 Authorization 헤더를 포함합니다. customerId 쿼리 문자열은 고객의 기본 도메인 이름입니다. maxResults 쿼리 문자열은 API의 응답에서 반환되는 사용자 항목 수를 결정합니다.

GET https://www.googleapis.com/apps/licensing/v1/product/productId/sku/skuId/users?customerId=primary domain name&maxResults=max results per response page

제품 및 SKU ID는 API에서 사용할 수 있는 제품 및 SKU를 참고하세요.

이 예에서는 Google-Drive-storage-200GB SKU 라이선스가 할당된 example.com 도메인의 모든 사용자의 첫 번째 페이지를 반환합니다. 응답은 페이지당 두 개의 사용자 항목을 나열합니다.

GET https://www.googleapis.com/apps/licensing/v1/product/Google-Drive-storage/sku/Google-Drive-storage-200GB/users?customerId=example.com&maxResults=2

성공 응답은 200 HTTP 상태 코드를 반환합니다. 가능한 오류 코드는 API의 오류 코드를 참고하세요. 성공하면 응답은 JSON 형식의 라이선스 목록을 반환합니다.

JSON 응답

{
  "kind" : "licensing#licenseAssignmentList",
   "etag": "etag value",
   "nextPageToken" : "next page token's value",
   "items": [
    {
     "kind": "licensing#licenseAssignment",
     "etags": "etag value",
     "selfLink": "https://www.googleapis.com/apps/licensing/v1/product/Google-Drive-storage/sku/Google-Drive-storage-200GB/user/alex@example.com",
     "userId": "alex@example.com",
     "productId": "Google-Drive-storage",
     "skuId": "Google-Drive-storage-200GB",
     "skuName": "Google Drive storage 200 GB",
     "productName": "Google Drive storage"
    },
    {
     "kind": "licensing#licenseAssignment",
     "etags": "etag value",
     "selfLink": "https://www.googleapis.com/apps/licensing/v1/product/Google-Drive-storage/sku/Google-Drive-storage-200GB/user/mary@example.com",
     "userId": "mary@example.com",
     "productId": "Google-Drive-storage",
     "skuId": "Google-Drive-storage-200GB",
     "skuName": "Google Drive storage 200 GB",
     "productName": "Google Drive storage"
    },
    ...
  }

자세한 내용은 LicenseAssignments listForProductAndSku 메서드 참조 페이지를 확인하세요.

제품 SKU별로 특정 사용자 라이선스 검색

제품 SKU별로 특정 사용자의 라이선스를 가져오려면 다음 GET HTTP 요청을 사용합니다. 요청 승인에 설명된 대로 Authorization 헤더를 포함합니다. 제품 및 SKU ID는 API에서 사용할 수 있는 제품 및 SKU를 참고하세요.

GET https://www.googleapis.com/apps/licensing/v1/product/productId/sku/skuId/user/userId

이 예에서는 userId가 alex@example.com인 사용자의 Google Drive 스토리지 50GB 제품 SKU를 가져옵니다.

GET https://www.googleapis.com/apps/licensing/v1/product/Google-Drive-storage/sku/Google-Drive-storage-50GB/user/alex@example.com

사용자에게 이 라이선스가 있으면 성공 응답과 200 HTTP 상태 코드가 표시됩니다. 가능한 오류 코드는 API의 오류 코드를 참고하세요. 성공하면 응답에서 사용자의 라이선스를 JSON 형식으로 반환합니다.

JSON 응답

{
  "kind": "licensing#licenseAssignment",
  "etag": "etag value",
  "selfLink": "https://www.googleapis.com/apps/licensing/v1/product/Google-Drive-storage/sku/Google-Drive-storage-50GB/user/alex@example.com",
  "userId": "keshav@example.com",
  "productId": "Google-Drive-storage",
  "skuId": "Google-Drive-storage-50GB",
  "skuName": "Google Drive storage 50 GB",
  "productName": "Google Drive storage"
}

자세한 내용은 LicenseAssignments get 메서드 참조 페이지를 확인하세요.

라이선스 삭제

사용자의 라이선스를 할당 해제하려면 다음 DELETE HTTP 요청을 사용하세요. 요청 승인에 설명된 대로 Authorization 헤더를 포함합니다. 제품 및 SKU ID는 API에서 사용할 수 있는 제품 및 SKU를 참고하세요.

DELETE https://www.googleapis.com/apps/licensing/v1/product/productId/sku/skuId/user/userId

다음은 userId가 alex@example.com인 사용자에게 Google-Drive-storage-50GB 라이선스를 할당 취소하는 예시입니다.

DELETE https://www.googleapis.com/apps/licensing/v1/product/Google-Drive-storage/sku/Google-Drive-storage-50GB/user/alex@example.com

성공 응답이 수신되면 200 HTTP 상태 코드가 반환됩니다. 가능한 오류 코드는 API의 오류 코드를 참고하세요.

자세한 내용은 LicenseAssignments 삭제 메서드 참조 페이지를 확인하세요.

오류 코드

요청이 실패하면 응답에 오류에 대한 간단한 설명이 포함됩니다.

오류 코드 설명
400 잘못된 요청 - 사용자 이메일이 잘못되었습니다.
400 잘못된 요청 - SKU/제품이 없습니다.
401 작업 수행자에게 이 API를 호출할 사용자 인증 정보가 없습니다.
404 사용자에게 해당 라이선스가 없는 경우 응답에 '찾을 수 없음'이 표시됩니다. 오류 코드
412 전제조건이 충족되지 않았습니다. 이 오류에 대한 자세한 내용은 message 필드를 확인하세요. 예를 들면 다음과 같습니다.
  • Auto License switching is not allowed.
  • Auto License un-assignment is not allowed.
  • For reassign operations, the new SKU should be different from the old SKU: sku
  • Reassign operation can't be performed on different products: product1, product2
  • Reassign operation can't be performed on different users: user1, user2
  • There aren't enough available licenses for the specified product-SKU pair
  • User already has a license for the specified product and SKU
  • User already has a license of the product, but with a different SKU. To reassign a new SKU for this product, use the 'update' operation.
503 License Manager 서비스를 사용할 수 없습니다.