Available in Classic and VPC
Change the settings of a customized method.
Request
This section describes the request format. The method and URI are as follows:
| Method | URI |
|---|---|
| PATCH | /api/v1/products/{product-id}/apis/{api-id}/resources/{resource-id}/methods/{method-name} |
Request headers
For information about the headers common to all API Gateway APIs, see API Gateway request headers.
Request path parameters
You can use the following path parameters with your request:
| Field | Type | Required | Description |
|---|---|---|---|
product-id |
String | Required | ID of product the API belongs to
|
api-id |
String | Required | ID of the API to edit
|
resource-id |
String | Required | ID of the target resource in the API
|
method-name |
String | Required | Target method type
|
Request syntax
The request syntax is as follows:
{
"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"
}
}
Request body
You can include the following data in the body of your request:
| Field | Type | Required | Description |
|---|---|---|---|
methodDescription |
String | Optional | Description of the method
|
httpEndPoint |
String | Conditional | Endpoint type that returns the result of calling the HTTP(S) endpoint
|
httpEndPoint.method |
String | Conditional | Method type to request to the backend server
|
httpEndPoint.stream |
Boolean | Conditional | Whether to use the Stream feature
|
httpEndPoint.url |
String | Conditional | URL path to request to the backend server
|
mockEndPoint |
String | Conditional | Endpoint type that returns the value set in API Gateway.
|
mockEndPoint.httpStatus |
Integer | Conditional | Response status code
|
mockEndPoint.headers |
Map[String, String] | Optional | Headers to include in the response
|
mockEndPoint.response |
String | Optional | Data to display in response
|
ncpEndPoint |
String | Conditional | Endpoint type that returns a value using a service of NAVER Cloud Platform
|
ncpEndPoint.service |
String | Conditional | Service on NAVER Cloud Platform to use for returning responses
|
ncpEndPoint.region |
String | Conditional | Cloud Functions service's supported Region code
|
ncpEndPoint.actionId |
String | Conditional | Cloud Functions service's action ID
|
ncpEndPoint.actionName |
String | Conditional | Cloud Functions service's action name
|
ncpEndPoint.url |
String | Conditional | URL path of the Cloud Functions service
|
ncpEndPoint.method |
String | Optional | Method type to request to the Cloud Functions service
|
ncpEndPoint.stream |
Boolean | Conditional | Whether to use the stream feature
|
requiredApiKey |
String | Required | API key usage information |
requiredApiKey.required |
Boolean | Required | Whether API key is used
|
validation |
String | Required | Validity check information |
validation.type |
String | Required | Validity check scope
|
validation.headers |
List[String] | Conditional | List of required headers subject to validity checks
|
validation.queryStrings |
List[String] | Conditional | List of required query strings subject to validity checks
|
authentication |
String | Required | Authentication information |
authentication.platform |
String | Required | Set the authentication method.
|
authentication.authorizerId |
String | Conditional | ID of the authorizer to be used when using authorizer as the authentication method |
Request example
The request example is as follows:
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"
}
}'
Response
This section describes the response format.
Response syntax
The response syntax is as follows:
{
"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"
}
}
}
Response status codes
For information about the HTTP status codes common to all API Gateway APIs, see API Gateway response status codes.
Response example
The response example is as follows:
{
"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"
}
}