Create a file with Python API failed

SOLVE
Regular Contributor

Hello,

I tried to use the following Python code to upload a file to HubSpot, the code was copied from this link:

import requests
files = {'files': open('/path/on/your/local-computer/report.xls', 'rb')}
r = requests.post(
    'http://api.hubapi.com/filemanager/api/v2/files?hapikey=demo', 
    data={
        "folder_paths": "folder-in-the-cos-file-manager/subfolder"
         },
    files=files)

I ran this script but there was no response from the Linux shell. In addition I couldn't find  the uploaded file in HubSpot..

 

Questions:

I1. s there a problem with this API example? I saw a few people that asked a simillar question.

2. How do you run this code with the curl command?

 

Thanks,

Yoram

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
Regular Contributor

Please disregard, I found the uploaded files under Marketing/File Manager.

Reply
0 Upvotes
1 Reply 1
Highlighted
Regular Contributor

Please disregard, I found the uploaded files under Marketing/File Manager.

Reply
0 Upvotes