APIs & Integrations

yorambaron
Teilnehmer/-in

Create a file with Python API failed

lösung

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

0 Upvotes
1 Akzeptierte Lösung
yorambaron
Lösung
Teilnehmer/-in

Create a file with Python API failed

lösung

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

Lösung in ursprünglichem Beitrag anzeigen

0 Upvotes
1 Antwort
yorambaron
Lösung
Teilnehmer/-in

Create a file with Python API failed

lösung

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

0 Upvotes