Firstly, welcome to the community. I presume that you’re (planning on) using the V8 Api?
From your example, I can’t see whether you have already configured your client and received your OAuth token? Once you’ve done that, then you can start using the rest interface.
Can you give us an idea as to exactly how far you’ve got with the setup and test process. What error are you getting and where is it going wrong for you?
I find that an excellent reference on how to get the best possible support for errors/bugs/problems is by following the guidelines outlined here:
Firstly, I know that the interface version API v4.1 has been updated substantially in the latest v8 API.
wrt to API v4.1:
There is:
set_note_attachment
that might help.
You could also try get_module fields for the Documents module? That might provide a bit more insight into what data you need to provide (and the correct names for those fields)?
I’d expect that you’d use the Documents module to upload the document, and then use the set_relationship to point to the document that you’ve uploaded?
Is there a download files method available with API? It should give us something as we authenticate user and pass session id so a genuine Access to a Document/File/Image should be there to allow admins to abstract some data outside CRM framework.