Hi Jaycee
Hope you are doing good!
Q1:-
Here is our sample code
Input parameters (json) we are sending in body
body = {\"inputs\":[{\"properties\":{\"email\":\"raj_test_email@**bleep**.com\",\"firstname\":\"som\",\"lastname\":\"dutt\",\"date_of_birth\":\"1999-1-1\",\"address\":null,\"city\":null,\"state\":\"\",\"country\":\"US\",\"zip\":null,\"website\":null,\"company\":null,\"phone\":\"4556660006\",\"role\":\"Homeowner\",\"home_professional_type\":\"\",\"founding_year\":null,\"hours_of_operation\":null,\"about\":null,\"our_story\":null,\"why_us_\":null,\"vs___date_of_most_recent_order\":null,\"vs___total_orders_placed\":null,\"vs___most_recent_order_spend\":0,\"vs___total_order_spend\":0,\"vs___plan\":\" \",\"vs___plan_subscribe_date\":null,\"calculated_design_style\":null,\"calculated_service_type\":null}}]}
We are using Ruby
api_client = Hubspot::Client.new(access_token: ENV['HUBSPOT_API_KEY'])
properties = self.prepare_properties user
body = {inputs: [{properties: properties}]}
api_response = api_client.crm.contacts.basic_api.create(body: body)
return api_response
Response we are getting from hubspot
api_response = ETHON: performed EASY effective_url=https://api.hubapi.com/crm/v3/objects/contacts response_code=201 return_code=ok total_time=1.474116
#<Hubspot::Crm::Contacts::SimplePublicObject:0x000055ef99a1dab8 @id="61051", @properties={"createdate"=>"2022-11-15T05:19:27.658Z", "hs_all_contact_vids"=>"61051", "hs_is_contact"=>"true", "hs_is_unworked"=>"true", "hs_lifecyclestage_lead_date"=>"2022-11-15T05:19:27.658Z", "hs_object_id"=>"61051", "hs_pipeline"=>"contacts-lifecycle-pipeline", "lastmodifieddate"=>"2022-11-15T05:19:27.658Z", "lifecyclestage"=>"lead"}, @created_at=Tue, 15 Nov 2022 05:19:27 +0000, @updated_at=Tue, 15 Nov 2022 05:19:27 +0000, @archived=false>
Here is screenshot of hubspot contact listing on dashbaord. It’s creating empty (Data we are passing are not getting saved on hubspot) records on hubspot.
We are following this documentation