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": ""
}
}
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": ""
}
}
Hello @jackcoldrick thanks for your answerbut actually that solution is not working, I can upload a file with the endpoint v3/files/upload, but the engagement doesn't work, making the request as you suggest I've got this response: