Eagle API Document
  • Overview
  • Application
    • /api/application/info
  • Folder
    • /api/folder/create
    • /api/folder/rename
    • /api/folder/update
    • /api/folder/list
    • /api/folder/listRecent
  • Item
    • /api/item/addFromURL
    • /api/item/addFromURLs
    • /api/item/addFromPath
    • /api/item/addFromPaths
    • /api/item/addBookmark
    • /api/item/info
    • /api/item/thumbnail
    • /api/item/list
    • /api/item/moveToTrash
    • /api/item/refreshPalette
    • /api/item/refreshThumbnail
    • /api/item/update
  • Library
    • /api/library/info
    • /api/library/history
    • /api/library/switch
    • /api/library/icon
  • Examples
    • Using Eagle API with Tampermonkey
  • Changelog
Powered by GitBook
On this page

Was this helpful?

  1. Item

/api/item/update

POST Modify data of specified fields of the item.

What tasks can be done with this function?

  • Text output from the external OCR Tools can be added as tags, annotations to the image, and serve as search conditions for later use.

  • The analysis result of the image generated by external Object Detection Tools can be added in the form of tags, and serve as a search condition.

Fields that can be modified are listed as follows:

Parameter

Description

id

Required, the ID of the item to be modified

tags

Optional, tags

annotation

Optional, annotations

url

Optional, the source url

star

Optional, ratings

Sample Code:

var data = {
    "id": "KBN1X9NHDZ99F",
  "tags": ["Design1", "Design2"],
  "annotation": "Awesome",
  "url": "https://dribbble/com",
  "star": 4
};

var requestOptions = {
  method: 'POST',
  body: JSON.stringify(data),
  redirect: 'follow'
};

fetch("http://localhost:41595/api/item/update", requestOptions)
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Results Returned:

{
    "status": "success",
    "data": {
        "id": "KBN1X9NHDZ99F",
        "name": "Top Character Design Trends for 2019 Bold  Impressive",
        "size": 18447,
        "ext": "jpg",
        "tags": [
            "Design1",
            "Design2"
        ],
        "folders": [
            "KBJJSMMVF9WYL"
        ],
        "isDeleted": false,
        "url": "https://dribbble/com",
        "annotation": "Awesome",
        "modificationTime": 1592621841437,
        "width": 450,
        "height": 545,
        "noThumbnail": true,
        "lastModified": 1592625558780,
        "palettes": [
            {
                "color": [
                    251,
                    244,
                    221
                ],
                "ratio": 80,
                "$$hashKey": "object:678"
            },
            {
                "color": [
                    10,
                    185,
                    202
                ],
                "ratio": 7,
                "$$hashKey": "object:679"
            },
            {
                "color": [
                    26,
                    37,
                    64
                ],
                "ratio": 6,
                "$$hashKey": "object:680"
            },
            {
                "color": [
                    217,
                    83,
                    11
                ],
                "ratio": 4.42,
                "$$hashKey": "object:681"
            },
            {
                "color": [
                    242,
                    200,
                    172
                ],
                "ratio": 0.51,
                "$$hashKey": "object:682"
            },
            {
                "color": [
                    214,
                    170,
                    135
                ],
                "ratio": 0.44,
                "$$hashKey": "object:683"
            },
            {
                "color": [
                    154,
                    208,
                    220
                ],
                "ratio": 0.31,
                "$$hashKey": "object:684"
            }
        ],
        "star": 4
    }
}
Previous/api/item/refreshThumbnailNext/api/library/info

Last updated 4 years ago

Was this helpful?