/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:
1
var data = {
2
"path": "C://Users/User/Downloads/test.jpg",
3
"name": "アルトリア・キャスター",
4
"website": "https://www.pixiv.net/artworks/83585181",
5
"tags": ["FGO", "アルトリア・キャスター"],
6
"annotation": "久坂んむり",
7
"folderId": "KEHB8I2C9F23H"
8
};
9
10
var requestOptions = {
11
method: 'POST',
12
body: JSON.stringify(data),
13
redirect: 'follow'
14
};
15
16
fetch("http://localhost:41595/api/item/addFromPath", requestOptions)
17
.then(response => response.json())
18
.then(result => console.log(result))
19
.catch(error => console.log('error', error));
Copied!
Results Returned:
1
{
2
"status": "success"
3
}
Copied!
Last modified 1yr ago
Copy link