User

Query user data that meets specific criteria

*Method: POST

  • URL:/rest/accounts/api/user/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" : "<security code>",
	"omflow_restapi" : 1,
	"search_conditions" : [],
	"search_columns" : [],
	"exclude_conditions" : [],
	"order_columns" : [],
	"limit" : 100,
	"start" : 0
}
  1. search_columns: optional, the field name to be queried. An example of the format is as follows.

    "search_columns" : ["id", "username", "nick_name"]

If search_columns is not filled in, all field names and field values of the query form will be returned.

  1. 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 less than value.

    • in: Filter out the same data as in the value array.

    • contains: Filter out data containing value. (3) value: field value, fill in the corresponding value according to [Personnel Management > User Management > User Information].

"search_conditions" :
[
    {
        "column" : "username",
        "condition" : "in",
        "value" : ["admin", "user001"]
    },
    {
        "column" : "id",
        "condition" : ">",
        "value" : 3
    },
    <Other conditions>,...
]
  1. exclude_conditions: Optional, excludes data that meets the conditions. The format is the same as search_conditions. The default is not to exclude any conditions. 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.

    #Positive sorting
    "order_columns" : ["id"]
    
    #Reverse sort
    "order_columns" : ["-id"]
  2. Limit: Optional, fill in the number to obtain the number of data, the default is 100.

  3. 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.

General search return format

API return example is as follows:

{
    "status": 200,
    "message": "Query successful.",
    "result": [
        {
            "id": <user number>,
            "password": <encrypted password>,
            "last_login": <last login time>,
            "is_superuser": <whether he is a manager>,
            "username": <account>,
            "first_name": <name>,
            "last_name": <last_name>,
            "is_active": <whether enabled>,
            "email": <email>,
            "nick_name": <display name>,
            "birthday": <birthday>,
            "gender": <gender>,
            "phone1": <phone>,
            "phone2": <mobile phone>,
            "extension_no": <extension>,
            "company": <company name>,
            "ad_flag": <Whether to integrate ad>,
            "ad_sid": <ad number>,
            "frequency": <front-end refresh frequency>,
            "updatetime": <update time>,
            "delete": <whether to delete>,
            "default_group": <default organization>,
            "ad_no": <employee number>
        },...
    ]
}

Use "Organization Code" to search for users in these organizations.

*Method: POST

  • URL:/rest/accounts/api/user/list-by-group/

  • 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" : "<security code>",
	"omflow_restapi" : 1,
	"org_no" : [],
	"org_name" : []
}
  1. security: required, security code.

  2. omflow_restapi: required, 1.

  3. org_no: Optional, organization code, multiple organization codes can be placed in the array. (Choose one from the organization name)

  4. org_name: Optional, organization name, multiple organization codes can be placed in the array. (Choose one from the organization code)

API return example is as follows:

{
    "status": 200,
    "message": "Read successfully.",
    "result": {
        "<organization code>": [
            {
                "user": <user number>, #This is the number used by the omflow database
                "user__nick_name": <user display name>,
                "user__username": <user account>,
                "user__ad_no": <user employee number>
            },...
        ],
        "<organization code>": [
            {
                "user": <user number>, #This is the number used by the omflow database
                "user__nick_name": <user display name>,
                "user__username": <user account>,
                "user__ad_no": <user employee number>
            },...
        ],
    }
}

Last updated