Nov 14, 2022 3:55 AM
Hello
I researched engagements api.
I created contact from apis and can be able to view in hubspot, ver well.
my aim is , I want to create message(s) based on that contact.
before creating message, I think, I have to create thread. after that, I have to create messages belonging that thread. but thread does not have userId(s) .
I am little bit confused with the architecture.
could you tell me the right way to have api(s) to create the messages for the contact I have just created?
Nov 16, 2022 1:55 AM
hello
I fixed problem
Nov 15, 2022 9:52 AM - bearbeitet Nov 15, 2022 9:57 AM
1) I created a contact via api. Success.
2) I created a note via api. Success.
3) I tried to associate note with contact, but not success.
request (HttpPut)
response
{
Nov 15, 2022 9:54 AM
1) I created a contact via api. Success.
2) I created a note via api. Success.
3) I tried to associate note with contact, but not success.
Nov 15, 2022 9:57 AM
I use httpput
Nov 15, 2022 8:47 AM
Hi @TKucur,
Thank you for your post!
I'll invite a couple of API experts to this conversation as I'm not very familiar with this topic myself:
hi @coldrickjack, @klloyd__1, @Ismail, do you have any tips for @TKucur? Thank you! ⭐
Cheers
Mia, Community Team
![]() | Wusstest du, dass es auch eine DACH-Community gibt? Nimm an regionalen Unterhaltungen teil, indem du deine Spracheinstellungen änderst Did you know that the Community is available in other languages? Join regional conversations by changing your language settings |
Nov 15, 2022 12:18 PM
Thanks for the tag @MiaSrebrnjak
Hi @TKucur , happy to try and help here. In your original message's error response I am seeing it state "INVALID_AUTHENTICATION". Since you're using the hapikey in your URL request, this is referring to that key being invalid. I would first recommend following the instructions in this developer documentation to migrate your script away from using hapikeys, and instead use Private Apps. HubSpot is sunsetting the ability to use hapikeys as authentication at the end of this month.
Once you've replaced the authentication method, double check that you've also included a JSON Body with your HTTP request, stating the association type and definition
--data '[
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 0
}
]'
To find the associationTypeId for Contacts and notes, you can use the GET Association types endpoint .