To understand what's going on in the ByteArray of arguments, have a look at class PlatformFunction:

Bear in mind that this example is a bit artificial; the class CwPrompter exists in VA< and uses this API already. However, it does give you a simple example of making an API call, and you can follow the same pattern for your own work.