--- title: "メソッドの変更" slug: "apigateway-patchmethods" updated: 2026-09-17T09:57:24Z published: 2026-09-17T09:57:24Z canonical: "api.ncloud-docs.com/apigateway-patchmethods" --- > ## Documentation Index > Fetch the complete documentation index at: https://api.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # メソッドの変更 Classic/VPC環境で利用できます。 ユーザー定義したメソッドの設定を変更します。 ## リクエスト リクエスト形式を説明します。リクエスト形式は次の通りです。 | メソッド | URI | | --- | --- | | PATCH | /api/v1/products/{product-id}/apis/{api-id}/resources/{resource-id}/methods/{method-name} | ### リクエストヘッダ API Gatewayで共通して使用されるヘッダの詳細は、[API Gatewayのリクエストヘッダ](/docs/ja/ai-application-service-apigateway#%EC%9A%94%EC%B2%AD%ED%97%A4%EB%8D%94)をご参照ください。 ### リクエストパスパラメータ リクエストパスパラメータの説明は次の通りです。 | フィールド | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `product-id` | String | Required | APIが属する Product ID - 1~10文字 - [Productリストの照会](/docs/ja/apigateway-product-getproductlist)を参照 | | `api-id` | String | Required | 変更対象 APIの ID - 1~10文字 - [APIの照会](/docs/ja/apigateway-api-apis)を参照 | | `resource-id` | String | Required | APIの対象リソースの ID - 1~10文字 - [Resourceリストの照会](/docs/ja/apigateway-resource-getresourcelist)を参照 | | `method-name` | String | Required | 対象メソッドのタイプ - `ANY` \| `GET` \| `POST` \| `PUT` \| `DELETE` \| `PATCH` \| `OPTIONS` \| `HEAD` | ### リクエスト構文 リクエスト構文は次の通りです。 ``` { "methodDescription" : "methodDescription", "httpEndPoint" : { "method" : "ANY", "stream" : true, "url" : "url" }, "mockEndPoint" : { "headers" : { "key" : "value" }, "response" : "response", "httpStatus" : 0 }, "ncpEndPoint" : { "method" : "ANY", "stream" : true, "service" : "service", "actionId" : "actionId", "region" : "KR", "url" : "url", "actionName" : "actionName" }, "requiredApiKey" : { "required" : true }, "validation" : { "headers" : [ "headers" ], "queryStrings" : [ "queryStrings" ], "type" : "NONE" }, "authentication" : { "authorizerId" : "authorizerId", "platform" : "NONE" } } ``` ### リクエストボディ リクエストボディの説明は次の通りです。 | フィールド | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `methodDescription` | String | Optional | メソッドの説明 - 0~2000文字 | | `httpEndPoint` | String | Conditional | HTTP(S)エンドポイントの呼び出し結果を返すエンドポイントタイプ - `mockEndPoint`、`ncpEndPoint`、`httpEndPoint`のいずれかを選択 | | `httpEndPoint.method` | String | Conditional | バックエンドサーバにリクエストするメソッドタイプ - `ANY` \| `GET` \| `POST` \| `PUT` \| `DELETE` \| `PATCH` \| `OPTIONS` \| `HEAD` - `httpEndPoint`タイプの選択時、必ず入力 | | `httpEndPoint.stream` | Boolean | Conditional | Stream機能を使用するかどうか - `true` \| `false` - `true`: Stream機能を使用。ファイルアップロードのようなリクエストの場合、使用。レスポンス時間は5分、リクエストサイズは最大100MBに制限。 - `false`: Stream機能を使用しない。レスポンス時間は30秒、リクエストサイズは最大10MBに制限。 - `httpEndPoint`タイプの選択時、必ず入力 | | `httpEndPoint.url` | String | Conditional | バックエンドサーバにリクエストする URLパス - ドメインを除く - リソースパス変数とリクエストパラメータで定義したクエリ文字列とヘッダを使用できる。使用時は「{}」を使用して定義。 - 1~1500文字 - `httpEndPoint`タイプの選択時、必ず入力 | | `mockEndPoint` | String | Conditional | API Gatewayで設定した値を返すエンドポイントタイプ - `mockEndPoint`、`ncpEndPoint`、`httpEndPoint`のいずれかを選択 | | `mockEndPoint.httpStatus` | Integer | Conditional | レスポンスステータスコード - `mockEndPoint`タイプ選択時、必ず入力 - HTTPの Response Status Codeに対応する値 | | `mockEndPoint.headers` | Map[String, String] | Optional | レスポンスに含めるヘッダ - ヘッダ Key, Valueの形式 | | `mockEndPoint.response` | String | Optional | レスポンスに表示するデータ - 0~1500文字 | | `ncpEndPoint` | String | Conditional | NAVERクラウドプラットフォームのサービスを使用して値を返すエンドポイントタイプ - `mockEndPoint`、`ncpEndPoint`、`httpEndPoint`のいずれかを選択 | | `ncpEndPoint.service` | String | Conditional | レスポンスの返しに使用する NAVERクラウドプラットフォームのサービス - Cloud Functionsサービスを利用可能 - `ncpEndPoint`タイプ選択時、必ず入力 | | `ncpEndPoint.region` | String | Conditional | Cloud Functionsサービスのサポートリージョンコード - `KR` \| `JPN` \| `SGN` - `ncpEndPoint`タイプ選択時、必ず入力 | | `ncpEndPoint.actionId` | String | Conditional | Cloud Functionsサービスのアクション ID - `ncpEndPoint`タイプ選択時、必ず入力 | | `ncpEndPoint.actionName` | String | Conditional | Cloud Functionsサービスのアクション名 - `ncpEndPoint`タイプ選択時、必ず入力 | | `ncpEndPoint.url` | String | Conditional | Cloud Functionsサービスの URLパス - `ncpEndPoint`タイプ選択時、必ず入力 | | `ncpEndPoint.method` | String | Optional | Cloud Functionsサービスにリクエストするメソッドタイプ - `ANY` \| `GET` \| `POST` \| `PUT` \| `DELETE` \| `PATCH` \| `OPTIONS` \| `HEAD` | | `ncpEndPoint.stream` | Boolean | Conditional | Stream機能を使用するかどうか - `true` \| `false` - `true`: Stream機能を使用 - `false`: Stream機能を使用しない - `ncpEndPoint`タイプ選択時、必ず入力 | | `requiredApiKey` | String | Required | API keyの使用情報 | | `requiredApiKey.required` | Boolean | Required | API keyを使用するかどうか - `true` \| `false` - `true`: API keyを使用する - `false`: API keyを使用しない。Productサブスクリプション方法と Usage Planが適用されない。 | | `validation` | String | Required | 有効性検査情報 | | `validation.type` | String | Required | 有効性検査の範囲 - `NONE` \| `QUERYSTRING_HEADERS` - `NONE`: 有効性検査を実行しない - `QUERYSTRING_HEADERS`: クエリ文字列とヘッダの有効性検査を実行 | | `validation.headers` | List[String] | Conditional | 有効性検査対象の必須ヘッダリスト - `QUERYSTRING_HEADERS`選択時に入力 | | `validation.queryStrings` | List[String] | Conditional | 有効性検査対象の必須クエリ文字列リスト - `QUERYSTRING_HEADERS`選択時に入力 | | `authentication` | String | Required | 認証情報 | | `authentication.platform` | String | Required | 認証方法の設定 - `NONE` \| `IAM` \| `IAM_AUTHORIZATION` \| `AUTHORIZER` - `NONE`: 認証を使用しない - `IAM`: NAVERクラウドプラットフォームが提供する IAM認証を使用 - `IAM_AUTHORIZATION`: NAVERクラウドプラットフォームが提供する IAM認証/許可を使用 - `AUTHORIZER`: 事前に作成した Authorizerを使用 | | `authentication.authorizerId` | String | Conditional | 認証方法として Authorizerを使用するときに使用する Authorizerの ID | ### リクエスト例 リクエストのサンプルコードは次の通りです。 ``` curl --location --request PATCH 'https://apigateway.apigw.ntruss.com/api/v1/products/********o9/apis/cvcohvd2xj/resources/p1hiuvmwv3/methods/OPTIONS' \ --header 'x-ncp-apigw-timestamp: {Timestamp}' \ --header 'x-ncp-iam-access-key: {Access Key}' \ --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \ --header 'Content-Type: application/json' \ --data '{ "mockEndPoint": { "httpStatus": 400, "response": "user error" }, "authentication": { "platform": "NONE" }, "requiredApiKey": { "required": true }, "validation": { "type": "NONE" } }' ``` ## レスポンス レスポンス形式を説明します。 ### レスポンス構文 レスポンス構文は次の通りです。 ``` { "method" : { "methodDescription" : "methodDescription", "resourceId" : "resourceId", "useBodyWhenFormData" : true, "modifier" : "modifier", "resourcePath" : "resourcePath", "methodName" : "ANY", "ncpEndPoint" : { "method" : "ANY", "stream" : true, "service" : "service", "actionId" : "actionId", "region" : "KR", "url" : "url", "actionName" : "actionName" }, "requiredApiKey" : { "required" : true }, "mockEndPoint" : { "headers" : { "key" : "headers" }, "response" : "response", "httpStatus" : 0 }, "produces" : "produces", "tenantId" : "tenantId", "consumers" : "consumers", "apiId" : "apiId", "validation" : { "headers" : [ "headers" ], "queryStrings" : [ "queryStrings" ], "type" : "NONE" }, "authentication" : { "authorizerId" : "authorizerId", "platform" : "NONE" }, "httpEndPoint" : { "method" : "ANY", "stream" : true, "url" : "url" } } } ``` ### レスポンスステータスコード API Gatewayで共通して使用されるレスポンスステータスコードの詳細は、[API Gatewayのレスポンスステータスコード](/docs/ja/ai-application-service-apigateway#%EC%9D%91%EB%8B%B5%EC%83%81%ED%83%9C%EC%BD%94%EB%93%9C)をご参照ください。 ### レスポンス例 レスポンスのサンプルコードは次の通りです。 ``` { "method": { "apiId": "cvcohvd2xj", "resourceId": "p1hiuvmwv3", "methodName": "GET", "useBodyWhenFormData": false, "validation": { "type": "NONE" }, "authentication": { "platform": "NONE" }, "requiredApiKey": { "required": true }, "mockEndPoint": { "httpStatus": 400, "response": "user error" }, "tenantId": "********65ec41039ce6668c2058b8a9", "modifier": "********-7fcd-11ec-a6ba-246e9659184c" } } ```