Quickly open and push orders

Quickly open and push orders

Get API

Go to Main Menu>Application Management>Listed Applications, select the application you want to query and enter the process list.

Find the process you want to query and click Settings on the far right.

After clicking, the interface will appear as follows:

  • Field settings: Customize the form list display fields for this process.

  • Order opening API: API format used when placing orders.

  • Query API: API format used when querying.

  • Order Push API: API format used when pushing orders.

billing

After clicking it, select the "Invoicing API" tab to see the API example of the process.

**The security code needs to be brought into <security>, and the content containing "<>" in the formdata must be modified. **

Among them, formdata must fill in at least the required fields. Whether it is required or not is determined by Form Field Design. For details, please refer to the chapter [Application Management > Application Design > Form Field Design]

When the order is placed successfully, there will be two types of responses.

  1. The start component of the process does not use the data verification function. At this time, data_no, also called the order number, will be returned.

{
  "status": "200",
  "message": "Order placed successfully.",
  "result": "<data_no>"
}
  1. When the initial component uses the verification function, data_no will not be returned.

{
  "status": "200",
  "message": "Order placed successfully.",
  "result": ""
}

The order failure response is as follows:

{
  "status": "404",
  "message": "Order opening failed."
}

Attached files

When opening an order, if the form has the file attachment function turned on, you can also upload files at the same time.

The Python example is as follows:

import requests,json

url = '<Ordering API URL>'
formdata = [{"id": "FORMITM_2","value": "<input>"}]
values={
  "security": "<sevurity>",
  "omflow_restapi": 1,
  "action": "create",
  "formdata": json.dumps(formdata)
}
files={'files': open('<file path>','rb')}
requests.post( url, data=values, files=files )

If there is a file field that needs to be uploaded, the example is as follows: (assuming the file field is FORMITM_3)

import requests,json

url = '<Ordering API URL>'
formdata = [{"id": "FORMITM_1","value": "<input>"}]
files_item = ['FORMITM_3'] #This parameter must be added
values={
  "security": '<security>',
  "omflow_restapi": 1,
  "action": "create",
  "formdata": json.dumps(formdata),
  "files_item": json.dumps(files_item) #This parameter must be added
}
files={'files': open('<file path>','rb'), 'FORMITM_3':open('<file path>','rb')}
response = requests.post( url, data=values, files=files )

Inquire

Select the "Query API" tab. Through this API, you can query the latest id of the data. All orders that have been opened need to obtain <data_id> before pushing the order, and **<data_id> may continue to appear during the form process. Change or more than one transaction, so you need to make an inquiry before pushing the order.

When the query is successful, the following is returned:

{
  "status": "200",
  "message": "Query successful.",
  "result": [
    {
      "data_id": "<The unique number of the data, used when pushing orders>",
      "stop_chart_text": "<Stayed level name (manually input component name)>"
    },...
  ]
}

There may be more than one result returned. When the process design contains parallel, one order may have multiple IDs processed at the same time, so it is necessary to judge and push the order based on the component name.

Note: Regardless of whether the query result is one or multiple, it will be returned in the form of an array.

When the query fails, the following is returned:

{
  "status": "404",
  "message": "Query failed."
}

Push orders

Select the "Order Push API" tab to see examples of push orders.

When the order is successfully pushed, the response will be as follows:

{
  "status": "200",
  "message": "Order pushed successfully.",
  "result": ""
}

When the order push fails, the response will be as follows:

{
  "status": "404",
  "message": "Order promotion failed."
}

Last updated