#I changed the URL of the list and named the sections with numbers in themĪddList = " ID NUMBER/add?hapikey=YOUR API KEY"Ĭsv_reader = csv.reader(csv_file, delimiter=',') #2: Adding contacts to a list using email addresses Response = requests.request("POST", url, data=payload, files=files) Relative_path = "File Name" #File name goes here tooĪbsolute_file_path = os.path.join(current_dir, relative_path) "idColumnType": "HUBSPOT_ALTERNATE_ID", #This is the primary identifier for the import "ignored": True, #'True' means the column will NOT be imported, all of the items below "columnName" can be labled "None" "propertyName": "lastname", #This matches the import field property name "columnName": "Last Name", #This matches the file "ignored": False, #'False' means the column WILL be imported "fileName": "File Name", #Name of the file you want to import I had the best luck when the file was in the same directory as the script "name": "Import_Name", #this should be named the same as the target import # Items in all caps in URLs will need to be changed by you Sixth (line 166), Removing contacts from a workflow Fifth (152), Adding contacts to a workflow. Fourth (line 144), Getting workflow information (I have this as a separate script, but included it here for completeness).
Third (line 110), Removing contacts from a list using a. Second (line 72), Adding contacts to a list using the same.
#Python rss feed reader code
They will also note which sections of code to what.
# READ ME: The inline comments will contain notes, hints and instructions. One portion of the following script is its own separate file, but I included it because of its necissity for the workflow portions.Ĭomments, suggestions and improvements are greatly appreciated. I would comment out/delete the sections that were not needed to complete a particular task. The following is the code I assembled to manage all of the HubSpot manipulations I needed.