Updating Objects with Step Actions
Description
The API provides the ability to update objects through workflow Step Actions.
NOTE: Submitting an action form via an API request may feel different compared to what you'd normally expect in other modules of the product. The API supports only the default value and mandatory options of form fields. In some cases, the API will not return an error when you submit an action form with a mandatory field not filled. It happens if the field on the form is pre-populated with either a default value or its current value in the Object's record.
HTTP method
POST
API URL
http://www.example.com/api/v2/object/<oid>/action/<actionId>
URL parameters
Parameter | Description |
---|---|
|
The object identifier INFO: For more information, see Identification of Objects in Alloy Navigator. NOTE: This HTTP request cannot be used to update objects that belong in the Software Catalog and Stock Room sections of the product. |
|
The Step Action ID. Example: TIP: You can find the Step Action ID in the Settings App: Workflow and Business Logic > [Module]> [Object Class] > Workflow > Actions > Step Actions. |
POST parameters
POST parameters should be specified in the request’s body, in JSON format.
Parameter | Description |
---|---|
<fieldName1> <fieldName2> ... |
The fields on the Step Action form. Field names INFO: For the correct spelling of Alloy Navigator field names, see Referring to Object Fields in Alloy Navigator API. Field values For reference fields, you must specify the identifier of the referenced object (example: For classification fields (e.g. Priority or Impact), you must specify the element’s display value (example: For boolean fields, you must specify For HTML fields, you must specify text with HTML tags, see Updating Objects with Step Actions. |
POST body format
{ "<fieldName1>": "<fieldValue1>", "<fieldName2>": "<fieldValue2>", ... }
Response Format
On success, the server returns the identifiers of the updated object.
{ "success": true, "errorCode": 0, "errorText": "", "responseObject": { "Succeed": true/false, "ObjectID": "<Object ID>", "ObjectOID": "<Object OID>" } }
Property | Description | Format |
---|---|---|
|
The confirmation that the object record was updated. |
Boolean |
|
The internal database identifier of the created object. |
String |
|
The object identifier. INFO: For more information, see Identification of Objects in Alloy Navigator. |
String |
In case of a failure, the server returns one of the following errors:
Error message | Description |
---|---|
|
The Authorization header is missing, or the token has expired. |
|
The user is not authorized to view the requested Object. |
|
The user is not authorized to use the Action Step. |
|
The record with the specified object identifier was not found. |
|
The Step Action with the specified ActionID was not found. |
|
The field with the specified name was not found. |
Example
Here is an example of how you can update the Vendor record with OID=V0000006) by calling Step Action #1631 and updating the Activity.Time_Spent and Comment fields.
Request:
(POST) http://www.example.com/api/v2/object/V000006/action/1631
POST Body:
{ "Activity.Time_Spent": 84, "Comment": "Updated with the API" }
Response:
{ "success": true, "errorCode": 0, "errorText": "", "responseObject": { "Succeed": true, "ObjectID": "326624be-4271-46bd-b070-7a47b0f5ee54", "ObjectOID": "V000006" } }