APIs & Integrations

yorambaron
Participant

Upload a file into HubSpot via the API is stuck from time to time

Hello,

 

I ran the following Python script to upload a file by the HubSpot API.

From time to time the script is stuck, did anyone experience a simillar problem?

 

The Python script is listed below:

import requests
import json
import sys


input = str(sys.argv[1])
files = {'files': open(input, 'rb')}
r = requests.post(
'http://api.hubapi.com/filemanager/api/v2/files?hapikey=<key>',
data={
"folder_paths": "<folder>"
},
files=files)

 

Thanks, Yoram

0 Upvotes
4 Replies 4
taran42
Contributor

Upload a file into HubSpot via the API is stuck from time to time

I am not familiar with uploading files into Hubspot. I'd say it could be a resource thing on the machine you're running the script; perhaps there's not enough resources available to finish the operation. It could also be a hiccup in the connection to Hubspot, killing the operation during transit. Those are my guesses without knowing more about uploading into Hubspot and the fact that it seems to be a random occurance.

dennisedson
HubSpot Product Team
HubSpot Product Team

Upload a file into HubSpot via the API is stuck from time to time

@taran42 , do you see something amiss here?

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Upload a file into HubSpot via the API is stuck from time to time

@yorambaron ,

Can you define "stuck"? Are you getting error messages or anytihng?

 

0 Upvotes
yorambaron
Participant

Upload a file into HubSpot via the API is stuck from time to time

Hi Dennis,

It means that the operation has never completed.

 

Regards,

Yoram

0 Upvotes