For anyone using NodeBB to upload a screenshot from node.js
const buffer = await createImage({ path: `screenshot/annotation:${ annotationID }` , encoding: 'binary' }) const result = await rp({ url: `${ endpoint }/util/upload?_uid=${ _uid }`, method: 'POST', json: true, headers: { Authorization , 'Content-Type': 'multipart/form-data' }, formData: { 'files[]': { value: buffer, options: { filename: `annotaion-${ annotationID }.jpg`, contentType: 'image/jpg' } } }, })Something about doc of the api v3
-
I found the api v3 recently, it is amazing!
I think the doc maybe is not complete when i can't wait to use it.
Here(https://docs.nodebb.org/api/#section/Overview/Authentication) introduced something about the authentication, but it seems like haven't remind this param
_uid
, the request can't work well whitout it.Maybe is my problem I can't find the description about it, so I post this to confrim.
In the end, Thanks for everything you did and doing.