Is there a reason you must use the Engine API to do this?
Otherwise, have you looked at the documentation for create cube with the App API?
I have written a post on this here:
Note that you can use the mashup editor in dev-hub to help you with this. Hypercube format is the same whether you use Engine api or capabilities APIs.
If you prefer a video, there is one at youtube:
Hope this helps