I found this post very helpful it is exactly what I'm looking for Update category picture (via image upload) API not working
I noticed that the IP address used to start my instance of NodeBB also effects the results of my cURL endpoints.
http://127.0.0.1:4567/api/admin/manage/uploads
{"status":{"code":"not-authorised","message":"A valid login session was not found. Please log in and try again."},"response":{}}
http://localhost:4567/api/admin/manage/uploads
"currentFolder":"","showPids":false,"files":[{"name":"category","path":"category","url":"/assets/uploads/category","fileCount":0,"size":4096,"sizeHumanReadable":"4.0KiB","isDirectory":true,"isFile":false,"mtime":1670090052269.7588},{"name":"emoji","path":"emoji","url":"/assets/uploads/emoji","fileCount":0,"size":4096,"sizeHumanReadable":"4.0KiB","isDirectory":true,"isFile":false,"mtime":1670090123333.093},{"name":"files","path":"files","url":"/assets/uploads/files","fileCount":2,"size":4096,"sizeHumanReadable":"4.0KiB","isDirectory":true,"isFile":false,"mtime":1670125300133.004},{"name":"profile","path":"profile","url":"/assets/uploads/profile","fileCount":0,"size":4096,"sizeHumanReadable":"4.0KiB","isDirectory":true,"isFile":false,"mtime":1670090052269.7588},{"name":"sounds","path":"sounds","url":"/assets/uploads/sounds","fileCount":0,"size":4096,"sizeHumanReadable":"4.0KiB","isDirectory":true,"isFile":false,"mtime":1670090052269.7588},{"name":"system","path":"system","url":"/assets/uploads/system","fileCount":1,"size":4096,"sizeHumanReadable":"4.0KiB","isDirectory":true,"isFile":false,"mtime":1670090095112.16}],"breadcrumbs":[{"text":"Uploads","url":"/admin/manage/uploads"}],"pagination":{"prev":{"page":1,"active":false},"next":{"page":1,"active":false},"first":{"page":1,"active":true},"last":{"page":1,"active":true},"rel":[],"pages":[],"currentPage":1,"pageCount":1},"loggedIn":true,"relative_path":"","template":{"name":"admin/manage/uploads","admin/manage/uploads":true},"url":"/admin/manage/uploads","bodyClass":"page-admin page-admin-manage page-admin-uploads page-status-200 theme-persona user-loggedin","_header":{"tags":{"meta":[{"name":"viewport","content":"width=device-width, initial-scale=1.0"},{"name":"content-type","content":"text/html; charset=UTF-8","noEscape":true},{"name":"apple-mobile-web-app-capable","content":"yes"},{"name":"mobile-web-app-capable","content":"yes"},{"property":"og:site_name","content":"NodeBB"},{"name":"msapplication-badge","content":"frequency=30; polling-uri=http://192.168.0.41:4567/sitemap.xml","noEscape":true},{"name":"theme-color","content":"#ffffff"},{"property":"og:image","content":"http://192.168.0.41:4567/assets/images/[email protected]","noEscape":true},{"property":"og:image:url","content":"http://192.168.0.41:4567/assets/images/[email protected]","noEscape":true},{"property":"og:image:width","content":"963"},{"property":"og:image:height","content":"225"},{"content":"NodeBB","property":"og:title"},{"content":"http://192.168.0.41:4567/api/admin/manage/uploads","property":"og:url"}],"link":[{"rel":"icon","type":"image/x-icon","href":"/assets/uploads/system/favicon.ico?v=8lgptiu7o1i"},{"rel":"manifest","href":"/manifest.webmanifest","crossorigin":"use-credentials"},{"rel":"apple-touch-icon","href":"/assets/images/touch/512.png"},{"rel":"icon","sizes":"36x36","href":"/assets/images/touch/36.png"},{"rel":"icon","sizes":"48x48","href":"/assets/images/touch/48.png"},{"rel":"icon","sizes":"72x72","href":"/assets/images/touch/72.png"},{"rel":"icon","sizes":"96x96","href":"/assets/images/touch/96.png"},{"rel":"icon","sizes":"144x144","href":"/assets/images/touch/144.png"},{"rel":"icon","sizes":"192x192","href":"/assets/images/touch/192.png"},{"rel":"icon","sizes":"512x512","href":"/assets/images/touch/512.png"},{"rel":"prefetch","href":"/assets/src/modules/composer.js?v=8lgptiu7o1i"},{"rel":"prefetch","href":"/assets/src/modules/composer/uploads.js?v=8lgptiu7o1i"},{"rel":"prefetch","href":"/assets/src/modules/composer/drafts.js?v=8lgptiu7o1i"},{"rel":"prefetch","href":"/assets/src/modules/composer/tags.js?v=8lgptiu7o1i"},{"rel":"prefetch","href":"/assets/src/modules/composer/categoryList.js?v=8lgptiu7o1i"},{"rel":"prefetch","href":"/assets/src/modules/composer/resize.js?v=8lgptiu7o1i"},{"rel":"prefetch","href":"/assets/src/modules/composer/autocomplete.js?v=8lgptiu7o1i"},{"rel":"prefetch","href":"/assets/templates/composer.tpl?v=8lgptiu7o1i"},{"rel":"prefetch","href":"/assets/language/en-GB/topic.json?v=8lgptiu7o1i"},{"rel":"prefetch","href":"/assets/language/en-GB/modules.json?v=8lgptiu7o1i"},{"rel":"prefetch","href":"/assets/language/en-GB/tags.json?v=8lgptiu7o1i"},{"rel":"prefetch stylesheet","type":"","href":"/assets/plugins/nodebb-plugin-markdown/styles/default.css"},{"rel":"prefetch","href":"/assets/language/en-GB/markdown.json?v=8lgptiu7o1i"},{"rel":"stylesheet","href":"http://192.168.0.41:4567/assets/plugins/nodebb-plugin-emoji/emoji/styles.css?v=8lgptiu7o1i"}]}},"widgets":{"footer":[{"html":"<footer id=\"footer\" class=\"container footer\">\r\n\t<div>\r\n\t\tPowered by <a target=\"_blank\" href=\"https://nodebb.org\">NodeBB</a> | <a target=\"_blank\" href=\"//github.com/NodeBB/NodeBB/graphs/contributors\">Contributors</a>\r\n\t</div>\r\n</footer>"}]}}
http://192.168.0.41:4567/api/admin/manage/uploads
{}
I'm looking at another post that allows the cURL https://curlconverter.com/ to be copied from the Chrome Developer Tools
curl http://localhost:4567/api/config -c cookies.txt -s | grep -oP "(csrf_token.+?,)"
csrf_token":"rvdKyoNf-N4cJqlHQq5mljvF6G_RHZsj-yKw",
http://localhost:4567/api/v3/categories/1
{"status":{"code":"ok","message":"OK"},"response":{"cid":1,"name":"Announcements","description":"Announcements regarding our community","descriptionParsed":"<p>Announcements regarding our community</p>\n","icon":"fa-bullhorn","bgColor":"#fda34b","color":"#ffffff","slug":"1/announcements","parentCid":0,"topic_count":13,"post_count":13,"disabled":0,"order":1,"link":"","numRecentReplies":1,"class":"col-md-3 col-xs-6","imageClass":"cover","isSection":0,"subCategoriesPerPage":10,"minTags":0,"maxTags":5,"postQueue":0,"totalPostCount":13,"totalTopicCount":13}}
curl \
-H "Authorization: Bearer 9413a049-8faa-49c0-8694-1eda2d93c4b0" \
-F params='{"cid":"1", "uid":"1", "_uid":"1"}' \
-F "files[]=@/mnt/c/Users/Terry/Downloads/walrus.jpg" \
-F "_csrf=rvdKyoNf-N4cJqlHQq5mljvF6G_RHZsj-yKw" \
-F "csrf_token=rvdKyoNf-N4cJqlHQq5mljvF6G_RHZsj-yKw" \
-b cookies.txt \
-X POST http://localhost:4567/api/admin/category
Is currently giving me an error from the solution at Update category picture (via image upload) API not working
{"path":"/api/admin/category","error":"[[error:api.master-token-no-uid]]","bodyClass":"page-admin page-admin-category page-status-500 theme-persona user-guest"}
Thank you