MENU
      API Keyの変更

        API Keyの変更


        記事の要約

        Classic/VPC環境で利用できます。

        API Keyの情報を変更します。

        リクエスト

        リクエスト形式を説明します。リクエスト形式は次の通りです。

        メソッドURI
        PUT/api-keys/{api-key-id}

        リクエストヘッダ

        API Gatewayで共通して使用されるヘッダの詳細は、API Gatewayのリクエストヘッダをご参照ください。

        リクエストパスパラメータ

        パラメータの説明は次の通りです。

        フィールドタイプ必須の有無説明
        api-key-idStringRequired変更対象の API Key ID

        リクエスト構文

        リクエスト構文は次の通りです。

        {
          "isEnabled" : true,
          "apiKeyDescription" : "apiKeyDescription",
          "apiKeyName" : "apiKeyName"
        }
        JSON

        リクエストボディ

        リクエストボディの説明は次の通りです。

        フィールドタイプ必須の有無説明
        isEnabledBooleanRequiredAPI Key有効化の有無
        • true | false
          • true: API Key有効化
          • false: API Key無効化
        apiKeyDescriptionStringOptionalAPI Keyの説明
        • 0~50文字
        apiNameStringRequiredAPI Keyの名前
        • 1~20文字

        リクエスト例

        リクエストのサンプルコードは次の通りです。

        curl -X PUT 'https://apigateway.apigw.ntruss.com/api/v1/api-keys/{api-key-id}' \
        --header 'Content-Type: application/json' \
        --header 'x-ncp-apigw-timestamp: {Timestamp}' \
        --header 'x-ncp-iam-access-key: {Access Key}' \
        --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'
        --data '{
          "isEnabled" : true,
          "apiKeyDescription" : "apiKey-*** Description",
          "apiKeyName" : "apiKey-***"
        }'
        Curl

        レスポンス

        レスポンス形式を説明します。

        レスポンス構文

        構文は次の通りです。

        {
            "apiKey": {
                "apiKeyId": "apiKeyId",
                "tenantId": "tenantId",
                "apiKeyName": "apiKeyName",
                "apiKeyDescription": "apiKeyDescription",
                "primaryKey": "primaryKey",
                "secondaryKey": "secondaryKey",
                "modifier": "modifier",
                "isEnabled": true,
                "modTime": "2024-05-08T05:56:26Z",
                "domainCode": "domainCode"
            }
        }
        JSON

        レスポンスステータスコード

        API Gatewayで共通して使用されるレスポンスステータスコードの詳細は、API Gatewayのレスポンスステータスコードをご参照ください。

        レスポンス例

        レスポンスのサンプルコードは次の通りです。

        {
            "apiKey": {
                "apiKeyId": "*****g079",
                "tenantId": "*****02f55ae4436913a6e2c65bab47c",
                "apiKeyName": "apiKey-***",
                "apiKeyDescription": "apiKey-*** Description",
                "primaryKey": "*****yVk37ZE39kJcZScH50cYsJiYf1EJUQ7haPj",
                "secondaryKey": "*****RWKmt1IVMAlXtg0yJ5jelwwiltuJBFKBDW9",
                "modifier": "d12c9fd0-****-****-****-246e96591a38",
                "isEnabled": true,
                "modTime": "2024-05-08T05:56:26Z",
                "domainCode": "PUB"
            }
        }
        JSON

        この記事は役に立ちましたか?

        Changing your password will log you out immediately. Use the new password to log back in.
        First name must have atleast 2 characters. Numbers and special characters are not allowed.
        Last name must have atleast 1 characters. Numbers and special characters are not allowed.
        Enter a valid email
        Enter a valid password
        Your profile has been successfully updated.