APIs & Integrations

AMrb
Member

BUG upload files date

AMrb_0-1737022458110.png


uploading a file via api shows a classic 1970, so it seems Hubspot fails to set "now" date on creation date of uploaded file.

0 Upvotes
2 Replies 2
Jaycee_Lewis
Community Manager
Community Manager

BUG upload files date

Hi there! Can you share an example of your requests for creating the note and for the association? I did a basic test using my dev portal and a test contact and was able to:

  • Upload a file (to be saved as an attachment on an object record)
  • Add the file to a Note
  • Add the Note to an object record 
CleanShot 2025-01-16 at 11.17.44@2x.png

 

One thing to note about Notes is the date you are showing in your screenshot corresponds to the 

`hs_timestamp` property used when you create the Note, not when the Note is associated to an object record. You can verify this by adjusting the ISO timestamp value when you create a Note and then associating the note to your object record (Contact in this case)
 
Example: Note with File
Request
POST https://api.hubapi.com/crm/v3/objects/notes

Body

{
  "properties": {
    "hs_timestamp": "2025-01-15T18:00:00.000Z",
    "hs_note_body": "",
    "hubspot_owner_id": "198670650",
    "hs_attachment_ids": "92107510025"
  }
}
Response
{
    "id": "69287718287",
    "properties": {
        "hs_all_accessible_team_ids": "12073943",
        "hs_all_owner_ids": "198670650",
        "hs_all_team_ids": "12073943",
        "hs_attachment_ids": "92107510025",
        "hs_createdate": "2025-01-16T18:11:45.457Z",
        "hs_lastmodifieddate": "2025-01-16T18:11:45.457Z",
        "hs_note_body": null,
        "hs_object_id": "69287718287",
        "hs_object_source": "INTEGRATION",
        "hs_object_source_id": "959085",
        "hs_object_source_label": "INTEGRATION",
        "hs_timestamp": "2025-01-15T18:00:00Z",
        "hs_user_ids_of_all_owners": "10233975",
        "hubspot_owner_assigneddate": "2025-01-16T18:11:45.457Z",
        "hubspot_owner_id": "198670650",
        "hubspot_team_id": "12073943"
    },
    "createdAt": "2025-01-16T18:11:45.457Z",
    "updatedAt": "2025-01-16T18:11:45.457Z",
    "archived": false
}​
Associate Note to Object
Request
PUT https://api.hubapi.com/crm/v4/objects/note/69287718287/associations/contact/801

Body

[
  {
    "associationCategory": "HUBSPOT_DEFINED",
    "associationTypeId": 202
  }
]
Response
{
    "fromObjectTypeId": "0-46",
    "fromObjectId": 69287718287,
    "toObjectTypeId": "0-1",
    "toObjectId": 801,
    "labels": []
}​
Screenshot of date

CleanShot 2025-01-16 at 11.17.44@2x.png

To check:

  • the timestamp you are sending when creating the note
  • running a quick test with a few different values for the `hs_timestamp` property when creating a Note to fully understand how the API behaves in this case

In summary, this endpoint is working as designed, but possibly not as you are expecting it to work.

 

Have fun testing! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
AMrb
Member

BUG upload files date

hi,
checked your suggestion.

AMrb_0-1737102811515.png


setting timestamp in milliseconds make a difference.
setting UTC solved

need to understand why timestamp is not registered.

we can close here
cheers

0 Upvotes