File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,36 @@ try:
162162except ApiException as e:
163163 print (" Exception when calling cards_api->create: %s \n " % e)
164164```
165+
166+ ### Files API
167+
168+ #### Upload files:
169+ ``` python
170+ import hubspot
171+ import json
172+ from pprint import pprint
173+ from hubspot.crm.contacts import ApiException
174+
175+ client = hubspot.Client.create(access_token = " your_access_token" )
176+
177+ options = json.dumps(
178+ {' access' : ' PRIVATE' ,
179+ " overwrite" : False }
180+ )
181+
182+ try :
183+ response = client.files.files_api.upload(
184+ file = " /file/path/file.jpeg" ,
185+ file_name = " name_in_hubspot" ,
186+ folder_path = " folder_in_hubspot" ,
187+ options = options,
188+ )
189+ pprint(response)
190+
191+ except ApiException as e:
192+ print (" Exception when calling basic_api->get_page: %s \n " % e)
193+ ```
194+
165195## Not wrapped endpoint(s)
166196
167197It is possible to access the hubspot request method directly,
You can’t perform that action at this time.
0 commit comments