I can successfully create the note.
I now need to upload the file and then link to the note.
Which I think I can do with this endpoint:
"/rest/v11_20/Notes/5f95bbe8-cd49-11ee-b015-fa163ec72422/file/filename"
I'm POSTing a file using FormData from my app and handling this on my NodeJS server.
Here I use axios to call the Endpoint above.
However, whatever format I pass the file in, I get either a 400 or a 422 returned from the Sugar API.
I've tried several things:
- setting. removing / changing content-type
- setting / removing content disposition
- pass file as raw File, FormData, Buffer
// this adds in basepath and sets api version const fileUrl = getFileUrl(config, noteId) const fileResponse = await axios.post(fileUrl, file, { headers: { 'OAuth-Token': accessToken, }, });
Has anybody had success doing this? Can you share your code?
Thanks