Edit method
- Print
- PDF
Edit method
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
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 | /products/{product-id}/apis/{api-id}/resources/{resource-id}/methods/{method-name} |
Request headers
For headers common to API Gateway, see API Gateway common request headers.
Request path parameters
The following describes the parameters.
Field | Type | Required | Description |
---|---|---|---|
product-id | String | Required | Product ID that 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 | Method description
|
httpEndPoint | String | Conditional | Endpoint type that returns the result of a call to an HTTP(S) endpoint
|
httpEndPoint.method | String | Conditional | Method type to request from 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 the API Gateway
|
mockEndPoint.httpStatus | Integer | Conditional | Response status code
|
mockEndPoint.headers | Map<String, String> | Optional | Header to include in the response
|
mockEndPoint.response | String | Optional | Data to display in the 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 | Supported Region code of the Cloud Functions service
|
ncpEndPoint.actionId | String | Conditional | Action ID of the Cloud Functions service
|
ncpEndPoint.actionName | String | Conditional | Action name of the Cloud Functions service
|
ncpEndPoint.url | String | Conditional | URL path of the Cloud Functions service
|
ncpEndPoint.method | String | Optional | Method type to request from 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 to use API key
|
validation | String | Required | Validity check information |
validation.type | String | Required | Validity check range
|
validation.headers | List<String> | Conditional | List of required headers subject to validity check
|
validation.queryStrings | List<String> | Conditional | List of required query strings subject to validity check
|
authentication | String | Required | Authentication information |
authentication.platform | String | Required | Set authentication method
|
authentication.authorizerId | String | Conditional | ID of the authorizer to use when using the 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 response status codes common to API Gateway, 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"
}
}
Was this article helpful?