# API経由での学生プランの提供

{% hint style="info" %}
もしあなたが学生で、無料のKeeperアカウントをご希望の場合、学校のIT部門にご連絡ください。Keeperアカウントをプロビジョニングするには、以下のAPIを実装する必要があります。
{% endhint %}

このAPIを通じて可能になる主なユースケースは、組織内の学生のための無料の「Keeper Unlimited」アカウントをプロビジョニングすることです。

## 概要

Keeperは法人のお客様に学生プランをプロビジョニングするためのAPIを提供しています。Keeperはカスタムアプリケーションを構築し、学生プランをプロビジョニングするための統合を可能にするREST APIを提供しています。

## APIの機能

学生プランAPIエンドポイントは、大学が追加費用なしで大学内の学生のために「Keeper Unlimited」アカウントを登録するためのものです。このエンドポイントは以下の製品/アドオンと**1年間のライセンス**を作成します。

* Keeper Unlimited
* BreachWatch
* 10GBファイルストレージ

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

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

### API 定義

{% openapi src="<https://3468650114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeJwa6ByNJ2qindnPknCW%2Fuploads%2FbH72iX32ejtX7DWSBMHj%2FStudentPlan.yaml?alt=media&token=c705f440-da93-41cc-8f11-213ebfd21178>" path="/create-license" method="get" %}
<https://3468650114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeJwa6ByNJ2qindnPknCW%2Fuploads%2FbH72iX32ejtX7DWSBMHj%2FStudentPlan.yaml?alt=media&token=c705f440-da93-41cc-8f11-213ebfd21178>
{% 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 %}

APIを使用したスクリプト例

### サンプル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?product_type=4&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);
  });
```
