<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unable to populate Date picker value using the API &amp;quot;Error Bad request&amp;quot; in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/300390#M28241</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/665"&gt;@IsaacTakushi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just send you a message with all the info you asked for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Nov 2019 13:47:50 GMT</pubDate>
    <dc:creator>johnjohn123123</dc:creator>
    <dc:date>2019-11-05T13:47:50Z</dc:date>
    <item>
      <title>Unable to populate Date picker value using the API "Error Bad request"</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/299734#M28154</link>
      <description>&lt;P&gt;We have created a property for our compnay named "TPS Update Date" of type DatePicker as follow:-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TPS.png" style="width: 569px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/21056iC95B07A36AD71473/image-size/large?v=v2&amp;amp;px=999" role="button" title="TPS.png" alt="TPS.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when i try to populate this property using the API i will get this error:-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;The remote server returned an error: (400) Bad Request&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is a sample of the passed JSON which will raise the error:-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;"[{\"objectId\":****,\"properties\":[{\"name\":\"email_gateway\",\"value\":\"******\"},{\"name\":\"website_gateway\",\"value\":\"****.\"},{\"name\":\"mse_scan\",\"value\":\"No\"},{\"name\":\"mse_status\",\"value\":\"****.\"},{\"name\":\"tps_update_date\",\"value\":\"1572525038454\"},{\"name\":\"tps\",\"value\":\"Allowed\"}]}]"&lt;/PRE&gt;&lt;P&gt;while if i remove the&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{\"name\":\"tps_update_date\",\"value\":\"1572525038454\"}&lt;/PRE&gt;&lt;P&gt;property from the JSON i will be able to update the record. and i am converting the date inside our c# application to unix based ..so the value i am passing will be&amp;nbsp;&lt;SPAN class="comment-copy"&gt;&lt;STRONG&gt;1572525038454&lt;/STRONG&gt; (as shown in the above json)..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="comment-copy"&gt;so i am not sure why this is not working for me?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 13:47:43 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/299734#M28154</guid>
      <dc:creator>johnjohn123123</dc:creator>
      <dc:date>2019-10-31T13:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to populate Date picker value using the API "Error Bad request"</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/300267#M28223</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/109315"&gt;@johnjohn123123&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Apologies for the delayed response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do not see a company property with the internal name &lt;CODE&gt;tps_update_date&lt;/CODE&gt; in your account with the Hub ID ending in&amp;nbsp;&lt;STRONG&gt;0966&lt;/STRONG&gt;. Am I looking in the correct account or did you delete the property?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, could you share a request URL you were testing with? (For example:&amp;nbsp;&lt;CODE&gt;&lt;A href="https://api.hubapi.com/companies/v2/companies/1234567" target="_blank"&gt;https://api.hubapi.com/companies/v2/companies/1234567&lt;/A&gt;&lt;/CODE&gt;.) Please remove any &lt;CODE&gt;hapikey&lt;/CODE&gt; values.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 21:34:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/300267#M28223</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2019-11-04T21:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to populate Date picker value using the API "Error Bad request"</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/300363#M28237</link>
      <description>&lt;P&gt;Thanks for the reply. i am developing an console application for 3rd party compnay.. so do you need their ID? and can i send it in a confidentail way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is the c# code to intigrate with the API:-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;using (WebClient wc = new WebClient())
         {
               string url = "https://api.hubapi.com/companies/v1/batch-async/update?hapikey=******";
               Uri uri = new Uri(url);
               wc.Encoding = System.Text.Encoding.UTF8;
               wc.Headers.Add(HttpRequestHeader.ContentType, "application/json");
               var apiupdateresults = wc.UploadString(uri, data);
               Console.WriteLine("Api update results= " + apiupdateresults);
         }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 10:51:11 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/300363#M28237</guid>
      <dc:creator>johnjohn123123</dc:creator>
      <dc:date>2019-11-05T10:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to populate Date picker value using the API "Error Bad request"</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/300375#M28240</link>
      <description>&lt;P&gt;Sure, could you direct message it to me? Also, do you have an object ID you've been testing with that I could also use?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 12:57:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/300375#M28240</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2019-11-05T12:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to populate Date picker value using the API "Error Bad request"</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/300390#M28241</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/665"&gt;@IsaacTakushi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just send you a message with all the info you asked for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 13:47:50 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/300390#M28241</guid>
      <dc:creator>johnjohn123123</dc:creator>
      <dc:date>2019-11-05T13:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to populate Date picker value using the API "Error Bad request"</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/300600#M28272</link>
      <description>&lt;P&gt;Hi &lt;A href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/665" target="_blank"&gt;@IsaacTakushi&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;, did you have the chance to check the above ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 11:50:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/300600#M28272</guid>
      <dc:creator>johnjohn123123</dc:creator>
      <dc:date>2019-11-06T11:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to populate Date picker value using the API "Error Bad request"</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/300723#M28290</link>
      <description>&lt;P&gt;Apologies for the delayed response,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/109315"&gt;@johnjohn123123&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for sending that information along!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like the&amp;nbsp;&lt;CODE&gt;tps_update_date&lt;/CODE&gt; property in that account has the &lt;CODE&gt;type: "date"&lt;/CODE&gt; instead of &lt;CODE&gt;datetime&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As mentioned in &lt;A href="https://developers.hubspot.com/docs/faq/how-should-timestamps-be-formatted-for-hubspots-apis" target="_self"&gt;this article&lt;/A&gt;, properties with a &lt;CODE&gt;type&lt;/CODE&gt; of &lt;CODE&gt;date&lt;/CODE&gt; only accept UNIX millisecond timestamps at&amp;nbsp;&lt;STRONG&gt;midnight&lt;/STRONG&gt;&lt;STRONG&gt; UTC&lt;/STRONG&gt;:&amp;nbsp;"&lt;SPAN&gt;If you try to set a value that is not midnight UTC, you will receive an error."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your first post, you shared the timestamp value&amp;nbsp;&lt;CODE&gt;1572525038454&lt;/CODE&gt;, which is not at UTC midnight. If you send&amp;nbsp;&lt;CODE&gt;1572480000000&lt;/CODE&gt; instead, the&amp;nbsp;&lt;CODE&gt;date&lt;/CODE&gt; field should accept it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you can change the&amp;nbsp;&lt;CODE&gt;tps_update_date&lt;/CODE&gt; property to be the&amp;nbsp;&lt;CODE&gt;type: "datetime"&lt;/CODE&gt; with &lt;A href="https://developers.hubspot.com/docs/methods/companies/update_company_property_group" target="_self"&gt;this endpoint&lt;/A&gt;. See the example below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;PUT

https://api.hubapi.com/properties/v1/companies/groups/named/tps_update_date?hapikey=key

{&lt;BR /&gt;&lt;CODE&gt;  type: "datetime"&lt;BR /&gt;&lt;/CODE&gt;}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If&amp;nbsp;&amp;nbsp;&lt;CODE&gt;tps_update_date&lt;/CODE&gt; property is &lt;CODE&gt;datetime&lt;/CODE&gt;, then it will accept&amp;nbsp;&lt;CODE&gt;1572525038454&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 20:08:30 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/300723#M28290</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2019-11-06T20:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to populate Date picker value using the API "Error Bad request"</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/300900#M28315</link>
      <description>&lt;P&gt;Hi Isaac,&lt;/P&gt;&lt;P&gt;thanks for the helpful reply. i fix this by converting the Date instead of the DateTime inside my code, and now i am able to populate the date picker value through the API.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 14:04:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/300900#M28315</guid>
      <dc:creator>johnjohn123123</dc:creator>
      <dc:date>2019-11-07T14:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to populate Date picker value using the API "Error Bad request"</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/1059547#M77627</link>
      <description>&lt;P&gt;Thank you. Following your advice, I was able to POST to the HS API by converting my C# DateTime to a UNIX long. (17533348999)&lt;/P&gt;&lt;P&gt;But now, when reading that exact same property FROM the HS API (instead of POSTing to it) the data in the property is now "2024-10-01". Needless to say, I am not able to parse it into my original custom data type with has a property of type long?. How are we supposed to handle that?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 01:17:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Unable-to-populate-Date-picker-value-using-the-API-quot-Error/m-p/1059547#M77627</guid>
      <dc:creator>tkoseoglu</dc:creator>
      <dc:date>2024-10-24T01:17:51Z</dc:date>
    </item>
  </channel>
</rss>

