Leave record

Add

Add user leave record.

*Method: POST

  • URL:/rest/api/leave-records/add/

  • 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,
	"start" : <start time, required>,
	"end" : <end time, required>,
	"principal" : "<Person requesting leave, required, user account, nickname, employee number>",
	"substitute" : "<Agent, required, user account, nickname, employee number>",
	"identifier" : "<Identification code, optional, used to interface with leave requests from other systems.>"
}

API return example is as follows:

{
    "status": 200,
    "message": "Add successfully.",
    "result": <leave request record id>
}

List

List user's leave request records.

*Method: POST

  • URL:/rest/api/leave-records/list/

  • Input parameters (postbody): The sample format is as follows.

{
	"security" : "<security code>",
	"omflow_restapi" : 1,
	"cancel": <Whether it is cancellation data>, #Please enter 0 or 1, if not, all will be lost
	"history": <Whether it is historical data>, #Please enter 0 or 1, if not filled in, all will be collected
	"principal" : "<Person requesting leave, required, user account, nickname, employee number>",
	"substitute" : "<Agent, required, user account, nickname, and employee number can be filled in>"
}

API return example is as follows:

{
    "status": 200,
    "message": "Query successful.",
    "result": {
        "now_time" : <system current time>
        "leave_list" : [{
            "principal_id" : <leave requester id>
            "principal_id__nick_name" : <nickname of person requesting leave>
            "substitute_id" : <substitute id>
            "substitute_id__nick_name" : <substitute nickname>
            "starttime" : <start time>
            "endtime" : <end time>
            "cancel": <Whether it is cancellation data>
            "identifier" : <identifier>
        },...]
    }
}

renew

Update user leave agent.

*Method: POST

  • URL:/rest/api/leave-records/update/

  • Input parameters (postbody): The sample format is as follows.

{
	"security" : "<security code>",
	"omflow_restapi" : 1,
	"leave_id": <leave request record id, fill in one of the two identification codes>,
	"identifier": <identification code, fill in either one of the leave record id>,
	"substitute" : "<Agent, required, user account, nickname, and employee number can be filled in>"
}

API return example is as follows:

{
    "status": 200,
    "message": "Update successful.",
    "result": None
}

Logout

Cancel the user's leave record.

*Method: POST

  • URL:/rest/api/leave-records/cancel/

  • Input parameters (postbody): The sample format is as follows.

{
	"security" : "<security code>",
	"omflow_restapi" : 1,
	"leave_id": <leave request record id, fill in one of the two identification codes>,
	"identifier": <Identification code, fill in either one of the leave record ID>
}

API return example is as follows:

{
    "status": 200,
    "message": "Logout successful.",
    "result": None
}

delete

Delete the user's leave record.

*Method: POST

  • URL:/rest/api/leave-records/delete/

  • Input parameters (postbody): The sample format is as follows.

{
	"security" : "<security code>",
	"omflow_restapi" : 1,
	"leave_id": <leave request record id, fill in one of the two identification codes>,
	"identifier": <Identification code, fill in either one of the leave record ID>
}

API return example is as follows:

{
    "status": 200,
    "message": "Deletion successful.",
    "result": None
}

Last updated