POST 将多张图片链接添加至 Eagle 应用。

参数:

参数 说明
items 由多个 item 组成的 array 物件(参考下方说明)
folderId 如果带有此参数,图片将会添加到指定文件夹

**

Item 参数说明:

参数 说明
url 必填,欲添加图片链接,支持 httphttpsbase64
name 必填,欲添加图片名
website 图片来源网址
annotation 图片注释
tags 图片标签
modificationTime 图片创建时间,可以用此参数控制添加后在 Eagle 的排列顺序
headers 选填,自定义 HTTP headers 属性,可用来绕过特定网站保护机制

**

范例代码:

  1. var data = {
  2. "items": [
  3. {
  4. "url": "https://cdn.dribbble.com/users/674925/screenshots/12020761/media/6420a7ec85751c11e5254282d6124950.png",
  5. "name": "Work",
  6. "website": "https://dribbble.com/shots/12020761-Work",
  7. "tags": ["Illustration", "Design"],
  8. "modificationTime": 1591325171767,
  9. "headers": {
  10. "referer": "dribbble.com"
  11. }
  12. },
  13. {
  14. "url": "https://cdn.dribbble.com/users/674925/screenshots/12061400/media/71da9ba40c47f09d8cd6953d661e61fd.png",
  15. "name": "Work2",
  16. "website": "https://dribbble.com/shots/12061400-work2",
  17. "tags": ["Illustration", "Design"],
  18. "modificationTime": 1591325171766,
  19. "headers": {
  20. "referer": "dribbble.com"
  21. }
  22. }
  23. ],
  24. "folderId": "KAY6NTU6UYI5Qa"
  25. };
  26. var requestOptions = {
  27. method: 'POST',
  28. body: JSON.stringify(data),
  29. redirect: 'follow'
  30. };
  31. fetch("http://localhost:41595/api/item/addFromURLs", requestOptions)
  32. .then(response => response.json())
  33. .then(result => console.log(result))
  34. .catch(error => console.log('error', error));

返回结果:

  1. {
  2. "status": "success"
  3. }