MENU
      モデルの照会

        モデルの照会


        記事の要約

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

        作成した API別ボディモデルをリストで並べて照会します。

        リクエスト

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

        メソッドURI
        GET/products/{product-id}/apis/{api-id}/models

        リクエストヘッダ

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

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

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

        フィールドタイプ必須の有無説明
        product-idStringRequiredAPIが属する Product ID
        api-idStringRequiredモデルリストを照会する対象の API ID

        リクエスト例

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

        curl --location --request GET 'https://apigateway.apigw.ntruss.com/api/v1/products/********o9/apis/cvcohvd2xj/models' \
        --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'
        Curl

        レスポンス

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

        レスポンス構文

        レスポンス構文は次の通りです。

        {
          "productPage" : {
            "content" : [ {
              "modelId" : "modelId",
              "apiId" : "apiId",
              "modelName" : "modelName",
              "modelDescription" : "modelDescription",
              "modelSchema" : "modelSchema"
            } ],
            "total" : 0
          }
        }
        JSON

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

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

        レスポンス例

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

        {
            "productPage": {
                "content": [
                    {
                        "modelId": "tua1hd0pi4",
                        "apiId": "cvcohvd2xj",
                        "modelName": "testmodel",
                        "modelDescription": "test model",
                        "modelSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"firstName\": {\n      \"type\": \"string\"\n    },\n    \"lastName\": {\n      \"type\": \"string\"\n    },\n    \"age\": {\n      \"description\": \"Age in years\",\n      \"type\": \"integer\",\n      \"minimum\": 3\n    }\n  },\n  \"required\": [\n    \"firstName\",\n    \"lastName\"\n  ]\n}"
                    },
                    {
                        "modelId": "qw33h0i33i",
                        "apiId": "cvcohvd2xj",
                        "modelName": "ApiKeyDto",
                        "modelDescription": "ApiKeyDto",
                        "modelSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"apiKeyDescription\": { \"type\": \"string\" },\n    \"apiKeyId\": { \"type\": \"string\" },\n    \"apiKeyName\": { \"type\": \"string\" }\n  },\n  \"description\": \"説明\"\n}\n"
                    }
                ],
                "total": 2
            }
        }
        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.