How to upload file to Connect using API?

How to upload file to Connect using API?

Hi there. I looked at the API documentation and nowhere did it mention how to use the API method to upload a file even though it is mentioned that it is possible to be done so. Please help.