APIs & Integrations

JackieChen
Member

Need help creating notes associated with deals

I want to associate a note with deals when creating it via the API, but the interface returns an error when adding.
Below is the request body.
I got deal id from "https://api.hubapi.com/crm/v3/objects/deals/search"
then
POST /crm/v3/objects/notes
{"properties": {"hs_timestamp": 1711953416000, "hs_note_body": "body"}, "associations": [{"to": {"id": "28535616883"}, "types": [{"associationCategory": "HUBSPOT_DEFINED", "associationTypeId": 214}]}]}
Below is the response
{"result": "<Response [400]>", "text": "{"status":"error","message":"one or more associations arenot valid","correlationId":"701952f7-2e3c-4ca3-87b1-f3ce5403926d","errors":[{"message":"0-1=28535616883 is not a valid object","context":{"validationResult":["INVALID_FROM_OBJECT"]}}],"category":"BAD_REQUEST"}"}
How should I correct my request?

0 Upvotes
2 Replies 2
GiantFocal
Top Contributor | Partner
Top Contributor | Partner

Need help creating notes associated with deals

Hi @JackieChen,

 

The issue appears to be with the association configuration in your request.

Can you verify that your deal ID exists and is valid?

If yes, please check that the association direction is from note to deal (not the other way around).

Best regards,
Ernesto @ GiantFocal
Found this answer helpful?
Marking it as the solution helps both the community and me - thanks in advance!
0 Upvotes
JackieChen
Member

Need help creating notes associated with deals

Hi @GiantFocal,

Thank you for your prompt response. I can confirm that my deal ID does exist and is valid. Additionally, I have double-checked the association direction, and it is correctly set from note to deal.

Given this information, do you have any other suggestions on what might be causing the issue or what steps I should take next?

Thank you for your continued assistance.

Best regards,
Jackie Chen

0 Upvotes