How to upload files through the API?

Is there a message that goes with the response? That should give you more information.