Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FilesAPI : 'Client' object has no attribute 'select_header_accept' #243

Open
DataDigitalisim opened this issue Oct 18, 2023 · 0 comments
Open

Comments

@DataDigitalisim
Copy link

Hi everyone :)

I'm trying to push documents to Hubspot through the FilesAPI. Here is my code :

Load the libraries:
import hubspot from hubspot.files.files.api.files_api import FilesApi

Load the file :
with open("data/<mypath>.pdf", "rb") as f: file = f.read()

Get my client
api_client = hubspot.Client.create(access_token=<mytoken>)

Get the fileAPi
api = FilesApi( api_client=api_client, )

Post a document :
response = api.upload( file=file, folder_path="/")

This code gives me the following error :
File "./python3.11/site-packages/hubspot/files/files/api/files_api.py", line 1253, in upload_with_http_info header_params["Accept"] = self.api_client.select_header_accept(["application/json", "*/*"]) # noqa: E501 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'Client' object has no attribute 'select_header_accept'

Has anyone ever had this error?

I tried those versions of hubspot-api-python, got the same error :

  • 8.1.1
  • 7.5.0

Thanks a lot ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant