Skip to content

Open API V1 beta

Added in v1.4.0-beta24-04-11+, if you are a developer, you can implement the corresponding functions of Sun-Panel by calling the API.

IMPORTANT

All interfaces adopt the POST request method. API requests require token authentication. Please use the management account to find the OpenAPI application in Sun-Panel to obtain the token.

Header Parameters

ParameterExample ValueDescription
tokenieyqw0x9nngzukrrmivx84hj7l2xkr1t-

API Interfaces

Create Project

URL

/openapi/v1/item/create

Request Content

Parameter Explanation

ParameterExample ValueParameter TypeRequiredDescription
iconUrlhttps://baidu.com/favicon.icoStringYesImage URL
titleBaiduStringYesTitle
onlyNametest_baiduStringNoUnique Identifier
urlhttps://baidu.comStringYesURL
lanUrl-StringNoIntranet URL
description-StringNoDescription
Content Example
json
{
    "iconUrl":"",
    "title": "Baidu",
    "onlyName": "test_baidu",
    "url": "https://baidu.com",
    "lanUrl": "",
    "description": ""
}

Success Response

Content Example
javascript
{
    "code": 0,
    "msg": "OK"
}

Error Response

Possible error codes: 1202. For the specific meanings of error codes, click here.

Content Example
javascript
{
    "code": 1202,
    "msg": "..."
}

Retrieve Project Information by Unique Identifier

URL

/openapi/v1/item/getInfoByOnlyName

Request Content

Parameter Explanation

ParameterExample ValueParameter TypeRequiredDescription
onlyNametest_baiduStringYesUnique Identifier
Content Example
json
{
    "onlyName": "test_baidu"
}

Success Response

Parameter Explanation

ParameterExample ValueParameter TypeDescription
iconUrl-StringImage URL
titleBaiduStringTitle
onlyNametest_baiduStringUnique Identifier
urlhttps://baidu.comStringURL
lanUrl-StringIntranet URL
description-StringDescription
Content Example
javascript
{
    "code": 0,
    "data": {
        "iconUrl": "",
        "title": "Baidu",
        "onlyName": "test_baidu",
        "url": "https://baidu.com",
        "lanUrl": "",
        "description": ""
    },
    "msg": "OK"
}

Error Response

Possible error codes: 1203. For the specific meanings of error codes, click here.

Content Example
javascript
{
    "code": 1203,
    "msg": "..."
}

Update Project

URL

/openapi/v1/item/update

Request Content

Parameter Explanation

ParameterExample ValueParameter TypeRequiredDescription
onlyNametest_baiduStringYesUnique Identifier
iconUrlhttps://baidu.com/favicon.icoStringYesImage URL
titleBaiduStringYesTitle
urlhttps://baidu.comStringYesURL
lanUrl-StringNoIntranet URL
description-StringNoDescription
Content Example
json
{
    "iconUrl":"",
    "title": "Baidu",
    "onlyName": "test_baidu",
    "url": "https://baidu.com",
    "lanUrl": "",
    "description": ""
}

Success Response

Parameter Explanation

ParameterExample ValueParameter TypeDescription
iconUrl-StringImage URL
titleBaiduStringTitle
onlyNametest_baiduStringUnique Identifier
urlhttps://baidu.comStringURL
lanUrl-StringIntranet URL
description-StringDescription
Content Example
javascript
{
    "code": 0,
    "data": {
        "iconUrl": "",
        "title": "Baidu",
        "onlyName": "test_baidu",
        "url": "https://baidu.com",
        "lanUrl": "",
        "description": ""
    },
    "msg": "OK"
}

Error Response

Possible error codes: 1202, 1203. For the specific meanings of error codes, click here.

Content Example
javascript
{
    "code": 1202,
    "msg": "..."
}

Released under the MIT License.