My Mission
My Mission
Query
Method: POST
URL: /rest/my-mission/api/my-mission/list/
Input parameters (postbody): The sample format is as follows.
All APIs must obtain a security code (security) before using it. For how to obtain it, please refer to the chapter [RESTAPI > Security Code].
security: required, security code.
omflow_restapi: required, 1.
search_columns: optional, the field name to be queried. An example of the format is as follows.
If search_columns is not filled in, all field names and field values of the query form will be returned.
search_conditions: Optional to filter out information that meets the conditions. Each condition in the array is a JSON object structure, and there is an AND relationship between each condition. The default is to query all data. (1) column: field ID. (2) condition: condition character, divided into the following five types. ● =: Filter out data that is exactly the same as value. ● >: Filter out data greater than value. ● <: Filter out data smaller than value. ● in: Filter out the same data as in the value array. ● contains: Filter out data containing value. (3) value: field value.
exclude_conditions: Optional, exclude data that meets the conditions, the format is the same as search_conditions, the default is No conditions are excluded.
order_columns: Optional, sort according to the specified fields. If you need to sort in reverse order, please add "-" in front of the field name. The default is to sort by ["id"]. The sample format is as follows.
limit: optional, fill in the number to obtain the data, preset Set to 100 pens.
start: optional, fill in the number from which data to start to obtain, the default is the 0th data.
Example 1: start=0, limit=100, return 100 pieces of data.
Example 2: start=1, limit=100, return 99 pieces of data.
Example 3: start=100, limit=100, return 0 pieces of data.
When the data is returned
successfully, the sample data returned is as follows:
fails, the example of returned data is as follows:
Push order
Method: POST
URL: /rest/flowmanage/api/ omdata/edit/<api_path>
Input parameters (postbody): The sample format is as follows.
All APIs must obtain a security code (security) before using it. For how to obtain it, please refer to the chapter [RESTAPI > Security Code].
Currently, the api_path on the URL can only be queried manually.
For how to query the api path, please refer to the [Application Management > Application Design] chapter.
Subsequent version updates will add an api_path field to my task list.
Quick operation
Method: POST
URL: /rest/flowmanage/api/omdata/edit/<api_path>
Input parameters (postbody): The sample format is as follows.
All APIs must obtain a security code (security) before using it. For how to obtain it, please refer to the chapter [RESTAPI > Security Code].
Currently, the api_path on the URL can only be queried manually.
For how to query the api path, please refer to the [Application Management > Application Design] chapter.
Subsequent version updates will add an api_path field to my task list.
security: required, security code.
omflow_restapi: required, 1.
action: required, just fill in "update".
data_id: required, fill in the data_id queried by the query API.
quick_action: required, fill in action1 or action2.
When the return data
is successful, the return data example is as follows:
Sample code
Python
queries my task list and performs order push actions for the specified form process``python
====================== ============== #OMFLOW My task example
Please refer to https://doc.omflow.com.tw/api-jie-shao/wo-de-ren-wu
#= =================================== import sys,requests,json
url = 'https://1.2. 3.4' # OMFLOW server address url_login = '/accounts/api/security/get/' url_my_mission = '/rest/my-mission/api/my-mission/list/' url_action = '/rest/flowmanage/api /omdata/edit/'
api_path = 'some-api-path-syscom' #Specify the API Path of the task to be processed (application management, visible in the launched application) api_id = '38ea93dc82za39as0a38ei1' #Specify the uuid of the task to be processed (Click on the form to see the URL column)
data_security = '' #Storage the security code for successful login
#========================== ==========
Log in to OMFLOW
Global variables: data_security, url, url_login
Input: user=account, pwd=password
Return: 200 = Success
#========== ========================== def login(user,pwd): global data_security response = requests.get( url + url_login, auth=( user , pwd )) data = response.json() data_code_int = data['status'] data_security = data['result']['security'] return data_code_int #================ =====================
Get my task list
Global variables: data_security, url, url_my_mission
Input: None
Return: My task list (JSON Format)
#==================================== def myMissonList(): values={ "security" : data_security, "omflow_restapi" : 1, "search_columns" : [], "search_conditions" : [], "exclude_conditions" : [], "order_columns" : [], "limit" : 100, "start" : 0 } response = requests.post( url + url_my_mission, data=values ) data = response.json() data_list = data['result'] return data_list
#==================== =================
Approval for the specified process
Global variables: data_security, url, url_action, api_path, api_id
Input: My task list (JSON format)
Return pass :
#MAIN if len(sys.argv) != 3: print('error') else: if login(sys.argv[1] , sys.argv[2]) == 200: approve(myMissonList())
Last updated