I just want to attachment the file that I uploaded with the ticket that I created
so I only have two ids, one is the fileId, the other is the ticketId
what is to.id, what is associationTypeId
To associate a file with a ticket or any object for that matter you would need to do the following:
1) Upload a file to the file manager using the “upload a new file” endpoint. This will return a response containing meta data for the file. The most important of which is the “id” of the file. We need to use that in the next step.
2) Create an engagement using the “create an engagement” endpoint and use the file ID returned previously in the “associations” array in your request. This will result in a file being associated to the specific object. Below is an example of the payload:
{
“engagement”: {
“active”: true,
“ownerId”: 1,
“type”: “NOTE”,
“timestamp”: 1409172644778
},
“associations”: {
“contactIds”: [],
“companyIds”: [ ],
“dealIds”: [ ],
“ownerIds”: [ ],
“ticketIds”: [28164303] <-- ID OF THE OBJECT IN HUBSPOT
},
“attachments”: [
{
“id”: 4964093251 <-- ID OF THE FILE IN HUBSPOT
}
],
“metadata”: {
“body”: “”
}
}
If you like the solution, Please mark it as SOLUITON ACCEPTED.