--- title: "Swaggerからデータインポート" slug: "apigateway-api-import" updated: 2026-09-17T09:57:24Z published: 2026-09-17T09:57:24Z canonical: "api.ncloud-docs.com/apigateway-api-import" --- > ## 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. # Swaggerからデータインポート Classic/VPC環境で利用できます。 Swaggerファイルをインポートしてリソースを作成します。 ## リクエスト リクエスト形式を説明します。リクエスト形式は次の通りです。 | メソッド | URI | | --- | --- | | POST | /api/v1/products/{product-id}/apis/import | ### リクエストヘッダ 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 | ### リクエスト構文 リクエスト構文は次の通りです。 ``` { "apiName" : "apiName", "apiDescription" : "apiDescription", "importValidateType" : "importValidateType", "swagger" : "swagger" } ``` ### リクエストボディ リクエストボディの説明は次の通りです。 | フィールド | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `apiName` | String | Required | APIデプロイの説明 - 1~20文字 | | `apiDescription` | String | Optional | デプロイ対象の APIに作成された Stage ID - 0~300文字 | | `importValidateType` | String | Required | Swaggerファイルをインポートする際にエラーまたは警告が発生した場合、インポートを停止するか、無視してインポートするかを決める - `FAIL_ON_WARN` \| `IGNORE_WARN` - `FAIL_ON_WARN`: 警告失敗 - `IGNORE_WARN`: 警告無視 | | `swagger` | String | Required | インポートする swaggerのすべての値 | ### リクエスト例 リクエストのサンプルコードは次の通りです。 ``` curl -X POST 'https://apigateway.apigw.ntruss.com/api/v1/products/{product-id}/apis/import' \ --header 'Content-Type: application/json' \ --header 'x-ncp-apigw-timestamp: {Timestamp}' \ --header 'x-ncp-iam-access-key: {Access Key}' \ --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \ --data '{ "apiName": "api-***", "apiDescription": "api-*** Description", "importValidateType": "FAIL_ON_WARN", "swagger": "{\n \"openapi\" : \"3.0.1\",\n ~~~ "x-original-swagger-version\" : \"2.0\"\n}" }' ``` ## レスポンス レスポンス形式を説明します。 ### レスポンス構文 レスポンス構文は次の通りです。 ``` { "success": true, "warnMessages": [warnMessages], "errorMessages": [errorMessages], "api": { "productId": "productId", "apiId": "apiId", "apiName": "apiName", "apiDescription": "apiDescription", "tenantId": "tenantId", "modifier": "modifier", "modTime": "2024-05-13T04:13:56Z", "isDeleted": false, "domainCode": "domainCode" } } ``` ### レスポンスステータスコード 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)をご参照ください。 ### レスポンス例 レスポンスのサンプルコードは次の通りです。 ``` { "success": true, "warnMessages": [], "errorMessages": [], "api": { "productId": "*****n0bk", "apiId": "*****ie0xz", "apiName": "api-***", "apiDescription": "api-*** Description", "tenantId": "*****02f55ae4436913a6e2c65bab47c", "modifier": "d12c9fd0-****-****-****-246e96591a38", "modTime": "2024-05-13T04:13:56Z", "isDeleted": false, "domainCode": "PUB" } } ```