Getting a “400 Bad Request” when trying to pass the "Last modified date" through API


#1

Hi ,
I am updating a deal and i want to pass the "Last modified date" also through API , but i am getting "400 Bad Request error", when i pass the create date and close date its going though and get updating in the hubspot fine.

""properties": [" +
"{" +
""value": "30septdealonedt"," +
""name": "dealname"" +
"}," +
"{" +
""value": "default"," +
""name": "pipeline"" +
"}," +
"{" +
""value": "1459873345260"," +
""name": "hs_lastmodifieddate"" +
"}" +
"]" +


Can't edit or update or create any of the date property of a contact through api
#2

Hi @varadan, I was able to successfully make a request in Postman to the Update A Deal endpoint. I successfully changed the last modified property to the 2016 timestamp. Here's how mine looked:

{
   "properties": [
        {
           "value": "30septdealonedt",
            "name": "dealname"
         },
         {
          "value": "default",
          "name": "pipeline"
         },
         {
         "value": "1459873345260",
         "name": "hs_lastmodifieddate"
         }
     ]
}

I'd double check your Content-Type header is set to application/json and that you're using the PUT method. Also, be sure that your properties are wrapped in curly braces {} and that there aren't any syntax issues in the body.


#3

Hey @varadan, Apologies for the inaccurate information here. This actually seemed to be a temporary glitch where I was able to update the deal record's last modified date, but can no longer do so, and get the same error as Isaac does on this thread: Can't edit or update or create any of the date property of a contact through api. I would not expect this field to be modified, since it's a default HubSpot property that gets set by the system.

This property can not be altered via API

I apologize for giving conflicting information, but the hs_lastmodifieddate for deals and lastmodifieddate are not editable fields, and they get set whenever there's an update to a deal, contact, or company by the system. Thank you!