MENU
      Edit method
        • PDF

        Edit method

        • PDF

        Article summary

        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:

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

        FieldTypeRequiredDescription
        product-idStringRequiredProduct ID that the API belongs to
        api-idStringRequiredID of the API to edit
        resource-idStringRequiredID of the target resource in the API
        method-nameStringRequiredTarget method type
        • ANY | GET | POST | PUT | DELETE | PATCH | OPTIONS | HEAD

        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"
          }
        }
        JSON

        Request body

        You can include the following data in the body of your request:

        FieldTypeRequiredDescription
        methodDescriptionStringOptionalMethod description
        • 0 - 300 characters
        httpEndPointStringConditionalEndpoint type that returns the result of a call to an HTTP(S) endpoint
        • Select one from mockEndPoint, ncpEndPoint, and httpEndPoint
        httpEndPoint.methodStringConditionalMethod type to request from the backend server
        • ANY | GET | POST | PUT | DELETE | PATCH | OPTIONS | HEAD
        • Required when selecting the httpEndPoint type
        httpEndPoint.streamBooleanConditionalWhether to use the stream feature
        • true | false
          • true: The stream feature is used. Use it for requests that are file uploads in nature. Response time is limited to 5 minutes and request size to 100 MB
          • false: The stream feature is not used. Response time is limited to 30 seconds and request size to 10 MB
        • Required when selecting the httpEndPoint type
        httpEndPoint.urlStringConditionalURL path to request to the backend server
        • Exclude domains
        • The query string and headers defined in the resource path variable and request parameters can be used. Define using "{}" when used.
        • 1 - 1500 characters
        • Required when selecting the httpEndPoint type
        mockEndPointStringConditionalEndpoint type that returns the value set in the API Gateway
        • Select one from mockEndPoint, ncpEndPoint, and httpEndPoint
        mockEndPoint.httpStatusIntegerConditionalResponse status code
        • Required when selecting the mockEndPoint type
        • Equivalent to the Response Status Code in HTTP
        mockEndPoint.headersMap<String, String>OptionalHeader to include in the response
        • Header key, value form
        mockEndPoint.responseStringOptionalData to display in the response
        • 0 - 1500 characters
        ncpEndPointStringConditionalEndpoint type that returns a value using a service of NAVER Cloud Platform
        • Select one from mockEndPoint, ncpEndPoint, and httpEndPoint
        ncpEndPoint.serviceStringConditionalService on NAVER Cloud Platform to use for returning responses
        • Cloud Functions service can be used
        • Required when selecting the ncpEndPoint type
        ncpEndPoint.regionStringConditionalSupported Region code of the Cloud Functions service
        • KR | JPN | SGN
        • Required when selecting the ncpEndPoint type
        ncpEndPoint.actionIdStringConditionalAction ID of the Cloud Functions service
        • Required when selecting the ncpEndPoint type
        ncpEndPoint.actionNameStringConditionalAction name of the Cloud Functions service
        • Required when selecting the ncpEndPoint type
        ncpEndPoint.urlStringConditionalURL path of the Cloud Functions service
        • Required when selecting the ncpEndPoint type
        ncpEndPoint.methodStringOptionalMethod type to request from the Cloud Functions service
        • ANY | GET | POST | PUT | DELETE | PATCH | OPTIONS | HEAD
        ncpEndPoint.streamBooleanConditionalWhether to use the stream feature
        • true | false
          • true: The stream feature is used
          • false: The stream feature is not used
        • Required when selecting the ncpEndPoint type
        requiredApiKeyStringRequiredAPI key usage information
        requiredApiKey.requiredBooleanRequiredWhether to use API key
        • true | false
          • true: API key is used
          • false: API key is not used. Product subscription method and usage plan are not applied
        validationStringRequiredValidity check information
        validation.typeStringRequiredValidity check range
        • NONE | QUERYSTRING_HEADERS
          • NONE: No validaty check is run
          • QUERYSTRING_HEADERS: Run validaty check for the query string and headers
        validation.headersList<String>ConditionalList of required headers subject to validity check
        • Enter when selecting QUERYSTRING_HEADERS
        validation.queryStringsList<String>ConditionalList of required query strings subject to validity check
        • Enter when selecting QUERYSTRING_HEADERS
        authenticationStringRequiredAuthentication information
        authentication.platformStringRequiredSet authentication method
        • NONE | IAM | IAM_AUTHORIZATION | AUTHORIZER
          • NONE: no authentication
          • IAM: Use IAM authentication provided by NAVER Cloud Platform
          • IAM_AUTHORIZATION: Use IAM authentication/authorization provided by NAVER Cloud Platform
          • AUTHORIZER: Use a pre-created authorizer
        authentication.authorizerIdStringConditionalID 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"
          }
        }'
        Curl

        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"
            }
          }
        }
        JSON

        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"
          }
        }
        JSON

        Was this article helpful?

        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.