CreateWorkflow

Creates a workflow for a file/directory

There are several type of workflows:

  • HTTPCallback
  • POST
  • Action
  • immediateemail
  • dailyemail
  • weeklyemail

Supported Authentication Methods


  • Username Password

HTTPCallback

Performs a callout to a specified URL on a specified event type with information about what has occured

POST

Posts the file and the information to a specified URL based on the event that occured and perform an action on success (HTTP status code 200)

Action

Preform an action based on an event type

immediate, daily and weekly emails

Mails a list with changes based on the chosen interval

Parameters for all types

Input Parameter Type Description
Token* String Security token
FileserverName* String nmsa
Type* String HTTPCallback, POST, Action, immediateemail, dailyemail or weeklyemail
Path* String path to the file or directory
AccountName String Account to create the workflow for (default to current user)

*=required

Parameters for HTTPCallback and POST

Input Parameter Type Description
Url Uri callback url
Headers String[] list of headers to send to the Uri when posting

Parameters for HTTPCallback only

Input Parameter Type Description
EventTypes EventType[] List of event types to receive a callback for, default is 'New', 'Deleted', 'MovedTo', 'DataUpdated' and 'CopiedTo'

Parameters for POST only

Input Parameter Type Description
SuccessFileserverName String name of the Vault to run the SuccessType on
SuccessType String action to take on successful post, can be move or copy
SuccessPath String path to copy or move to on successful post
FailFileserverName String name of the Vault to run the FailedType on
FailType String action to take on failed post, can be move or copy
FailPath String path to copy or move to on failed post

Parameters for Action Workflow

Input Parameter Type Description
SuccessType String action to take, can be move or copy
SuccessPath String path to copy or move to
EventTypes EventType[] List of event types to receive a callback for, default is 'New' and 'DataUpdated', can also be 'Download'

CURL EXAMPLES

Email Workflows

Creating an immediateemail workflow:

curl -v 'https://example.com/storage/api.php?Task=CreateWorkflow&Type=immediateemail&FileserverName=nmsa980676080100&Path=/email&Token=52f7f033-0b7d-e682-7305-7039f8b93a33'

Creating an immediateemail workflow for a different user:

curl -v 'https://example.com/storage/api.php?Task=CreateWorkflow&Type=immediateemail&FileserverName=nmsa980676080100&Path=/email&Token=52f7f033-0b7d-e682-7305-7039f8b93a33&AccountName=nmua987234912549'
Action Workflow

Create a Action workflow that moves a file when a file is downloaded

curl -v 'https://example.com/storage/api.php?Task=CreateWorkflow&Type=Action&FileserverName=nmsa980676080100&Path=/inbox&SuccessType=move&SuccessPath=target&EventTypes[]=Download&Token=52f7f033-0b7d-e682-7305-7039f8b93a33'
HTTPCallback Workflows

Creating a HTTPCallback workflow:

curl -g 'https://example.com/storage/api.php?Token=9e4d82e1-fc2e-83dc-4129-00741200e90e&Task=CreateWorkflow&Type=HTTPCallback&FileserverName=nmsa838932699075&Path=/inbox&Url=https://example.com/myworkflow&Headers[][header01]=MyHeader1&Headers[][header02]=MyHeader2'

Creating a HTTPCallback workflow that only notifies on Download and New:

curl -g 'https://example.com/storage/api.php?Token=9e4d82e1-fc2e-83dc-4129-00741200e90e&Task=CreateWorkflow&Type=HTTPCallback&FileserverName=nmsa838932699075&Path=/&Url=https://example.com/myworkflow&EventTypes[]=Download&EventTypes[]=New'
POST Workflows

Creating a POST workflow with move:

curl -v 'https://example.com/storage/api.php?Task=CreateWorkflow&Type=POST&FileserverName=nmsa980676080100&Path=/workflow&Url=https://example.com/workflow.php&SuccessType=move&SuccessPath=/ok&FailType=move&FailPath=failed&Token=52f7f033-0b7d-e682-7305-7039f8b93a33&Headers[][header01]=myValue&Headers[][header02]=myValue'

RESPONSE

<Response>
    <Status>1</Status>
    <Message></Message>
</Response>

CALLBACK Content

When a callback is made, the following json formated information can be found in the body:

{
    "vault":"nmsa473585218625",
    "eventtype":"DataUpdated",
    "path":"MyFile.txt",
    "nodetype":"File",
    "account":"nmua531025527305",
    "locationid":"457750f1-1b9e-40f9-8010-cd3abb2d2b16"
}