기업용 OpenAPI
로그인 인터페이스
| 인터페이스 주소 | 요청 방식 | content-type |
|---|---|---|
| /user/login | POST | application/x-www-form-urlencoded |
| 파라미터 이름 | 타입 | 필수 여부 | 설명 |
|---|---|---|---|
| username | string | 예 | 사용자명 |
| password | string | 예 | 비밀번호 |
- 로그인 인터페이스에 접근하면 토큰을 얻을 수 있습니다.
- 모든 OpenAPI(로그인 인터페이스를 제외한)는 인증이 필요합니다.
- 인증 방법은 요청 헤더에 Authorization 필드를 포함시키며, 그 값은 토큰입니다.
데이터 소스 생성
| 인터페이스 주소 | 요청 방식 | Content-Type |
|---|---|---|
| /datasource/add | POST | application/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/ | POST | application/x-www-form-urlencoded |
그룹 생성
| 인터페이스 주소 | 요청 방식 | Content-Type |
|---|---|---|
| /group/create | POST | application/x-www-form-urlencoded |
| 파라미터 이름 | 타입 | 필수 여부 | 설명 |
|---|---|---|---|
| name | string | 예 | 그룹 이름 |
그룹 삭제
| 인터페이스 주소 | 요청 방식 | Content-Type |
|---|---|---|
| /group/delete/ | POST | application/x-www-form-urlencoded |
API 생성
| 인터페이스 주소 | 요청 방식 | Content-Type |
|---|---|---|
| /apiConfig/add | POST | application/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/update | POST | application/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/ | POST | application/x-www-form-urlencoded |
API 오프라인 상태 설정
| 인터페이스 주소 | 요청 방식 | Content-Type |
|---|---|---|
| /apiConfig/offline/ | POST | application/x-www-form-urlencoded |