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

Fix default company properties #26

Closed

Conversation

joidegn
Copy link

@joidegn joidegn commented Dec 18, 2023

What to do

The property types for the company model seems to be incorrect. This fixes them.

Apologies about messing up the other PR.

Background

For unclear reasons Hubspot uses strings for basically everything.

Here is an example for a response from them to confirm this:

{\"id\":\"15278289572\",\"properties\":{\"about_us\":null,\"address\":\"Am Mainufer\",\"address2\":null,\"annualrevenue\":null,\"city\":\"Frankfurt\",\"closedate\":null,\"country\":null,\"createdate\":\"2023-03-24T09:21:14.582Z\",\"days_to_close\":null,\"description\":null,\"domain\":\"piedpiper.finn.com\",\"engagements_last_meeting_booked\":null,\"engagements_last_meeting_booked_campaign\":null,\"engagements_last_meeting_booked_medium\":null,\"engagements_last_meeting_booked_source\":null,\"facebook_company_page\":null,\"facebookfans\":null,\"first_contact_createdate\":\"2020-10-17T15:04:23.187Z\",\"first_conversion_date\":\"2022-02-21T17:34:56.897Z\",\"first_conversion_event_name\":\"b2b: B2B Form\",\"first_deal_created_date\":\"2023-03-24T09:35:15.784Z\",\"founded_year\":null,\"googleplus_page\":null,\"hs_analytics_first_timestamp\":\"2020-10-17T15:04:23.176Z\",\"hs_analytics_first_touch_converting_campaign\":null,\"hs_analytics_first_visit_timestamp\":\"2022-02-22T13:39:05.891Z\",\"hs_analytics_last_timestamp\":\"2023-11-30T15:58:37.552Z\",\"hs_analytics_last_touch_converting_campaign\":null,\"hs_analytics_last_visit_timestamp\":\"2023-11-30T15:58:37.552Z\",\"hs_analytics_latest_source\":\"DIRECT_TRAFFIC\",\"hs_analytics_latest_source_data_1\":\"www.finn.com/de-de\",\"hs_analytics_latest_source_data_2\":\"\",\"hs_analytics_latest_source_timestamp\":\"2023-11-30T15:58:37.552Z\",\"hs_analytics_num_page_views\":\"4803\",\"hs_analytics_num_visits\":\"615\",\"hs_analytics_source\":\"OFFLINE\",\"hs_analytics_source_data_1\":\"SALES\",\"hs_analytics_source_data_2\":\"EMAIL_INTEGRATION\",\"hs_created_by_user_id\":\"25543598\",\"hs_createdate\":null,\"hs_ideal_customer_profile\":null,\"hs_is_target_account\":null,\"hs_last_booked_meeting_date\":\"2022-09-12T08:30:00Z\",\"hs_last_logged_call_date\":null,\"hs_last_open_task_date\":\"2023-04-13T06:00:00Z\",\"hs_last_sales_activity_timestamp\":null,\"hs_lastmodifieddate\":\"2023-12-07T15:36:30.343Z\",\"hs_lead_status\":null,\"hs_merged_object_ids\":null,\"hs_num_blockers\":\"0\",\"hs_num_child_companies\":\"0\",\"hs_num_contacts_with_buying_roles\":\"0\",\"hs_num_decision_makers\":\"0\",\"hs_num_open_deals\":\"2\",\"hs_object_id\":\"15278289572\",\"hs_parent_company_id\":\"\",\"hs_total_deal_value\":\"\",\"hubspot_owner_assigneddate\":\"2023-12-01T10:03:04.047Z\",\"hubspot_owner_id\":\"107981110\",\"hubspot_team_id\":\"586140\",\"industry\":null,\"is_public\":null,\"lifecyclestage\":\"lead\",\"linkedin_company_page\":null,\"linkedinbio\":null,\"name\":\"Pied Piper\",\"notes_last_contacted\":\"2023-10-10T11:44:00.592Z\",\"notes_last_updated\":\"2023-10-10T11:44:00.592Z\",\"notes_next_activity_date\":\"\",\"num_associated_contacts\":\"49\",\"num_associated_deals\":\"8\",\"num_contacted_notes\":\"27\",\"num_conversion_events\":\"53\",\"numberofemployees\":null,\"phone\":\"+4917634194402\",\"recent_conversion_date\":\"2023-10-16T13:29:33.228Z\",\"recent_conversion_event_name\":\"PDP: Coming Soon: Deal Creation Form\",\"recent_deal_amount\":null,\"recent_deal_close_date\":\"\",\"state\":null,\"timezone\":null,\"total_money_raised\":null,\"total_revenue\":\"\",\"twitterbio\":null,\"twitterfollowers\":null,\"twitterhandle\":null,\"type\":null,\"web_technologies\":null,\"website\":\"piedpiper.finn.com\",\"zip\":\"60321\"},\"createdAt\":\"2023-03-24T09:21:14.582Z\",\"updatedAt\":\"2023-12-07T15:36:30.343Z\",\"archived\":false}

Acceptance criteria

It's possible to request Companies data from the CRM endpoints.

…es-for-company-object

Add default properties for company object
@kk-no kk-no self-requested a review December 18, 2023 09:35
@joidegn joidegn force-pushed the fix-default-company-properties branch from c6707c8 to 2528725 Compare December 18, 2023 09:37
@kk-no
Copy link
Member

kk-no commented Dec 22, 2023

@joidegn
Thank you for the pull request (2nd!), but since it's the end of the year, the review may be a little late, so please bear with me.
I'm thinking of using HsStr instead of HsInt, or using a format that can be marshaled to HsInt, but I'll check how it works.

@joidegn
Copy link
Author

joidegn commented Dec 22, 2023

Yeah no problem at all.

Im using this branch for now where I need this to work but you can of course use any other way to fix it and then I'll close this MR.

@kk-no
Copy link
Member

kk-no commented Dec 27, 2023

@joidegn
Sorry for late reply.
I used go-hubspot v0.7.0 to call the HubSpot Company API and confirmed that the unmarshal error recurs on my local machine.

I'm thinking of implementing UnmarshalJSON(b []byte) error in HsInt and starting a new pull request myself, but what do you think?

@joidegn
Copy link
Author

joidegn commented Dec 27, 2023

Yep that sounds good to me! Happy to close this one.

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

Successfully merging this pull request may close these issues.

2 participants