Skip to content
Advertisement

attaching binary file to an event in cumulocity

I have a scenario where in my code creates a file and an event in cumulocity as well. I need to attach the binary file to the event, however none of the API’s provide me the functionality, any guidance as to how to go ahead please?


Update:

On having a look at the documentation https://cumulocity.com/api/10.11.0/#tag/Attachments , the binaryElement has a following structure BinaryElement

I have modified my JAVA code in the following manner:

JavaScript

Binary is created for the event, however the filename is incorrect: Output structure

Please let me know some insights as to why the name is not changing?

Advertisement

Answer

You need to create a POST on /event/events/{{eventId}}/binaries with the appropriate Content-Type and body.

Here is a code snippet in python where a binary (log file) is attached to an event. It just POSTs the file content (bytes) as application/octet-stream

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement