Forum Discussion
Hi Vinay,
The short answer is yes. I'm planning a blog post soon that will cover calling methods from the REST API in more detail, but I can give you the highlights here.
Every method call via the REST API will be sent as a POST request. The body that you send along with the post request will be treated as the context item for the method. The general structure of this can be seen below
As a real world example of this, we can take a look at how to promote a Document to the Released state. The AML for this call would look something like this.
<AML> <Item type="Document" action="promoteItem" id="84BA9AFB58B84FA5B3CCC840A3B8BFEB"> <state>Released</state> <comments>Promote this item to released as a test</comments> </Item> </AML>
This AML query is running an action called promoteItem on a Document based on the ID. Looking at this, we can see that the method name we would need to use is called promoteItem. We'll also need to pass in our state and comments via the body of the request that we send to the server. Lastly, we'll need to call this method on a specific item. We can put all of these together to make a call that will look something like this.
Workflow voting get a little trickier. You can see the general structure of an AML request to vote on a workflow here. This request makes heavy use of attributes on properties which is currently not supported via the REST API. For workflow voting, I'd recommend writing a custom server method that handles building the request based on some information and then calling that instead of the standard EvaluateActivity action.
Chris
Christopher Gillis
Aras Labs Software Engineer
Any update on this?
The AML part works fine for me.
But the Reat API part seems to do nothing.
Ari