engagement api note not visible after creation

Hi all,

I’m trying to create a note against a deal with a private app token.

It appears to work ok as I receive a 201 response when testing from Accounts Dashboard | HubSpot.

However, when I login to hubspot and open the deal, I cannot see the note. If I use the ‘Read’ API and pass it the ID of the note created, it returns a 200 with the note info.

I’m not sure what is happenning, its definately being created, but doesnt seem to be against the deal I was expecting it to be.

The API requires me to provide a ‘To Object’. I’m not sure what that is, I’ve currently got 401 defined there?? (no idea).

Has anyone had similar problems or point me in the right direction to troubleshoot?

Let me know if you need more info.

thank you!

Keegan

Hey, @KRamsey :waving_hand: Can you share an example of your request body and the response, please? It’s helpful to our community to see how you set it up.

Best,

Jaycee

Hey Jaycee,

Thanks for replying, I really appreciate it!

My POST code in c#

var client = new RestClient("https://api.hubapi.com/crm/v3/objects/notes");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Bearer MY-PRIVATE-API-KEY");
request.AddParameter("application/json", "{\"properties\":{\"hs_timestamp\":\"2022-04-06T03:30:17.883Z\",\"hs_note_body\":\"Spoke with decision maker john\",\"hubspot_owner_id\":\"84170060\",\"hs_attachment_ids\":\"12828617560\"},\"associations\":[{\"to\":{\"id\":\"301\"}}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

In the above;

hubspot_owner_id - is My owner id

hs_attachment_ids - is the ID of the deal im trying to attach the note to

associations - set to 301 (I’ve tried all different numbers here I dont understand what it wants and suspect this is what is breaking it)

The response

HTTP 201

{
 "id": "33349843569",
 "properties": {
 "hs_all_accessible_team_ids": "4205462;4205463;4205483;4205484;4205489;4260969;4261057",
 "hs_all_owner_ids": "84170060",
 "hs_all_team_ids": "4205463",
 "hs_attachment_ids": "12828617560",
 "hs_body_preview": "Spoke with decision maker john",
 "hs_body_preview_html": "<html>\n <head></head>\n <body>\n Spoke with decision maker john\n </body>\n</html>",
 "hs_body_preview_is_truncated": "false",
 "hs_createdate": "2023-04-05T23:57:21.967Z",
 "hs_lastmodifieddate": "2023-04-05T23:57:21.967Z",
 "hs_note_body": "Spoke with decision maker john",
 "hs_object_id": "33349843569",
 "hs_timestamp": "2022-04-06T03:30:17.883Z",
 "hs_user_ids_of_all_owners": "25161443",
 "hubspot_owner_assigneddate": "2023-04-05T23:57:21.967Z",
 "hubspot_owner_id": "84170060",
 "hubspot_team_id": "4205463"
 },
 "createdAt": "2023-04-05T23:57:21.967Z",
 "updatedAt": "2023-04-05T23:57:21.967Z",
 "archived": false
}

When I go to deal 12828617560 in hubspot, there is no record of the note.

Any help would be great. Thanks again, Jaycee.

Keegan