Skip to content

기업용 OpenAPI

로그인 인터페이스

인터페이스 주소요청 방식content-type
/user/loginPOSTapplication/x-www-form-urlencoded
파라미터 이름타입필수 여부설명
usernamestring사용자명
passwordstring비밀번호
  • 로그인 인터페이스에 접근하면 토큰을 얻을 수 있습니다.
  • 모든 OpenAPI(로그인 인터페이스를 제외한)는 인증이 필요합니다.
  • 인증 방법은 요청 헤더에 Authorization 필드를 포함시키며, 그 값은 토큰입니다.

데이터 소스 생성

인터페이스 주소요청 방식Content-Type
/datasource/addPOSTapplication/json
  • 파라미터 예시
json
{
  "note": "local",
  "name": "local-mysql",
  "detail": {
    "type": "mysql",
    "url": "jdbc:mysql://localhost:3306/test?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8",
    "username": "root",
    "password": "root",
    "edit_password": true,
    "driver": "com.mysql.cj.jdbc.Driver",
    "druidProperties": "druid.testWhileIdle=true\ndruid.breakAfterAcquireFailure=true\ndruid.connectionErrorRetryAttempts=3",
    "tableSql": "show tables"
  },
  "type": "jdbc"
}

데이터 소스 삭제

인터페이스 주소요청 방식Content-Type
/datasource/delete/POSTapplication/x-www-form-urlencoded

그룹 생성

인터페이스 주소요청 방식Content-Type
/group/createPOSTapplication/x-www-form-urlencoded
파라미터 이름타입필수 여부설명
namestring그룹 이름

그룹 삭제

인터페이스 주소요청 방식Content-Type
/group/delete/POSTapplication/x-www-form-urlencoded

API 생성

인터페이스 주소요청 방식Content-Type
/apiConfig/addPOSTapplication/json
  • 파라미터 예시
json
{
  "note": "학생 데이터 조회",
  "cachePlugin": {
    "pluginType": 1
  },
  "access": 1,
  "paramsJson": [
    {
      "name": "id",
      "type": "bigint",
      "note": "학생 id"
    }
  ],
  "taskJson": [
    {
      "taskType": 1,
      "sqlList": [
        {
          "sqlText": "select * from student where id = #{id}"
        }
      ],
      "transaction": 0,
      "datasourceId": "5iaIut1Z"
    }
  ],
  "paramRules": [
    {
      "apiId": "J3z0SP59",
      "script": "id > 0",
      "type": "JavaScript",
      "message": "id는 반드시 양수여야 합니다"
    }
  ],
  "groupId": "leqbGt5S",
  "globalTransformPlugin": {
    "pluginType": 3
  },
  "path": "student/all",
  "name": "데이터 조회",
  "alarmPlugins": [
    {
      "pluginType": 2
    }
  ],
  "transformScript": {
    "type": "JavaScript"
  },
  "contentType": "application/x-www-form-urlencoded",
  "jsonParam": "{}"
}

API 수정

인터페이스 주소요청 방식Content-Type
/apiConfig/updatePOSTapplication/json
  • 파라미터 예시
json
{
  "note": "학생 데이터 조회",
  "cachePlugin": {
    "pluginType": 1,
    "apiId": "J3z0SP59"
  },
  "access": 1,
  "paramsJson": [
    {
      "note": "학생 id",
      "name": "id",
      "type": "bigint"
    }
  ],
  "taskJson": [
    {
      "taskType": 1,
      "sqlList": [
        {
          "sqlText": "select * from student where id = #{id}"
        }
      ],
      "transaction": 0,
      "datasourceId": "5iaIut1Z"
    }
  ],
  "paramRules": [
    {
      "id": 1,
      "apiId": "J3z0SP59",
      "script": "id > 0",
      "type": "JavaScript",
      "message": "id는 반드시 양수여야 합니다"
    }
  ],
  "groupId": "leqbGt5S",
  "globalTransformPlugin": {
    "pluginType": 3,
    "apiId": "J3z0SP59"
  },
  "path": "student/all",
  "name": "데이터 조회",
  "alarmPlugins": [
    {
      "pluginType": 2,
      "apiId": "J3z0SP59"
    }
  ],
  "transformScript": {
    "apiId": "J3z0SP59",
    "type": "JavaScript"
  },
  "id": "J3z0SP59",
  "contentType": "application/x-www-form-urlencoded"
}

API 온라인 상태 설정

인터페이스 주소요청 방식Content-Type
/apiConfig/online/POSTapplication/x-www-form-urlencoded

API 오프라인 상태 설정

인터페이스 주소요청 방식Content-Type
/apiConfig/offline/POSTapplication/x-www-form-urlencoded