opt create api_key はAPIキーの作成を行うコマンドです。作成したAPIキーはOptHub APIにアクセスするためのキーとしてご利用頂けます。事前にログインを行う必要があります。


使用方法

$ opt create api_key [option]

オプション

使用例

  1. コマンドを実行します。

    $ opt create api_key
    
  2. 実行すると、APIキー、有効期限、メッセージが表示されます。既にAPIキーを作成している場合は、エラーメッセージが表示されます。

    $ opt show download
    The API key will only be displayed once.
    API_KEY: [YOUR API KEY]
    Expires at: 2024-09-01T07:28:19.846Z
    Please store the API key in a safe place. Using the API key allows you to submit and verify solutions.
    
  3. APIキーは一度しか表示されません。安全な場所に保管してください。APIキーを用いることで、参加者が作成したプログラムからAPI経由で解の送信や確認ができます。詳細はOptHub API 利用ガイド をご覧ください。

既存のAPIキーがある場合の新規APIキー作成手順

  1. -f オプションを用いて、コマンドを実行します。

    $ opt create api_key -f
    
  2. The issued API_KEY will become invalid. Are you sure you want to proceed? [y/N]: というメッセージが表示されます。新規作成する場合、作成済みのAPIキーは無効になるので同意する場合は y を入力、同意しない場合は n を入力してください。

    	$ opt create api_key -f
    The issued API_KEY will become invalid. Are you sure you want to proceed? [y/N]:  y
    
  3. 実行すると、APIキー、有効期限、メッセージが表示されます。

    $ opt show download
    The issued API_KEY will become invalid. Are you sure you want to proceed? [y/N]: y
    The API key will only be displayed once.
    API_KEY: [YOUR API KEY]
    Expires at: 2024-09-01T07:28:19.846Z
    Please store the API key in a safe place. Using the API key allows you to submit and verify solutions.