Using the WorkXpress API: ExecuteAction
Earlier I introduced you to the WorkXpress API. If you have not read it already you should do so before reading this post. Once you have a basic understanding of what it is and how it works, it's time to start diving into the API.
This post will cover how to run specfic Actions on specific Items. You can find the id of an Action at the end of its description in the Event Manager (see below). Like the other functions, you can make many ExecuteAction requests in one call using data sets.
Request XML
First, let's get an understanding of how the request XML should be formed.
| Element | Description | ||||||
|---|---|---|---|---|---|---|---|
| /wxRequest | The root node for all request documents. | ||||||
| /wxRequest/dataSet |
Contains a single ExecuteAction request. You may have as many data sets as you would like. Attributes:
|
||||||
| /wxRequest/dataSet/ items |
Root node for the items that the Action(s) should be run on. | ||||||
| /wxRequest/dataSet/ items/item |
A single item to execute the action on. There is no limit to the number of item nodes allowed in a data set. Attributes:
|
||||||
| /wxRequest/dataSet/ items/map |
The root node for a map definition. | ||||||
| /wxRequest/dataSet/ items/map/definition |
The actual definition for a map. The map XML must have its HTML entities encoded. | ||||||
| /wxRequest/dataSet/ actions |
Root node for the Actions to be executed. | ||||||
| /wxRequest/dataSet/ actions/action |
A single Action to be executed on the Items defined above. There is no limit to the number of action nodes allowed in a data set. Attributes:
|
Response XML
Now let's get an understanding of how the response XML will be formed.
| Element | Description | ||||||
|---|---|---|---|---|---|---|---|
| /wxResponse | The root node for all response documents. | ||||||
| /wxRequest/callStatus |
The status of the SOAP call as it was processed by WorkXpress. Attributes:
|
||||||
| /wxResponse/compatibilityLevel | The version of the API that was used to process the request. | ||||||
| /wxRequest/dataSet |
One data set is returned for each data set in the request document. Attributes:
|
||||||
| /wxRequest/dataSet/ item |
Defines an item that the Action(s) was executed on. One item node is returned for each item that an Action was run on. Attributes:
|
Examples
Below is an example of a basic ExecuteAction request document:
<dataSet reference=”accounts”>
<items>
<item itemId=”u3541” />
<item itemId=”u511” />
</items>
<actions>
<action actionId=”a314558” />
</actions>
</dataSet>
</wxResponse>
Below is the corresponding response document for the above example:
<callStatus status=”success” />
<compatibilityLevel>1</compatibilityLevel>
<dataSet reference=”accounts”>
<item itemId=”u3541” />
<item itemId=”u511” />
</dataSet>
</wxResponse>
If you have any questions or would like assistance making some ExecuteAction requests of your own, please feel free to comment below. My next post will be on some more advanced concepts such as display formats and stored values.

Add new comment