Bypassing corrupted record

Hi community,

While making Get requests to retrieve contacts data from HubSpot, the script fails after retrieving few records. Following error message is thrown:

InvalidURL: Failed to parse: https://api.hubapi.com{'after’: ‘70602’, ‘link’: ‘https://api.hubapi.com/crm/v3/objects/contacts?after=70602’}

which indicates that a particular record is corrupted.

I want to bypass the reord (70602) and retrieve other contants records from the hubspot. How can I achieve this?

Any help/direction would be highly appreciated.

Thank you

Hi there, @Phi1! Thanks for your question. I have a question and request:

  • What language are you using? Is it Python in this case?
  • Can you share an example request and response along with the error body, please?

Thank you for the additional information! — Jaycee

Hi Jaycee,

Thank you for getting back. I am using Python.

Luckily I managed to sort out the issue. The reason why my call always failed was due to the limit imposed by HubSpot in getting records. I sorted this issue by running a loop and making calls with Limits set to 100. Doing so helped me with my issue.

However one issue I ran into now is that certain fields from Contacts object are not retrievable. For example I wanted to extract OriginalSource information by passing the properties tag as shown below

properties = “phone,company,country,originalsource,contactowner”

endpoint = f"https://api.hubapi.com/crm/v3/objects/contacts?properties={properties}"

However it fails to retrieve originalsource information. I tried using original%20source format as well. Could you help me with this please?

Many thanks