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

oid

The object identifier

INFO: For more information, see Identification of Objects in Alloy Navigator Express.

NOTE: This HTTP request cannot be used to update objects that belong in the Software Catalog and Stock Room sections of the product.

actionId

The Step Action ID.

Example: 250.

TIP: You can find the Step Action ID in the Settings App: Customization > [Module]> [Object Class] > Workflow > 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 Express field names, see Referring to Object Fields in Alloy Navigator Express API.

Field values

For reference fields, you must specify the identifier of the referenced object (example: PN000017), or its name (example: Angelina Reyes).

For classification fields (e.g. Priority or Impact), you must specify the element’s display value (example: Immediate or Multiple People).

For boolean fields, you must specify true/false or 1/0.

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

Succeed

The confirmation that the object record was updated.

Boolean

ObjectID

The internal database identifier of the created object.

String

ObjectOID

The object identifier.

INFO: For more information, see Identification of Objects in Alloy Navigator Express.

String

In case of a failure, the server returns one of the following errors:

Error message Description

Authorization has been denied for this request.

The Authorization header is missing, or the token has expired.

You do not have enough permissions to access this item.

The user is not authorized to view the requested Object.

This action cannot be executed because the action's condition is not satisfied.

The user is not authorized to use the Action Step.

Object <OID> not found.

The record with the specified object identifier was not found.

Requested action is not available.

The Step Action with the specified ActionID was not found.

Field <name> is unknown.

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"

	}

}