Problem : Looking for sample java code which can upload attachment to test execution.
Please follow the attachment resource API in "http://docs.zfjcloud.apiary.io/#reference/attachment/create-attachment/create-attachment"
The entityID is nothing but the id of the entity(execution/teststep) you are using.
You can get the execution Id by using any of the "Get List of Executions" URI of execution resource http://docs.zfjcloud.apiary.io/#reference/execution
Simply by inspecting the element of the [E] button from the Plan Test Cycle page or View Test page Test Executions.
Also we have attached the sample java code that will help you in understanding how to use the APIs to upload or add attachment