You'll also want to upload your file to the File Manager via the CMS Files API. You can do that with the endpoint and instructions documented here: https://developers.hubspot.com/docs/methods/files/post_files. You'll also receive the file's ID in the response from that API. Store the file's ID.
Then you'll attach the file to the ticket by creating a NOTE type engagement (endpoint documented here: https://developers.hubspot.com/docs/methods/engagements/create_engagement) and using those stored IDs. The engagement will be associated to the ticket and will have the file attached to the engagement. Here's an example post body for this request: