Hello! I am trying to use the HubSpot API using this method: https://legacydocs.hubspot.com/docs/methods/contacts/merge-contacts.I have a CSV of “New Contact IDs” that need to be merged with the duplicate “Old Contact IDs”, so I am iterating through these to bulk update by replacing the ID in the URL and the vidToMerge ID. However, I keep getting 404 and 405 errors saying the resource is not found. Here is what I have:
import csv import pandas as pd from pandas import * # reading CSV file data = read_csv("sample_import.csv") # converting column data to list main_contacts = data['New_Contact_ID'].tolist() contacts_to_merge = data['Old_Contact_ID'].tolist() for main_id in main_contacts: endpoint = requests.get('https://api.hubapi.com/contacts/v1/contact/merge-vids/{}/?hapikey=xxxx'.format(id)) for old_id in contacts_to_merge: { "vidToMerge": old_id }
submitted by /u/lsignori
[link] [comments]