opt create api_key is a command used to create an API key. The created API key can be used as a key to access the OptHub API.You need to login beforehand.


Usage

$ opt create api_key [option]

Option

Example

  1. Execute the command.

    $ opt create api_key
    
  2. When executed, the API key, expiration date, and a message are displayed. If an API key has already been created, an error message will be shown.

    $ 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. The API key is displayed only once. Please store it in a secure location. By using the API key, participants can submit and verify solutions through the API from the programs they create. For more details, please refer to the OptHub API User Guide.

Create a new API key when an existing API key is already present

  1. Execute the command with the -f option.

    $ opt create api_key -f
    
  2. The issued API_KEY will become invalid. Are you sure you want to proceed? [y/N]: will be displayed. If you create a new API key, the existing one will become invalid. To proceed, enter y . If you do not agree, enter n.

    	$ opt create api_key -f
    The issued API_KEY will become invalid. Are you sure you want to proceed? [y/N]:  y
    
  3. When executed, the API key, expiration date, and a message will be displayed.

    $ 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.