# API経由で家族向けプランを提供

{% hint style="info" %}
このAPIは、Keeper Security Government Cloudリージョンに導入されているKeeperおよびエンタープライズ顧客のパートナー向けです。
{% endhint %}

## 概要

Keeperは、企業顧客がファミリープランをプロビジョニングするためのAPIを提供します。Keeperは、カスタムアプリケーションを構築し、ファミリープランをプロビジョニングするために統合できる[REST](https://www.codecademy.com/article/what-is-rest) APIを提供します。

## APIの機能

ProvisionファミリープランAPIエンドポイントは、エンタープライズアカウントとMSPパートナーがKeeperファミリーライセンスを登録するためのものです。このエンドポイントは、以下の製品/アドオンで**1年間のライセンス**を作成します。

* Keeperファミリー
* BreachWatch (ダークウェブ監視)
* 10GBファイルストレージ

Keeperファミリーライセンスの全機能リストについては、こちらの[ページ](https://www.keepersecurity.com/ja_JP/family-plan.html)をご参照ください。

{% hint style="success" %}
このAPIにアクセスするには、サポート担当者に連絡してAPIキーをリクエストしてください。これはKeeperのレコードで共有されます。
{% endhint %}

### API定義

{% openapi src="<https://3468650114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeJwa6ByNJ2qindnPknCW%2Fuploads%2FhaQICV68LwroMLLedyUL%2FFamilyPlan.yaml?alt=media&token=b7bb628c-fc29-4468-8d36-8db7043b16af>" path="/create-license" method="get" %}
<https://3468650114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeJwa6ByNJ2qindnPknCW%2Fuploads%2FhaQICV68LwroMLLedyUL%2FFamilyPlan.yaml?alt=media&token=b7bb628c-fc29-4468-8d36-8db7043b16af>
{% endopenapi %}

### APIの追加情報

#### APIパラメータ

必須パラメータの詳細については、こちらをご覧ください。

{% content-ref url="<https://github.com/Keeper-Security/gitbook-jp-enterprise-guide/blob/main/personal-vaults-for-enterprise-and-business-users/apitoraburushtingu/apiparamta/README.md>" %}
<https://github.com/Keeper-Security/gitbook-jp-enterprise-guide/blob/main/personal-vaults-for-enterprise-and-business-users/apitoraburushtingu/apiparamta/README.md>
{% endcontent-ref %}

#### APIレスポンスコード

レスポンスコードの詳細については、こちらをご覧ください。

{% content-ref url="<https://github.com/Keeper-Security/gitbook-jp-enterprise-guide/blob/main/personal-vaults-for-enterprise-and-business-users/apitoraburushtingu/apiresuponsukdo/README.md>" %}
<https://github.com/Keeper-Security/gitbook-jp-enterprise-guide/blob/main/personal-vaults-for-enterprise-and-business-users/apitoraburushtingu/apiresuponsukdo/README.md>
{% endcontent-ref %}

#### API エクスプローラ

postmanや[swaggerエディタ](https://editor.swagger.io/)のような別のツールでAPIを調査したい場合は、APIの関連するYAML定義を以下からダウンロードしてください。

swaggerを使ったAPI探索の詳細については、こちらをご覧ください。

{% content-ref url="<https://github.com/Keeper-Security/gitbook-jp-enterprise-guide/blob/main/personal-vaults-for-enterprise-and-business-users/apitoraburushtingu/apiekusupurra-swagger/README.md>" %}
<https://github.com/Keeper-Security/gitbook-jp-enterprise-guide/blob/main/personal-vaults-for-enterprise-and-business-users/apitoraburushtingu/apiekusupurra-swagger/README.md>
{% endcontent-ref %}

{% hint style="info" %}
これらのAPIの使用方法についてサポートが必要な場合や追加の質問がある場合は、サポートまたは営業担当者にお問い合わせください。
{% endhint %}

### サンプルnode.jsスクリプト

以下のサンプルを使って、お使いの環境での実装方法をご確認ください。

```
var request = require('request');
var CryptoJS = require('crypto-js');

var secret = 'PARTNER_SECRET';
var partner_name = 'PARTNER_NAME';
var email = 'EMAIL';
var hash = CryptoJS.SHA256(email + secret);
var transaction_id = 'TRANSACTION_ID';
var first_name = 'FIRST_NAME';
var last_name = 'LAST_NAME';

var options = {
  'method': 'GET',
  'url': 'https://keepersecurity.com/bi_api/v1/services/partner/create-license?transaction_id='+transaction_id+'&first_name='+first_name+'&last_name='+last_name+'&email='+email+'&hash='+hash+'&partner_name='+partner_name+'',
  'headers': {
      'Content-Type': 'application/json'
  }
  };

  request(options, function (error, response) {
      if (error) console.log("Error From the server: "+error);
      console.log("response body: "+response.body);
      console.log("response status: "+response.statusCode);
  });
```
