Action Create
Non-standard resource
Note: This is a non-standard resource and does not implement all the same functionality as a regular resource. The GET and POST requests do not have the same structure and do not return the same result.
Please read the documentation for this resource carefully.
Creating an action is a variable request depending on how the "Start" step is configured in the action type you are trying to create an action for. For example, creating an action for an action type with no user-input required on the start step is pretty easy, where-as an action type with a very long set of user input fields will require a very complex API request.
There are two common scenarios for creating an action via this API resource; creating a known action type (where you could hard-code the request) or a generic application where you must discover the structure of the start step, then ask the user for input, then build the API request.
Resource Properties
Scope Parameter | actioncreate |
---|---|
Location | /actioncreate |
Methods | GET, POST |
Default Page Size | 50 |
Max Page Size | 200 |
Default Includes | step, stepTasks, stepMessages, documentTemplates, stepParticipantTypes, otherParticipantTypes, stepDataFields, stepRelatedActionTypes and trustAccounts |
GET requests
The GET request for the actioncreate resource will return a set of resources which you must complete for the POST request. For example, you may get a list of "stepTasks" which contain a list of tasks (some optional) which the user must see (and confirm/unselect if task is optional).
The request structure is: GET /api/rest/actioncreate/{action-type-id}
GET Resource Attributes
Field | Description | Format | Field Type | Notes |
---|---|---|---|---|
id | Action Type ID | string | default | |
step | Link to the "Start" step being described | string | link | |
stepTasks | List of all the tasks (both required + optional) for this step | collection | link | |
stepMessages | List of all the messages to be sent (currently limited to emails) for this step | collection | link | |
documentTemplates | List of all the document templates to be added to the action for this step | collection | link | |
stepParticipantTypes | List of all the participant types specifically requested to be displayed to the user for this step | collection | link | |
otherParticipantTypes | List of participant types (other than those in stepParticipantTypes) that should be shown to the user due to their inclusion in an email etc | collection | link | |
stepDataFields | List of data-fields that should be editable by the user for this step | collection | link | |
stepRelatedActionTypes | List of related action types that are required for the user to associate on this step | collection | link | |
actionType | string | link | ||
trustAccounts | List of trust accounts | collection | link |
Link Templates
Identifier | Resource | Location Template |
---|---|---|
actioncreate.step | step | /step/{actioncreate.step} |
actioncreate.stepTasks | steptasks | /steptasks/{actioncreate.stepTasks} |
actioncreate.stepMessages | stepmessages | /stepmessages/{actioncreate.stepMessages} |
actioncreate.documentTemplates | documenttemplates | /documenttemplates/{actioncreate.documentTemplates} |
actioncreate.stepParticipantTypes | stepparticipanttypes | /stepparticipanttypes/{actioncreate.stepParticipantTypes} |
actioncreate.otherParticipantTypes | participanttypes | /participanttypes/{actioncreate.otherParticipantTypes} |
actioncreate.stepDataFields | stepdatafields | /stepdatafields/{actioncreate.stepDataFields} |
actioncreate.stepRelatedActionTypes | steprelatedactiontypes | /steprelatedactiontypes/{actioncreate.stepRelatedActionTypes} |
actioncreate.actionType | actiontypes | /actiontypes/{actioncreate.actionType} |
actioncreate.trustAccounts | trustbankaccounts | /trustbankaccounts/{actioncreate.trustAccounts} |
POST Requests
Unlike a regular resource, the POST request format is different to the GET request as you are not saving the step configuration, instead you are submitting the data entered by the user in relation to the step configuration.
The best way to understand a POST request is to configure your start step in Actionstep then create an action using the Actionstep user-interface. There you will see all the user-input fields that we display to the user to create an action of that type. In order for the API to create the same action, we require all that data to be specified in the POST request using a format that is consistent with our standard API data structures.
Note: the response to a POST request is the standard "actions" GET response (but under "actioncreate" instead). This is non-standard as the standard GET response for actioncreate would make no sense after a POST request.
POST Resource Attributes
Field | Description | Format | Required | Field Type | Notes |
---|---|---|---|---|---|
actionName | The name of the new action being created | string | true | default | |
fileReference | the file reference of the new action | string | false | default | |
priority | the priority of the new action | integer | false | default | |
status | The status of the new Action | string | false | default | Defaults to Active, options are Active, Inactive, Template or Closed |
timestamp | The date/time to set as the step-change date | date | false | default | Defaults to now. |
stepDataField{N} | Values for each step data field. (may be many occurrences of this attribute). | mixed | true | default | Fields not specified will be updated to NULL if the field is optional. |
fileNote | File-note text to be added as a step-change file note | string | sometimes | default | Is required when the step configuration requires a file note. |
actionType | The ID (Action type id) of the type of action being created. | string | true | link | |
assignedToParticipant | who the new action is assigned to (defaults to the current user) | string | false | link | Defaults to the access token's participant if not specified |
stepTasks | List of the {stepTasks}.{id} that the user confirmed they want to create. | collection | false | link | Mandatory tasks will always be created regardless of them being specified or not. Make sure to check there are participants specified for the task's assigned to participant type. |
stepMessages | List of {stepMessages}.{id} that the user confirmed they want to create. | collection | false | link | Mandatory messages will always be created regardless of them being specified or not. Make sure to check there are participants specified for the messages to/from are specified. Also check those participants have a valid email address if the message is an email. |
documentTemplates | List of {documentTemplates}.{id} that the user confirmed they want to create. Any missing ID implies the user deselected the template. The list of available {documentTemplates}.{id} is set in the GET response | collection | false | link | |
participantType{N} | List of participants for each participant type. (may be many occurrences of this attribute). Note that {N} is for each of the {stepParticipantType}.{participantType} or {otherParticipantTypes}.{id} listed in the GET response. | collection | false | link | |
relatedActionType{N} | List of actions for each action type. (may be many occurrences of this attribute). Note that {N} is for each of the {stepRelatedActionTypes}.{id} listed in the GET response. | collection | false | link | |
trustAccounts | List of trust bank accounts | collection | false | link |
The error reporting for this resource is a little sparse at the moment, so please email us at api@actionstep.com if you have any trouble using this resource.
Example:
In this example, we'll create an action which has a lot of information configured.