How can we manually raise OFS-Flow forms via API?

Every OFS-Flow subscription includes a powerful API capability which allows you to automate actions like creating new forms.

Within OFS-Flow, there is a capable API which allows users to automate various actions, including the manual, semi-automatic and fully automatic initiation of OFS Flow records.

The OFS Flow alert-raising API is available at:

https://{hostname}/serviceengine/alertraise?configUID=...&workcentre=...&time=...

Each parameter is described below. To call this API, the user you authenticate with must have the alertraise permission. Typically administrators have this permission and any user who can manually raise a Flow Form already has this permission.

Getting Prepared

To make an API request to the OFS-Flow software for the creation of a new alert, you will need to know:

  • The ConfigUID of the Alert that you wish to raise
  • The Workcentre that you want your newly raised Alert to be associated with
  • The Time at which you want the alert to be raised

These three parameters are required and each must be formatted specifically according to the rules below in your request, and must be properly URL encoded.

Config UID

The Config UID for any alert can be found, once the alert has been saved, in Fusion-Manager:

Workcentre

For your newly raised alert's workcentre, you have two options:

  • If you are licensed for Line Independent Flows and you want to raise this alert in a Line-Independent capacity, the workcentre for your API call will need to be NOWORKCENTRE001
  • For alerts associated with an OFS Licensed Production Line, set the workcentre to your known value for the line you want to associate. The workcentre for your OFS line is the set of all capitals letters, ending with 3 numbers, between the server address and /console/ in your OFS Console URL.

Time

Each OFS Flow Alert has a creation time associated with it - those raised by API are no exception. In almost all cases, you will get the best results from setting the time parameter to the current time, however the time must be declared as a Unix Timestamp.

This format is a number of milliseconds since the Unix Epoch. There are public tools to help you calculate this available online - Epoch Converter.

When Alerts are raised at past-now timestamps, they will be transitioned through their defined workflow in line with the defined creation time.

If you send a request with a future timestamp, it will be rejected as the server does not support queuing future alerts via this mechamism at the present time.

Testing your Request

Once you have gathered these parameters, you can combine your prepared parameters with make calls to the alertraise API.

Consider using an API client like Postman, but you can make this call from your Web Browser for testing purposes - just combine the example above with your prepared parameters and pop it into your web browser. Each time you run the API call, a new alert will be created so do be careful testing this out.

Automating Flow Form Creation

By combining this information about the Alert Raising API with an external trigger (e.g. a hook in SAP, a sensor on the factory floor, etc), the possibilities for automation with OFS are endless. The API can be called from anywhere with access to the OFS Server, and can be programmed with your systems to update the workcentre, alert, and time properties according to your needs.