Skip to content

Icon Card Related

Through this page's API, you can add and modify icon cards.

Create a Project

URL

/openapi/v1/item/create

Request Content

Parameter Description

Parameter NameExample ValueParameter TypeRequiredParameter Description
onlyNametest_baiduStringNoUnique identifier
iconUrlhttps://xxx.cc/favicon.icoStringNoImage URL
titleBaiduStringNoTitle
urlhttps://xxx.ccStringYesURL
lanUrl-StringNoIntranet URL
description-StringNoDescription
itemGroupID1intNoGroup ID
Either itemGroupID or itemGroupOnlyName
itemGroupID is preferred
Supported from v1.7.*
itemGroupOnlyNamegroup1StringNoGroup unique identifier
Either itemGroupID or itemGroupOnlyName
itemGroupID is preferred
Supported from v1.7.*
isSaveIcontruebooleanNoWhether to save the icon to the project locally
Default: false
If true, it will force save and update
Supported from v1.7.*
Content Example
json
{
    "iconUrl":"",
    "title": "Baidu",
    "onlyName": "test_baidu",
    "url": "https://xxx.cc", 
    "lanUrl": "",
    "description": "",
    "itemGroupID": 100,// Group ID, either with itemGroupOnlyName
    // "itemGroupOnlyName": "sun-app",// Group unique identifier, either with itemGroupID
    "isSaveIcon": true
}

Successful Response

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

Error Response

Possible error code: 1202, for specific meanings of error codes, click here

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

Query Project Information by Unique Identifier

URL

/openapi/v1/item/getInfoByOnlyName

Request Content

Parameter Description

Parameter NameExample ValueParameter TypeRequiredParameter Description
onlyNametest_baiduStringYesUnique identifier
Content Example
json
{
    "onlyName": "test_baidu"
}

Successful Response

Parameter Description

Parameter NameExample ValueParameter TypeParameter Description
iconUrl-StringImage URL
titleBaiduStringTitle
onlyNametest_baiduStringUnique identifier
urlhttps://xxx.ccStringURL
lanUrl-StringIntranet URL
description-StringDescription
itemGroupID1intGroup ID Supported from v1.7.*
itemGroupOnlyNamegroup1StringGroup unique identifier Supported from v1.7.*
Content Example
javascript
{
    "code": 0,
    "data": {
        "iconUrl": "",
		"title": "Sun-Panel",
		"onlyName": "sun-panel008",
		"url": "https://sun-panel.top", 
		"lanUrl": "",
		"description": "",
		"itemGroupID": 40,
		"itemGroupOnlyName": "neizhi-app",
    },
    "msg": "OK"
}

Error Response

Possible error code: 1203, for specific meanings of error codes, click here

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

Modify a Project

URL

/openapi/v1/item/update

Request Content

Parameter Description

Parameter NameExample ValueParameter TypeRequiredParameter Description
onlyNametest_baiduStringYesUnique identifier
iconUrlhttps://xxx.cc/favicon.icoStringNoImage URL
titleBaiduStringNoTitle
urlhttps://xxx.ccStringNoURL
lanUrl-StringNoIntranet URL
description-StringNoDescription
itemGroupID1intNoGroup ID
Either itemGroupID or itemGroupOnlyName
itemGroupID is preferred
Supported from v1.7.*
itemGroupOnlyNamegroup1StringNoGroup unique identifier
Either itemGroupID or itemGroupOnlyName
itemGroupID is preferred
Supported from v1.7.*
isSaveIcontruebooleanNoWhether to save the icon to the project locally
Default: false
If true, it will force save and update
Supported from v1.7.*
Content Example
json
{
    "iconUrl":"",
    "title": "Baidu",
    "onlyName": "test_baidu",
    "url": "https://xxx.cc", 
    "lanUrl": "",
    "description": "",
    "itemGroupID": 100,// Group ID, either with itemGroupOnlyName
    // "itemGroupOnlyName": "sun-app",// Group unique identifier, either with itemGroupID
    "isSaveIcon": true
}

Successful Response

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

Error Response

Possible error codes: 1202, 1203, for specific meanings of error codes, click here

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

Batch Modify Projects

Batch multiple modification requests into a single call. Supported from v2.0.0-dev-13+

URL

/openapi/v1/item/batchUpdate

Request Content

Parameter Description

Parameter NameExample ValueParameter TypeRequiredParameter Description
items-ArrayYesArray of project cards, at least 1 item
items[].onlyNametest_baiduStringYesUnique identifier
items[].iconUrlhttps://xxx.cc/favicon.icoStringNoImage URL
items[].titleBaiduStringNoTitle
items[].urlhttps://xxx.ccStringNoURL
items[].lanUrl-StringNoIntranet URL
items[].description-StringNoDescription
items[].itemGroupID1intNoGroup ID
Either itemGroupID or itemGroupOnlyName
itemGroupID is preferred
items[].itemGroupOnlyNamegroup1StringNoGroup unique identifier
Either itemGroupID or itemGroupOnlyName
itemGroupID is preferred
items[].isSaveIcontruebooleanNoWhether to save the icon to the project locally
Default: false
If true, it will force save and update
Content Example
json
{
    "items": [
        {
            "onlyName": "test_baidu",
            "title": "Baidu",
            "url": "https://xxx.cc",
            "iconUrl": "https://xxx.cc/favicon.ico",
            "lanUrl": "",
            "description": ""
        },
        {
            "onlyName": "test_github",
            "title": "GitHub",
            "url": "https://github.com",
            "itemGroupID": 100
        }
    ]
}

Response Data

Other items will not be affected even if some fail. When all succeed, failCount is 0 and failItems is an empty array.

Parameter Description

Parameter NameExample ValueParameter TypeParameter Description
successCount1intNumber of successfully updated items
failCount1intNumber of failed items
failItems-ArrayList of failed items
failItems[].onlyNametest_baiduStringUnique identifier of the failed item
failItems[].erroritem not foundStringFailure reason
Content Example
javascript
{
    "code": 0,
    "data": {
        "successCount": 1,
        "failCount": 1,
        "failItems": [
            {
                "onlyName": "test_baidu",
                "error": "item not found"
            }
        ]
    },
    "msg": "OK"
}

Error Response

Possible error code: 1001 (parameter format error), for specific meanings of error codes, click here

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

Released under the MIT License.