日本時間5月16日のContent Cloud Summitで、カスタムアプリにBox AI APIを活用する方法を紹介します。

詳細を表示

ユーザーのセッションを終了させるジョブを作成

post
https://api.box.com/2.0
/users/terminate_sessions

ユーザーのロールと権限を検証し、ユーザーのセッションを終了させる非同期ジョブを作成します。POSTリクエストのステータスを返します。

リクエスト

bearer [ACCESS_TOKEN]
application/json

リクエスト本文

string array本文内必須
["123456","456789"]

ユーザーIDのリスト

string array本文内必須
["user@sample.com","user2@sample.com"]

ユーザーログインのリスト

レスポンス

リクエストのステータスに関するメッセージを返します。

一部のパラメータが無効な場合にエラーを返します。

  • Users can not be NULL or EMPTY: 値が指定されていない場合
  • User id format is string: 指定されたユーザーIDの形式が正しくない場合
  • Supported payload format is JSON: 指定されたペイロードの形式が正しくない場合

権限が不足している場合にエラーを返します。

リソースが見つからなかった場合にエラーを返します。

レート制限を超えた場合にエラーを返します。

内部サーバーの問題が発生している場合にエラーを返します。

リクエストがタイムアウトした場合にエラーを返します。

予期しないクライアントエラー。

post
ユーザーのセッションを終了させるジョブを作成
このドキュメント内で一部のAPIを試せるようになりました。
ログイン

リクエストの例

cURL
curl -i -X POST "https://api.box.com/2.0/users/terminate_sessions" \
    -H "authorization: Bearer <ACCESS_TOKEN>" \
    -H "content-type: application/json" \
    -H "accept: application/json" \
    -d 
  {
      user_ids: ["6178859178", "4824866571"]  
      user_logins: ["user@example.com", "user2@example.com",]
  }
Node
var userIDs = ['33333', '44444'];
var userLogins = ['user1@example.com', 'user2@example.com'];

client.users.terminateSession({
    user_ids: userIDs,
    user_logins: userLogins
}).then((result) => {
        /* result -> {
            message: "Request is successful, please check the admin events for the status of the job" }
        */
    });

レスポンスの例

{
  "message": "Request is successful, please check the admin\nevents for the status of the job"
}