I\'ve been trying to upload a file using the box v2 api with requests.
So far I had little luck though. Maybe someone here can help me see what I\'m actually doing wrong
My solution, using requests:
def upload_to_box(folder_id, auth_token, file_out):
headers = { 'Authorization' : BOX_AUTH.format(auth_token) }
url = 'https://api.box.com/2.0/files/content'
files = { 'filename': (new_file_name, open(file_out,'rb')) }
data = { 'folder_id': folder_id }
response = requests.post(url, params=data, files=files, headers=headers)
It would be nice if you could specify the new_copy
parameter but there's nothing documented for it and it doesn't seem to work.