Starting a Process from Outside of Questetra BPM Suite (curl Chapter)

Starting a Process by Curl Command

Let’s try accessing Questetra BPM Suite and starting a Process using curl, which is a command capable of data transmission. Curl command can be used on Mac and Linux terminals without installation.On Windows, curl is installed as standard on Windows 10 and later. This article will proceed assuming that you are using the curl command in the Windows command prompt.

First, let’s try starting a new Process by accessing a particular URL by executing a curl command. Leave the Message Start Event (HTTP) Detail screen open since you will need the endpoint URL of the Message Start Event (HTTP) that you placed on the created App in the Preparatory Chapter.

A request to a Message Start Event (HTTP) must be sent using the POST method. Use the -X option to specify the request method as POST.

For this trial, we are going to send content to be input to the Title Data Item when starting the Process. By appending parameters to the end of the endpoint URL you can pass the data you want to send to the App. For example, when you want to set the title to “test” it will be in the following form.


curl -X POST "https://example.questetra.net/System/Event/MessageStart/{processModelInfoId}/{nodeNumber}/start?key={API key}&title=test"

Check the Message Start Event (HTTP) details and replace the endpoint URL and API key. The API key and the endpoint URL are written in the list of Reception Parameters on the Message Start Event (HTTP) details screen. Copy them from there and paste into the command code. Reception Parameter Names are also listed in the same list.

When you run the command, the number part of the Process ID of the started Process will be returned. When you log in to Questetra BPM Suite with your account (Operator of the Swimlane) you will see that a Process has been started and the Check Task has been allocated to you. Also, confirm whether its title is the same one you passed to the parameter.

Sending a variety of data

Now, how do you send data other than the Title? There are many types of Data Item, such as String or User and you can send most of them in the same way as the Title. Let’s see how it works by adding Data Items to the App.

App Setting

Add Data Items as follows; checking the “Required” box is not necessary for any of them. Regarding Data editing permissions, set all items as “Editable” on the Message Start Event (HTTP) and “Only display” on the Check Task.

<td<q_group
Item name Data type Field nmae Optional setting
String0 String type single-line q_str
Numeric1 Numeric q_float
  • Range of decimal digits: 2
Select2 Select (Select box) q_selects
  • Leave choices as default
    • Choice ID of the first one: true
    • Choice ID of the second one: false
    • Initial: true
Date3 Date (Y/M/D) q_date
Datetime4 Datetime q_datetime
File5 File q_file
User6 User (Search select box) q_email
Organization7 Organization

Sending non-File-types by curl

Now, let’s try sending the added Data Items with curl as well. Since the method for File-type Data Items is somewhat different I will cover that in another section.

In the previous command, we added data in the format of ? and name=content, but this time we will use the --data-urlencode option. We will add each item, including the API key and title=test, one by one using the --data-urlencode option.

If you specify the --data-urlencode option, the POST method will automatically be used for sending, so you can omit -X POST in the command.

To send to multiple Data Items you can write the following:


curl https://example.questetra.net/System/Event/MessageStart/{processModelInfoId}/{nodeNumber}/start ^
--data-urlencode "key={API key}" ^
--data-urlencode "name1=content1" ^
--data-urlencode  "name2=content2" ^
 ...

With the following command, for example, you can start a Process where “test” is the Title and “1.23” has been entered in the Numeric data (q_float).


curl https://example.questetra.net/System/Event/MessageStart/{processModelInfoId}/{nodeNumber}/start ^
--data-urlencode "key={API key}" ^
--data-urlencode "title=test" ^
--data-urlencode "q_float=1.23"

Please refer to the following table for concrete input examples for each Data type.

list of input method for each Data type
Data Item Subtype Format Example Remark
API key key={API key} API key is written in Event detail.
Title Any character string/td>

title=test Character number limit and others depend on Data Item settings.
(256 characters or less by default)
String single-line Any character string q_str=aiueo Character number limit and others depend on Data Item settings.
multiple-line
Numeric Any numeric value q_float=1.23 Range limit of input value, Number of the decimal place, etc. depends on the Data Item settings.
(Error if the number of decimal place of the input value is larger than the limit.)
The decimal point is “.” (Period)
No delimiter
選Select radio button Choice ID q_selects=true The Choice ID corresponding to each option depends on the Data Item settings.
selct box
search select box
check box Choice ID
(Multiple transmission possible)
q_selects=Monday The Choice ID corresponding to each option depends on the Data Item settings.
To select multiple options, send multiple times with the same parameter name.
Date Y/M/D yyyy-mm-dd q_date=2018-11-01
Y/M yyyy-mm q_date=2018-11
M/D mm-dd q_date=11-01
Y yyyy q_date=2018
Datetime yyyy-mm-dd HH:MM q_datetime=2018-11-01 10:00
File File path q_file=@ques-kun.png For file uploading, the -F option is required. (described later)
To upload multiple files, send multiple times with the same parameter name
User Email address of the User q_email=example@email.com
Organization Organization name q_group=10 Management

Sending Files

As noted above, if you do not send data to File-type Data Items, POST with the option --data-urlencode is recommended. However, the --data-urlencode option, which sends data in application/x-www-form-urlencoded format, is not capable of dealing with files. Therefore, when dealing with File-type Data Items you need to use the -F option to send data in the multipart/form-data format. And you cannot use the --data-urlencode option and the -F option at the same time.


curl https://example.questetra.net/System/Event/MessageStart/{processModelInfoId}/{nodeNumber}/start ^
-F "key={API key}" ^
-F "{PARAMETER of File type Data Item}=@{FILE PATH}}" ^
-F "name1=content1" ^
 ...

For example, if you use the following format you can start a Process while uploading ques-kun.png and setting the Title as “TEST”.


curl https://example.questetra.net/System/Event/MessageStart/{processModelInfoId}/{nodeNumber}/start ^
-F "key={API key}" ^
-F "title=test" ^
-F "q_file=@ques-kun.png"

To summarize the contents so far, you can also write the following commands.


curl https://example.questetra.net/System/Event/MessageStart/{processModelInfoId}/{nodeNumber}/start ^
-F "key={API key}" ^
-F "title=TEST" ^
-F "q_str=This is testing for Process Start." ^
-F "q_float=1.23" ^
-F "q_selects=false" ^
-F "q_date=2018-04-01" ^
-F "q_datetime=2018-04-01 12:34" ^
-F "q_file=@ques-kun-01.png" ^
-F "q_file=@ques-kun-02.png" ^
-F "q_email=questetra+Canarias@gmail.com" ^
-F "q_group=10 Management Department"

Before you execute the example command, please replace the values to be passed to the File-type/User-type Data Items respectively.

  • For ques-kun-01.png/ques-kun-02.png, replace with an appropriate file name
  • For questetra+Canarias@gmail.com, replace with an email address which has been registered to the Questetra system you are using, e.g. your email address.

When this command is executed a Process will be started that looks like the image below.

In this case, there is a file to upload so I used the -F option. As I mentioned before, it is better to use the --data-urlencode option if not dealing with files.
When sending a character string including non-ASCII characters such as Japanese to the Message Start Event (HTTP), the character code must be UTF-8. If you encounter problems such as garbled texts, please check the character code setting of your terminal.

In this way you can use the curl command to start a Process. The use of “shell scripts” or “cron”, etc. will widen the range of automation. Please be creative and take advantage of the the Message Start Event (HTTP). Next time, I will show you code examples for sending HTTP requests from Python.

Next: Starting a Process from Outside of Questetra BPM Suite (Python Chapter)

Scroll to Top

Discover more from Questetra Support

Subscribe now to keep reading and get access to the full archive.

Continue reading