Update contact property from date to datetime with Hubspot API

ramanverma2005
Participant

Hello Team,

I have the contact property with its type ‘date’ and I want to convert that to datetime and I did that as well and api returned 200 response but unable to check where it has been updated and where I should check it workflow.
$data =array( ‘name’ => ‘Became Attempted to Contact’,
‘groupName’ => ‘sdr_tracking’,
‘description’ => ‘DO NOT TOUCH THIS FIELD’,
“type” => “date”,
“fieldType” => “datetime”,
“formField” => false ,
);
$url=“https://api.hubapi.com/contacts/v1/properties/became_attempted_to_contact?hapikey=123”;

0 Upvotes
16 Replies 16
3PETE
HubSpot Employee

@Raman_verma You get use the get a property end point to see what it’s current settings are.

0 Upvotes
ramanverma2005
Participant

sorry I did not get you

0 Upvotes
3PETE
HubSpot Employee

@Raman_verma After you have updated your contact property you can check if it is a date time field using the link I posted above.

0 Upvotes
ramanverma2005
Participant

Hi, I am getting this response but in workflow when I select it does not show the time showing only date

{“name”:“became_attempted_to_contact”,“label”:“Became Attempted to Contact”,“description”:“DO NOT TOUCH THIS FIELD”,“groupName”:“sdr_tracking”,“type”:“date”,“fieldType”:“datetime”,“updatedUserId”:,“options”:[],“deleted”:false,“createdUserId”:,“formField”:false,“displayOrder”:1,“readOnlyValue”:false,“readOnlyDefinition”:false,“hidden”:false,“mutableDefinitionNotDeletable”:false,“favorited”:false,“calculated”:false,“favoritedOrder”:-1,“externalOptions”:false,“displayMode”:“current_value”}

0 Upvotes
3PETE
HubSpot Employee

@Raman_verma You might want to try converting it to the unix epoc time in milliseconds. I know our internal datetime fields use that as a format.

0 Upvotes
ramanverma2005
Participant

sorry again I did not get you … I just want to show the time along with date thats it in workflow during selection

0 Upvotes
3PETE
HubSpot Employee

@Raman_verma How are you entering in the time now?

0 Upvotes
ramanverma2005
Participant

please check the attached screen shot its date time field but showing date only in workflow

0 Upvotes
ramanverma2005
Participant

any update about this . It will be appreciate @pmanca

I have set the “type” => “datetime”

0 Upvotes
3PETE
HubSpot Employee

@Raman_verma In the UI you cannot set the time. This can only be done through the API.

0 Upvotes
ramanverma2005
Participant

I did with API can not see you the code

$data =array( ‘name’ => ‘Became Attempted to Contact’,
‘groupName’ => ‘sdr_tracking’,
‘description’ => ‘DO NOT TOUCH THIS FIELD’,
“type” => “date”,
“fieldType” => “datetime”,
“formField” => false ,
);
$url=“https://api.hubapi.com/contacts/v1/properties/became_attempted_to_contact?hapikey=123”;

its not from UI

0 Upvotes
3PETE
HubSpot Employee

@Raman_verma The UI is only going to show the date. If you pull it back out via the API you should be able to see the time now as well.

0 Upvotes
ramanverma2005
Participant

Hi,

what is the use of the contact property to make it datetime if the UI is not available and how I can see the time in workflow or any other place ?

if you are not providing the GUI for the date and time field what if I enter the value of that contact property in workflow then how I can see the time via pull and from where ?

ramanverma2005
Participant

@pmanca waiting for the reply

0 Upvotes
3PETE
HubSpot Employee

@Raman_verma You can’t enter it via the workflow. This can’t be done via the UI. I will pass along your sentiments to the product team about adding that feature into the UI.

0 Upvotes
varadan
Member

@pmanca i am passing the unix epoc time in milliseconds through api only but i am getting a (404 bad request error)

string strJsonData = "{" +
" "properties": [" +
" {" +
" "property": "firstname"," +
" "value": "hubspotcccontact"" +
" }," +
" {" +
" "property": "lastname"," +
" "value": "callcentercontact"" +
" }," +
" {" +
" "property": "mobile_number"," +
" "value": "8568568568"" +
" }," +
" {" +
" "property": "contactcreatevnnew"," +
" "value": "1537423650000"" +
" }," +
" {" +
" "property": "email"," +
" "value": "Karnatakatmvn25@tyremarket.com"" +
" }," +
" {" +
" "property": "zip"," +
" "value": "560034"" +
" }," +
" {" +
" "property": "address"," +
" "value": "300/13 venkatapura"" +
" }," +
" {" +
" "property": "hubspot_owner_id"," +
" "value": "30752288"" +
" }" +
" ]" +
"}";

0 Upvotes