/api/item/addFromPath

POST Add a local file to Eagle App. If you intend to add multiple items in a row, we suggest you use/api/item/addFromPaths

Parameter

Description

path

Required, the path of the local file.

name

Required, the name of the image to be added.

website

The Address of the source of the image.

annotation

The annotation for the image.

tags

Tags for the image.

folderId

If this parameter is defined, the image will be added to the corresponding folder.

Sample Code:

var data = {
"path": "C://Users/User/Downloads/test.jpg",
"name": "アルトリア・キャスター",
"website": "https://www.pixiv.net/artworks/83585181",
"tags": ["FGO", "アルトリア・キャスター"],
"annotation": "久坂んむり",
"folderId": "KEHB8I2C9F23H"
};
var requestOptions = {
method: 'POST',
body: JSON.stringify(data),
redirect: 'follow'
};
fetch("http://localhost:41595/api/item/addFromPath", requestOptions)
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Results Returned:

{
"status": "success"
}