Adding attachment with X-callback-url

I want to create a note in Agenda with a attachment using x-callback-url and automator in Mac OS.
Creating a note is no problem but I struggle with adding an attachment (.txt file and/or a picture).
The Support and reference isn’t helping me much: it tells me tou use ‘both the attachment and filename parameter’. Filename is obvious but how am I expected to use the ‘attachment parameter’?

The parameter expects the attachment as a string containing the base64 encoded data of the attachment. We’ll update the documentation to make this clearer. Also make sure you encode the data without adding linebreaks)

Can you give me an example Alexander ?

I’m not too familiar with Automator, but have a look at this one: applescript - "drag n drop" application to convert images to base64 string (for web development) - Ask Different