Apologies, I don’t see how to edit my first message. However, I have noticed that there is an “attachment” section in the ticket, different from “notes.” How can I attach uploaded files to a ticket? (Is there a way to attach multiple files at once?). I couldn’t find anything in the documentation.
Once the call succeed it’ll return a body with the ID of the ticket. We then have to do two extra steps:
- We create a note on the endpoint https://api.hubapi.com/crm/v3/objects/notes. One note per file to attach
- each note will return an id and we then attach the note to the ticket:
if withFiles == "true" {
for _, fileID := range cST.FilesIDs {
noteID, err := h.createAttachmentNotes(ctx, strconv.Itoa(int(fileID)))
if err != nil {
return "", err
}
if err = h.attachNoteToTicket(ctx, noteID.ID, idTicket.ID); err != nil {
return "", err
}
}
}
To attach a note to a ticket, we are using the following;
@JcUnitag - although its obscure and perhaps a bit arcane, the approach for multiple files is that the file ID values (internal values) are separated by a semicolon. You will find this works smoothly.