Apifox 开放 API
  1. 导入导出
Apifox 开放 API
  • 介绍 👋
  • API 版本
  • 鉴权
  • 导入导出
    • 导入 OpenAPI/Swagger 格式数据
      POST
    • 导入 Postman Collection 格式数据
      POST
    • 导出 OpenAPI/Swagger 格式数据
      POST
  1. 导入导出

导入 Postman Collection 格式数据

POST
https://api.apifox.com/v1/projects/{projectId}/import-postman-collection
当前支持导入 Postman Collection v2 格式数据。
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'https://api.apifox.com/v1/projects/{{projectId}}/import-postman-collection?locale=zh-CN' \
--header 'X-Apifox-Api-Version;' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
   "input":"{\"info\":{\"name\":\"Swagger Petstore\",\"description\":\"This is a sample server Petstore server.\",\"schema\":\"https://schema.getpostman.com/json/collection/v2.1.0/collection.json\"},\"item\":[],\"variable\":[{\"key\":\"baseUrl\",\"value\":\"//petstore.swagger.io/v2\",\"type\":\"string\"}]}",
   "options":{
      "targetEndpointFolderId":0,
      "endpointOverwriteBehavior":"OVERWRITE_EXISTING",
      "endpointCaseOverwriteBehavior":"OVERWRITE_EXISTING",
      "updateFolderOfChangedEndpoint":false
   }
}'
响应示例响应示例
成功示例
{
    "data": {
        "counters": {
            "endpointCreated": 10,
            "endpointUpdated": 0,
            "endpointFailed": 0,
            "endpointIgnored": 0,
            "endpointFolderCreated": 0,
            "endpointFolderUpdated": 0,
            "endpointFolderFailed": 0,
            "endpointFolderIgnored": 0,
            "endpointCaseCreated": 0,
            "endpointCaseUpdated": 0,
            "endpointCaseFailed": 0,
            "endpointCaseIgnored": 0
        }
    }
}

请求参数

Path 参数

Query 参数

Header 参数

Body 参数application/json

示例

返回响应

🟢200成功
application/json
Body

修改于 2024-12-04 04:31:41
上一页
导入 OpenAPI/Swagger 格式数据
下一页
导出 OpenAPI/Swagger 格式数据
Built with