OmniBPM Restful API

In addition to the organization create/activate/inactivate/delete these four APIs passed in api_key is the master API key, the others call incoming APIs are organization exclusive API.

Basically all objects have three fields, idmodelclient_extra

id is PK, required except for creation.

model A field that is used to store object, and optional can be omitted. The system will check if the form is inconsistent.

client_extra can be used to save any JSON object information, but also optional.

All the mistakes will be the following form:

{"RESPONSE": "ERR", "RMSG": "Error Message"}

If it is correct, there must be

{"RESPONSE": "OK"}

Organization

List

/api/v0.1/organization/list/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/organization/list/ \
  -H 'content-type: application/json' \
  -d '{
        "api_key":"MASTER_API_KEY"
}'

Response:

{
    "RESPONSE": "OK",
    "organizations": [
        {
            "abbr": "TEMPLATELIBRARY",
            "name": "temp",
            "__id__": 396
            "api_key": null,
            "is_active": true
        },
        {
            "abbr": "DEMO_EN",
            "name": "Demo",
            "__id__": 397,
            "api_key": null,
            "is_active": true
        }
    ]
}

Create

/api/v0.1/organization/create/

model The form of the object is optional.

name Organization name.

abbr Organization name abbreviation, and all caps, but not repeatable.

client_extra It can save any JSON object information, such as the corresponding PK and optional.

There is an extra parameter outside the organization: default_structure represents whether the default department and rank are established.The default value is true

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/organization/create/ \
  -H 'content-type: application/json' \
  -d '{
    "api_key":"MASTER_API_KEY",
    "organization": {
        "__model__": "Organization",
        "name": "Organization Name",
        "abbr": "ORGNAME",
        "__client_extra__": {"anything":"can be stored here"}
    },
    "default_structure":false
}'

Response:

{
  "RESPONSE": "OK",
  "organization": {
    "api_key": "2faf27efc6b57f0fea4d5c835249d340a3b3d7c1edf3f7bdc4005f15cc0c1eb5",
    "__id__": 11,
    "abbr": "OOO",
    "created_by": null,
    "name": "ooo",
    "__model__": "Organization",
    "is_active": true,
    "__client_extra__": {"anything":"can be stored here"}
  }
}

If you have duplicate organization name:

{"RESPONSE": "ERR", "RMSG": "Duplicate Name."}

Inactivate

/api/v0.1/organization/inactivate/

id It is required, and it is organization PK in OmniBPM.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/organization/inactivate/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key": "MASTER_API_KEY",
  "organization": {
    "__id__": 11
  }
}'

Response:

{
  "RESPONSE": "OK"
}

Activate

/api/v0.1/organization/activate/

id It is required, and it is organization PK in OmniBPM.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/organization/activate/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key": "MASTER_API_KEY",
  "organization": {
    "__id__": 11
  }
}'

Response:

{
  "RESPONSE": "OK"
}

Get

/api/v0.1/organization/get/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/organization/get/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969"
}'

Response:

{
  "RESPONSE": "OK",
  "organization": {
    "is_document_title_editable_by_everyone": true,
    "signed_agreement_by_username": "admin@ORGNAME",
    "login_fail_count_threshold": 5,
    "signed_agreement_by_id": 1034,
    "signed_agreement_by_name": "admin",
    "__model__": "Organization",
    "email_notification_enabled": true,
    "created_by": null,
    "name": "Organization Name",
    "tax_id": null,
    "signed_agreement_version": 0,
    "is_unlimited_plan": false,
    "__client_extra__": {
      "anything": "can be stored here"
    },
    "is_active": true,
    "is_trial_expire_notified": false,
    "is_registration_confirmed": false,
    "registration_date": {
      "__value__": "2017-05-04T00:00:00+08:00",
      "__type__": "datetime"
    },
    "receipt_title": null,
    "__id__": 403,
    "push_notification_enabled": true,
    "azure_tenant_guid": null,
    "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
    "is_paid": false,
    "verified_email": null,
    "azure_login_enabled": false,
    "abbr": "ORGNAME",
    "trial_expire_date": {
      "__value__": "2017-06-04T00:00:00+08:00",
      "__type__": "datetime"
    }
  }
}

Update

/api/v0.1/organization/update/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/organization/update/ \
  -H 'content-type: application/json' \
  -d '{
  "organization": {
    "name": "new_name",
    "__id__": 403,
    "__client_extra__": {"usage":"just save anything you want to keep"}
  },
  "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969"
}'

Response:

{
  "RESPONSE": "OK",
  "organization": {
    "is_document_title_editable_by_everyone": true,
    "signed_agreement_by_username": "admin@ORGNAME",
    "login_fail_count_threshold": 5,
    "signed_agreement_by_id": 1034,
    "signed_agreement_by_name": "admin",
    "__model__": "Organization",
    "email_notification_enabled": true,
    "created_by": null,
    "name": "Organization Name",
    "tax_id": null,
    "signed_agreement_version": 0,
    "is_unlimited_plan": false,
    "__client_extra__": {
      "anything": "can be stored here"
    },
    "is_active": true,
    "is_trial_expire_notified": false,
    "is_registration_confirmed": false,
    "registration_date": {
      "__value__": "2017-05-04T00:00:00+08:00",
      "__type__": "datetime"
    },
    "receipt_title": null,
    "__id__": 403,
    "push_notification_enabled": true,
    "azure_tenant_guid": null,
    "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
    "is_paid": false,
    "verified_email": null,
    "azure_login_enabled": false,
    "abbr": "ORGNAME",
    "trial_expire_date": {
      "__value__": "2017-06-04T00:00:00+08:00",
      "__type__": "datetime"
    }
  }
}

Delete

/api/v0.1/organization/delete/

The incoming api_key is master API key.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/organization/delete/ \
  -H 'content-type: application/json' \
  -d '{
        "api_key":"MASTER_API_KEY",
        "organization": {"__id__": 18}
}'

Response:

{
  "RESPONSE": "OK"
}

Import Users

/api/v0.1/organization/importusers/

display_name:Required, and display with name.

username:Required, and login with account.

email:Required.

is_external:Required, and whether is external user(NO).

is_active:Required, and whether is enabled.

department:Required, department.

rank:Required, rank.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/organization/importusers/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "users": [
    {
      "is_external":false,
      "display_name": "Super New User",
      "username": "new2@ORGNAME",
      "email": "new2@email.com",
      "is_active": true,
      "department": {"__id__": 1921},
      "rank": {"__id__": 1242}
    }
  ]
}'

Response:

{
  "RESPONSE": "OK"
}

Department

Department object is roughly like this:

{
    "organization": {
        ...
    },
    "department_head": null,
    "name": "CEO's Office",
    "is_active": true,
    "parent_department": null,
    "__id__": 1909,
    "__model__": "Department"
}
  • name:Department name.

  • parent_department:The upper level of the department, if the null is the highest department. If it is not null, it is the department object. Only this object will not have parent_department , and attribute has been strung up, at most only a layer.

  • department_head:The supervisor of department is a User Object.

  • is_active:Whether is enabled.

  • id:It is organization PK in OmniBPM.

List

/api/v0.1/department/list/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/department/list/ \
  -H 'content-type: application/json' \
  -d '{
        "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969"
}'

Response:

{
  "RESPONSE": "OK",
  "departments": [
    {
      "organization": {
        ...
      },
      "department_head": null,
      "name": "CEO's Office",
      "is_active": true,
      "parent_department": null,
      "__id__": 1909,
      "__model__": "Department"
    },
    {
      "organization": {
        ...
      },
      "department_head": null,
      "name": "MIS Department",
      "is_active": true,
      "parent_department": {
        "organization_name": "Organization Name",
        "department_head": null,
        "organization_id": 403,
        "name": "CEO's Office",
        "is_active": true,
        "parent_department": null,
        "__id__": 1909,
        "__model__": "Department"
      },
      "__id__": 1910,
      "__model__": "Department"
    },
    {
      "organization": {
        ...
      },
      "department_head": null,
      "name": "Finance Department",
      "is_active": true,
      "parent_department": {
        "organization_name": "Organization Name",
        "department_head": null,
        "organization_id": 403,
        "name": "CEO's Office",
        "is_active": true,
        "parent_department": null,
        "__id__": 1909,
        "__model__": "Department"
      },
      "__id__": 1911,
      "__model__": "Department"
    },
    {
      "organization": {
        ...
      },
      "department_head": null,
      "name": "HR Department",
      "is_active": true,
      "parent_department": {
        "organization_name": "Organization Name",
        "department_head": null,
        "organization_id": 403,
        "name": "CEO's Office",
        "is_active": true,
        "parent_department": null,
        "__id__": 1909,
        "__model__": "Department"
      },
      "__id__": 1912,
      "__model__": "Department"
    },
    {
      "organization": {
        ...
      },
      "department_head": null,
      "name": "Sales Department",
      "is_active": true,
      "parent_department": {
        "organization_name": "Organization Name",
        "department_head": null,
        "organization_id": 403,
        "name": "CEO's Office",
        "is_active": true,
        "parent_department": null,
        "__id__": 1909,
        "__model__": "Department"
      },
      "__id__": 1913,
      "__model__": "Department"
    },
    {
      "organization": {
        ...
      },
      "department_head": null,
      "name": "Purchasing Department",
      "is_active": true,
      "parent_department": {
        "organization_name": "Organization Name",
        "department_head": null,
        "organization_id": 403,
        "name": "CEO's Office",
        "is_active": true,
        "parent_department": null,
        "__id__": 1909,
        "__model__": "Department"
      },
      "__id__": 1914,
      "__model__": "Department"
    }
  ]
}

Create

/api/v0.1/department/create/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/department/create/ \
  -H 'content-type: application/json' \
  -d '{
    "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
    "department":{
      "organization_id":403,
      "name":"打雜部",
      "parent_department": {"__id__":1910},
      "department_head" : {"__id__":1234}
    }
}'

Response:

{
  "RESPONSE": "OK",
  "department": {
    "organization": {
      ...
    },
    "department_head": null,
    "name": "打雜部",
    "is_active": true,
    "parent_department": {
      "organization_name": "Organization Name",
      "parent_department_id": 1909,
      "organization_id": 403,
      "name": "MIS Department",
      "is_active": true,
      "department_head": {...},
      "__id__": 1910,
      "parent_department_name": "CEO's Office",
      "__model__": "Department"
    },
    "__id__": 1921,
    "__model__": "Department"
  }
}

Inactivate

/api/v0.1/department/inactivate/

The department must have no users. If there are users under the department, it will return error.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/department/inactivate/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "department": {
    "__id__": 1921
  }
}'

Response:

{
  "RESPONSE": "OK"
}

Activate

/api/v0.1/department/activate/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/department/activate/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "department": {
    "__id__": 1921
  }
}'

Response:

{
  "RESPONSE": "OK"
}

Update

/api/v0.1/department/update/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/department/update/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "department": {
    "name": "新雜事部",
    "department_head": {"__id__":1999},
    "__id__": 1921
  }
}'

Response:

{
  "RESPONSE": "OK",
  "department": {
    "organization_id": 403,
    "__id__": 1921,
    "parent_department_name": "MIS Department",
    "parent_department_id": 1910,
    "__model__": "Department",
    "department_head": { ... },
    "organization": { ... },
    "parent_department": { ... },
    "name": "新雜事部",
    "is_active": false,
    "organization_name": "Organization Name"
  }
}

Delete

/api/v0.1/department/delete/

It will check if there is a child department. If there is, you can not delete. In addition, if there are references to this department in the workflow, it can not be deleted.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/department/delete/ \
  -H 'content-type: application/json' \
  -d '{
        "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
        "department":{"__id__": 1921}
}'

Response:

{
  "RESPONSE": "OK"
}

Rank

{
  "organization": { ... },
  "level": 4,
  "name": "Specialist",
  "is_active": true,
  "__id__": 1234,
  "__model__": "UserRank"
}
  • level Rank, the smaller the number, the higher it is.

  • name Rank name.

List

/api/v0.1/rank/list/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/rank/list/ \
  -H 'content-type: application/json' \
  -d '{
        "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969"
}'

Response:

{
  "RESPONSE": "OK",
  "ranks": [
    {
      "organization": {
        ...
      },
      "level": 1,
      "name": "Executive Officer",
      "is_active": true,
      "__id__": 1231,
      "__model__": "UserRank"
    },
    {
      "organization": {
        ...
      },
      "level": 2,
      "name": "Director",
      "is_active": true,
      "__id__": 1232,
      "__model__": "UserRank"
    },
    {
      "organization": {
        ...
      },
      "level": 3,
      "name": "Manager",
      "is_active": true,
      "__id__": 1233,
      "__model__": "UserRank"
    },
    {
      "organization": {
        ...
      },
      "level": 4,
      "name": "Specialist",
      "is_active": true,
      "__id__": 1234,
      "__model__": "UserRank"
    }
  ]
}

Create

/api/v0.1/rank/create/

level Required. It can not repeat with the existing level, otherwise there will be error.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/rank/create/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "rank":{
    "name": "打雜的",
    "level": 10
  }
}'

Response:

{
  "RESPONSE": "OK",
  "rank": {
    "organization": {
      ...
    },
    "level": 10,
    "name": "打雜的",
    "is_active": true,
    "__id__": 1242,
    "__model__": "UserRank"
  }
}

If the level is repeated, there will be mistakes:

{
  "RESPONSE": "ERR",
  "RMSG": "Duplicate Name."
}

Inactivate

/api/v0.1/rank/inactivate/

Incativate rank so that is_active is false. The inactivated rank will still appear in the list of API, and usually the images will display that used strike to express. The inactivated rank does not change the value of level.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/rank/inactivate/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "rank": {
    "__id__": 1242
  }
}'

Response:

{
  "RESPONSE": "OK"
}

If there are users at this rank, there will be an error in inactivating. You must designate user as another level before you can inactivate it.

{
  "RMSG": "Trying to delete a non-empty user rank",
  "RESPONSE": "ERR"
}

Activate

/api/v0.1/rank/activate/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/rank/activate/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "rank": {
    "__id__": 1242
  }
}'

Response:

{
  "RESPONSE": "OK"
}

Update

/api/v0.1/rank/update/

You can not change level, but can only change name. If you want to change level, you need to use rank/order API.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/rank/update/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "rank":{
    "__id__": 1242,
    "name": "新打雜職等"
  }
}'

Response:

{
  "RESPONSE": "OK",
  "rank": {
    "organization": {
      ...
    },
    "level": 10,
    "name": "新打雜職等",
    "is_active": true,
    "__id__": 1242,
    "__model__": "UserRank"
  }
}

Delete

/api/v0.1/rank/delete/

It will check to see if any user is at this rank. If there is, you can not delete. In addition, if there are references to this rank in the workflow, it can not be deleted.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/rank/delete/ \
  -H 'content-type: application/json' \
  -d '{
        "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
        "rank":{"__id__": 1242}
}'

Response:

{
  "RESPONSE": "OK"
}

Order

/api/v0.1/rank/order/

Adjust the level of rank. Use rank_order to input ranks. The more advanced, the rank more higher (level more smaller). Inactivated rank must also be input.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/rank/order/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "rank_order": [
    {"__id__": 1234},
    {"__id__": 1232},
    {"__id__": 1231},
    {"__id__": 1233},
    {"__id__": 1242}
  ]
}'

Response:

{
  "RESPONSE": "OK"
}

If the incoming rank_order miss any rank, there will be an error.

{
  "RESPONSE": "ERR",
  "RMSG": "Missing ranks in the order list."
}

User

{
  "__model__": "UserProfile",
  "is_active": true,
  "is_external": false,
  "username": "hello@ORGNAME",
  "email": "hello@email.com",
  "display_name": "John Cena",
  "__id__": 1037,
  "organization": { ... },
  "organization_name": "Organization Name",
  "organization_id": 403,
  "rank": { ... },
  "rank_name": "Specialist",
  "rank_id": 1234,
  "department": { ... },
  "department_name": "MIS",
  "department_id": 1922,
  "__client_extra__": {}
}

Basic structure as above, there will have some additional fields (such as azure_* that are related to Microsoft login) and can not be ignored. The main fields are as follows:

  • username must be login@org.abbr, and org.abbr is upper case.

  • display_name Display full name.

  • email

  • is_active Whether is a valid user, true.

  • is_external Whether is an external user. False can be filled in the MDS context.

  • id PK.

  • rank Rank.

  • department Department.

List

/api/v0.1/user/list/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/user/list/ \
  -H 'content-type: application/json' \
  -d '{
        "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969"
}'

Response:

{
  "users": [
    {
      "__model__": "UserProfile",
      "is_active": true,
      "is_external": false,
      "username": "hello@ORGNAME",
      "email": "hello@email.com",
      "display_name": "John Cena",
      "__id__": 1037,
      "misc_data": "",
      "organization": { ... },
      "organization_name": "Organization Name",
      "organization_id": 403,
      "rank": { ... },
      "rank_name": "Specialist",
      "rank_id": 1234,
      "department": { ... },
      "department_name": "MIS",
      "department_id": 1922
    }
  ],
  "RESPONSE": "OK"
}

Create

/api/v0.1/user/create/

At present, rank and department are necessary, but they will automatically bring the default value if not transmitted. Rank / Department are required field. with_admin_permissions: If it is true, the established users enter the web page backstage and they can manage the organization and so on.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/user/create/ \
  -H 'content-type: application/json' \
  -d '{
        "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
        "user":{
            "username":"alejandro@ORGNAME",
            "email":"alejandro@email.com",
            "password":"123456",
            "display_name":"Alejandro Valverde",
            "rank": {"__id__": 1234},
            "department": {"__id__": 1922},
            "__client_extra__":{"save":"anything"}
        }
}'

Response:

{
  "user": {
    "organization_id": 403,
    "is_active": true,
    "rank_name": "Specialist",
    "display_name": "Alejandro Valverde",
    "department_name": "MIS",
    "__id__": 1042,
    "organization": { ... },
    "username": "alejandro@ORGNAME",
    "email": "alejandro@email.com",
    "__client_extra__": {
      "save": "anything"
    },
    "__model__": "UserProfile",
    "is_external": false,
    "organization_name": "Organization Name",
    "rank": { ... },
    "rank_id": 1234,
    "department": { ... },
    "department_id": 1922
  },
  "RESPONSE": "OK"
}

Inactivate

/api/v0.1/user/inactivate/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/user/inactivate/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "user": {"__id__": 1036}
}'

Response:

{"RESPONSE": "OK"}

Activate

/api/v0.1/user/activate/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/user/activate/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "user": {"__id__": 1036}
}'

Response:

{"RESPONSE": "OK"}

Update

/api/v0.1/user/update/

The fields that can be modified are

  • rank

  • department (If department is inactivated, there will have mistakes.)

  • display_name

  • email

  • password

  • is_active (Functions equivalent to user/activate and user/inactivate

  • client_extra

Request:

{
  "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
    "user": {
      "display_name": "Alejandro Valverde Belmonte",
      "__id__": 1042,
      "email": "balaverde@email.com",
      "__client_extra__": {
        "save": "anything updated"
      }
  }
}

Response:

{
  "user": {
    "organization_id": 403,
    "rank_name": "Specialist",
    "organization_name": "Organization Name",
    "organization": { ... },
    "__client_extra__": {
      "save": "anything updated"
    },
    "department_id": 1922,
    "rank_id": 1234,
    "rank": { ... },
    "__model__": "UserProfile",
    "department": { ... },
    "display_name": "Alejandro Valverde Belmonte",
    "__id__": 1042,
    "department_name": "MIS",
    "username": "alejandro@ORGNAME",
    "email": "balaverde@email.com",
    "is_external": false,
    "is_active": true,
  },
  "RESPONSE": "OK"
}

Delete

/api/v0.1/user/delete/

It will check if there are references to this user in the process. If there is, you can not delete. (If the group is reference, it can be deleted and the group can remove one member after deleted.)

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/user/delete/ \
  -H 'content-type: application/json' \
  -d '{
        "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
        "user":{"__id__": 1042}
}'

Response:

{
  "RESPONSE": "OK"
}

Error: (It can not be deleted if the user is a department supervisor.)

{
  "RESPONSE": "ERR",
  "RMSG": "Cannot delete user who is the head of <QuerySet [<Department: MIS>]>"
}

Group

{
      "organization_id": 403,
      "__id__": 755,
      "__model__": "GroupProfile",
      "organization": { ... },
      "organization_name": "Organization Name",
      "is_active": true,
      "name": "All Users"
}

Each organization default have two groups, such as All Users and External Users. The contents of these two groups are generated by system and cannot be edited.

If you want to get/modify a list of users in the group, you need to call /api/v0.1/group/user/list/, /api/v0.1/group/user/add/ and /api/v0.1/group/user/remove/.

List

/api/v0.1/group/list/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/group/list/ \
  -H 'content-type: application/json' \
  -d '{
        "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969"
}'

Response:

{
  "groups": [
    {
      "organization_id": 403,
      "__id__": 755,
      "__model__": "GroupProfile",
      "organization": { ... },
      "organization_name": "Organization Name",
      "is_active": true,
      "name": "All Users"
    },
    {
      "organization_id": 403,
      "__id__": 756,
      "__model__": "GroupProfile",
      "organization": { ... },
      "organization_name": "Organization Name",
      "is_active": true,
      "name": "External Users"
    }
  ],
  "RESPONSE": "OK"
}

Create

/api/v0.1/group/create/

name Name under the same organization must be a unique value and can not be duplicated. Different organizations can be duplicated.

users List of user who want to join this group, optional.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/group/create/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "group":{"name":"B工作小組"},
  "users":[{"__id__": 10}, {"__id__": 12}]
}'

Response:

{
  "group": {
    "is_active": true,
    "organization_id": 403,
    "__model__": "GroupProfile",
    "organization": { ... },
    "name": "B工作小組",
    "organization_name": "Organization Name",
    "__id__": 764
  },
  "RESPONSE": "OK"
}

Inactivate

/api/v0.1/group/inactivate/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/group/inactivate/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "group": {"__id__": 764}
}'

Response:

{"RESPONSE": "OK"}

Activate

/api/v0.1/group/activate/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/group/activate/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "group": {"__id__": 764}
}'

Response:

{"RESPONSE": "OK"}

Update

/api/v0.1/group/update/

You can only change name. If the value is not updated, there will be error. is_active (Functions equivalent to group/activate and group/inactivate

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/group/update/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "group": {"__id__": 764, "name":"C工作小組"}
}'

Response:

{"RESPONSE": "OK"}

If the incoming value is original name, you will encounter an error.

{
   "RMSG" : "Internal server error, please report the bug to service@omnibpm.com",
   "REASON" : "'name'",
   "RESPONSE" : "ERR"
}

Delete

/api/v0.1/group/delete/

Delete group.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/group/delete/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key":"761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3",
  "group":{"__id__":15}
}'

Response:

{
    "RESPONSE": "OK"
}

User List

/api/v0.1/group/user/list/

List members of a group.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/group/user/list/ \
  -H 'content-type: application/json' \
  -d '{
        "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
        "group":{"__id__":764}
}'

Response:

{
  "users": [
    {
      "department": { ... },
      "department_name": "MIS",
      "rank": { ... },
      "is_active": true,
      "username": "hello@ORGNAME",
      "display_name": "John Cena",
      "organization_name": "Organization Name",
      "organization_id": 403,
      "email": "hello@email.com",
      "rank_id": 1234,
      "rank_name": "Specialist",
      "department_id": 1922,
      "is_external": false,
      "organization": { ... },
      "__id__": 1037,
    }
  ],
  "RESPONSE": "OK"
}

User Add

/api/v0.1/group/user/add/

User can not be added to All Users and External Users group, and can not join the inactive group. The results will return to all members of the current group.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/group/user/add/ \
  -H 'content-type: application/json' \
  -d '{
        "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
        "group":{"__id__":764},
        "users":[
                {"__id__":1040}
        ]
}'

Response:

{
  "users": [
    {
      "department": { ... },
      "department_name": "MIS",
      "rank": { ... },
      "is_active": true,
      "username": "hello@ORGNAME",
      "display_name": "John Cena",
      "organization_name": "Organization Name",
      "organization_id": 403,
      "email": "hello@email.com",
      "rank_id": 1234,
      "rank_name": "Specialist",
      "department_id": 1922,
      "is_external": false,
      "organization": { ... },
      "__id__": 1037
    },
    {
      "department": { ... },
      "department_name": "MIS",
      "rank": { ... },
      "is_active": true,
      "username": "contador@ORGNAME",
      "display_name": "Alberto Contador",
      "organization_name": "Organization Name",
      "organization_id": 403,
      "email": "contador@email.com",
      "rank_id": 1234,
      "rank_name": "Specialist",
      "department_id": 1922,
      "is_external": false,
      "organization": { ... },
      "__id__": 1040
    }
  ],
  "RESPONSE": "OK"
}

User Remove

/api/v0.1/group/user/remove/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/group/user/remove/ \
  -H 'content-type: application/json' \
  -d '{
        "api_key":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
        "group":{"__id__":764},
        "users":[
                {"__id__":1040},
                {"__id__":1037}
        ]
}'

Response:

{
  "users": [],
  "RESPONSE": "OK"
}

Workflow

{
    "name": "測試流程",
    "is_complete": false,
    "organization": { ... },
    "__id__": 1,
    "version": 0,
    "is_active": false,
    "organization_id": 403,
    "organization_name": "Organization Name"
}

There are several important attributes in the object of the workflow, where name is only identification and can not be duplicated.

Before is_complete, the workflow can add/delete nodes, but after calling workflow/finalize, is_complete will become true. No additional nodes can be added/deleted at this time, but can only call workflow/clone to produce a new version of the original modification.

The workflow of the same name can have several versions, and the higher number have the newest version.

Between different versions of the workflow, there can only be the one is the workflow is_active.

Create

/api/v0.1/workflow/create/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow/create/ \
  -H 'content-type: application/json' \
  -d '{
        "apikey": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
        "workflow": {
                "name": "測試流程"
        }
}'

Response:

{
  "workflow": {
    "name": "測試流程",
    "is_complete": false,
    "organization": { ... },
    "__id__": 1,
    "version": 0,
    "is_active": false,
    "organization_id": 403,
    "organization_name": "Organization Name"
  },
  "RESPONSE": "OK"
}

Since name is the only value, if the workflow name has already existed, an error will be generated:

{
  "RMSG": "Duplicate Name.",
  "RESPONSE": "ERR"
}

Clone

/api/v0.1/workflow/clone/

A new version that can be modified. The flow version is greater than all the version workflows with the same name, and you can edit.(is_complete == false)。

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow/clone/ \
  -H 'content-type: application/json' \
  -d '{
        "apikey": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
        "from_workflow":{"__id__": 1}
}'

Response:

{
  "workflow": {
    "name": "測試流程",
    "is_complete": false,
    "organization": { ... },
    "__id__": 2,
    "version": 1,
    "is_active": false,
    "organization_id": 403,
    "organization_name": "Organization Name"
  },
  "RESPONSE": "OK"
}

Save As

/api/v0.1/workflow/save_as/

Save the current workflows into a new name.

workflow:Workflow object, be saved as the workflow.

new_name:String, the name of the new workflow.

Request:

curl -X "POST" "https://demo.omnibpm.com/api/v0.1/workflow/save_as/" \
     -H "Content-Type: application/json" \
     -d '{
  "workflow": {
    "__id__": 2
  },
  "new_name": "APPLE",
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3"
}'

Response:

{
  "RESPONSE": "OK",
  "workflow": {
    "is_complete": true,
    "__model__": "WorkflowDTO",
    "__id__": 11,
    "organization": { ... },
    "is_active": true,
    "name": "APPLE",
    "version": 0,
    "is_hidden": false,
    "organization_id": 1,
    "organization_name": "Hypo"
}

List

/api/v0.1/workflow/list/

name:String, optional. If you provide, it will only display the name of the workflow. If none available, it will display all the workflows.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow/list/ \
  -H 'content-type: application/json' \
  -d '{
        "apikey": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969"
}'

Response:

{
  "workflows": [
    {
      "name": "測試流程",
      "is_complete": false,
      "organization": { ... },
      "__id__": 2,
      "version": 1,
      "is_active": false,
      "organization_id": 403,
      "organization_name": "Organization Name"
    },
    {
      "name": "測試流程",
      "is_complete": false,
      "organization": { ... },
      "__id__": 1,
      "version": 0,
      "is_active": false,
      "organization_id": 403,
      "organization_name": "Organization Name"
    }
  ],
  "RESPONSE": "OK"
}

Update

/api/v0.1/workflow/update/

You can only modify the name property. With the same name as the original other workflow will be modified.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow/update/ \
  -H 'content-type: application/json' \
  -d '{
        "apikey": "b0a771b0f98d6f6c66b87712f71131660b58e3283d2bbaac2fde3c6e4b2c8a1c",
        "workflow": {
                "__id__": 5,
                "name": "新流程名稱"
        }
}'

Response:

{
    "RESPONSE": "OK",
    "workflow": {
        "is_active": false,
        "version": 0,
        "organization_id": 414,
        "organization": { ... },
        "name": "新流程名稱",
        "__id__": 5,
        "is_complete": false
    }
}

Finalize

/api/v0.1/workflow/finalize/

When you are finished editing nodes, after calling is_complete, it will become true and workflow will not be edited.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow/finalize/ \
  -H 'content-type: application/json' \
  -d '{
        "apikey": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
        "workflow": { "__id__": 2 }
}'

Response:

{
  "workflow": {
    "name": "測試流程",
    "is_complete": true,
    "organization": { ... },
    "__id__": 2,
    "version": 1,
    "is_active": false,
    "__model__": "WorkflowDTO",
    "organization_id": 403,
    "organization_name": "Organization Name"
  },
  "RESPONSE": "OK"
}

Activate

/api/v0.1/workflow/activate/

The workflow will be set to the current workflow(can create a new document), after calling is_active, it will be true and the other version of the flow will be set to is_active == false.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow/activate/ \
  -H 'content-type: application/json' \
  -d '{
        "apikey": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
        "workflow": { "__id__": 2 }
}'

Response:

{
  "workflow": {
    "name": "測試流程",
    "is_complete": true,
    "organization": { ... },
    "__id__": 2,
    "version": 1,
    "is_active": true,
    "organization_id": 403,
    "organization_name": "Organization Name"
  },
  "RESPONSE": "OK"
}

Inactivate

/api/v0.1/workflow/inactivate/

The workflow will be set to expire (is_active == false, can not create new document).

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow/inactivate/ \
  -H 'content-type: application/json' \
  -d '{
        "apikey": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
        "workflow": { "__id__": 2 }
}'

Response:

{
  "workflow": {
    "name": "測試流程",
    "is_complete": true,
    "organization": { ... },
    "__id__": 2,
    "version": 1,
    "is_active": false,
    "organization_id": 403,
    "organization_name": "Organization Name"
  },
  "RESPONSE": "OK"
}

Hide

/api/v0.1/workflow/hide/

Hide workflow. After hiding list, it will not be listed.

Request:

curl -X "POST" "https://demo.omnibpm.com/api/v0.1/workflow/hide/" \
     -H "Content-Type: application/json" \
     -d '{
  "workflow": {
    "__id__": 8
  },
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3"
}'

Response:

{
  "RESPONSE": "OK"
}

Delete

/api/v0.1/workflow/delete/

Delete workflow. If the workflow have generated the document, it can not be deleted.

Request:

## workflow/delete/
curl -X "POST" "https://demo.omnibpm.com/api/v0.1/workflow/delete/" \
     -H 'Content-Type: application/json' \
     -d $'{
  "workflow": {
    "__id__": 89
  },
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3"
}'

Response:

{
  "RESPONSE": "OK"
}

Workflow Permission

A workflow permission can use for

  • user:User.

  • group:Group.

  • department:Department.

(Optional) Set separately

  • is_creatable:Whether can set a document.

  • is_visible:Whether the document is visible.

  • is_revokable:Whether can revoke a document.

  • is_revivable:Whether can return the completed document (status changes to ``in progress'').

(The above permissions can exist at the same time)

Permissions are shared by all versions, so if the new version of the workflow modify permissions, the old version will also be affected.

{
  "is_revokable": false,
  "is_creatable": true,
  "is_visible": true,
  "is_revivable": false,
  "group": { ... }
}

List

/api/v0.1/workflow_perm/list/

List the permissions for a workflow

  • workflow: Workflow object. List the process permission settings.

Output format such as workflow_perm/set/.

Request:

## workflow_perm/list/
curl -X "POST" "https://demo.omnibpm.com/api/v0.1/workflow_perm/list/" \
     -H 'Content-Type: application/json' \
     -d $'{
  "workflow": {
    "__id__": 102
  },
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3"
}'

Response:

{
  "RESPONSE": "OK",
  "revivable_users": [],
  "visible_groups": [],
  "visible_departments": [],
  "creatable_departments": [],
  "revivable_groups": [],
  "revokable_groups": [],
  "creatable_groups": [
    { ... }
  ],
  "creatable_users": [],
  "revokable_users": [],
  "revivable_departments": [],
  "visible_users": [],
  "revokable_departments": []
}

Set

/api/v0.1/workflow_perm/set/

Setting permissions

  • workflow:Workflow object. Set permissions for a workflow.

權限設定:

  • creatable_users:Array of User objects.

  • visible_users:Array of User objects.

  • revokable_users:Array of User objects.

  • revivable_users:Array of User objects.

  • creatable_groups:Array of Group objects.

  • visible_groups:Array of Group objects.

  • revokable_groups:Array of Group objects.

  • revivable_groups:Array of Group objects.

  • creatable_departments:Array of Department objects.

  • visible_departments:Array of Department objects.

  • revokable_departments:Array of Department objects.

  • revivable_departments:Array of Department objects.

If you don’t provide the above permission arrays, they will be cleared. Therefore, as long as all you don’t upload anything or empty array, all permissions will be empty.

Request:

## workflow_perm/set/
curl -X "POST" "https://demo.omnibpm.com/api/v0.1/workflow_perm/set/" \
     -H 'Content-Type: application/json' \
     -d $'{
  "workflow": { "__id__": 102 },
  "revokable_groups": [
    { "__id__": 1 }
  ],
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3",
  "visible_users": [
    { "__id__": 19 },
    { "__id__": 2 }
  ],
  "creatable_users": [
    { "__id__": 2 }
  ]
}'

Response:

{"RESPONSE": "OK"}

Delete

/api/v0.1/workflow_perm/delete/

Remove user/group/department of the permissions of a workflow. This API can only delete one object permission.

  • workflow

The following objects can only choose one to fill:

  • user

  • group

  • department

Request:

## workflow_perm/delete/
curl -X "POST" "https://demo.omnibpm.com/api/v0.1/workflow_perm/delete/" \
     -H 'Content-Type: application/json' \
     -d $'{
  "workflow": {
    "__id__": 102
  },
  "user": {
    "__id__": 19
  },
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3"
}'

Response:

{"RESPONSE": "OK"}

Workflow Node

The structure node is complex and different type will have a different field.

Required fields:

n_sign:You want how many people to approve this node that it can be completed.

note:Node name.

The following fields do not exist at the same time, in accordance with ``who can sign'' to classify, and you must select one.

  • Department

    • department:The type of department is JSON object, as long as the id key exists.

  • Group

    • group:The type of groupis JSON object, as long as the id key exists.

  • User

    • user:The type of user is JSON object, as long as the id key exists.

  • Supervisor approval(Ranl up to what rank)

    • rank:The type of rank is JSON object, as long as the id key exists.

    • reference_node:Supervisor reference point for null on behalf of the workflow initiator, otherwise reference for user who aprroving reference_node.

    • sign_by_at_least_one_supervisor:The default value is true that requiring at least a supervisor approval.(even if the rank is higher than required)

  • Workflow initiator

    • as_doc_creator: true

  • To be specified

    • as_specified: true

    • job_assignment_node:In which node to assign supervisor. The type of workflow node is JSON Object, as long as the id key exists.

    • job_assignment_typeASSIGN represents that the supervisor of job_assignment_node is responsible for assigning;COPY represents that the supervisor of job_assignment_node synchronize, and job_assignment_node must be to ``to be specified'', unless there will have errors.

In addition to the node of to be specified'', other nodes of job_assignment_node and job_assignment_type are optional, and we need to fill null and empty string that representing not to be specified''.The only group node supports the synchronization supervisor (job_assignment_type == COPY ), and job_assignment_node is also referenced to the group node and belong to the same group.

The following parameters are not required:

require_all_cc_response:After all CC users give response, they will continue to the next node. The default value is false.

allow_cc:Allow CC. The default value is true.

allowed_cc_departments:Array of Department Objects, and represents the user of this department can be CC.

allowed_cc_groups:Array of Group Objects, and represents the user of this group can be CC.

allowed_cc_users:Array of User Objects, and represents the user can be CC.

autocomplete_condition:String, skip conditions (formula). If the condition is true, you skip this node and does not perform.

autocomplete_deadline:Int, the number of seconds. After the expiration of the time, they will skip this node automatically.

If you do not fill, you can set allowed_cc_groups for ``All Users'' group.

required_fields:``Required fields'', array of workflow field, if not fill the default is empty.

editable_fields:``Editable fields'', array of workflow field, if not fill the default is empty.

visible_fields:``Visible fields'', Array of Workflow Field. If you don’t set the current workflow of all fields, you can see at least one field, but you can not upload an empty array.

Required fields'' must also be Editable'' and Visible'', and Editable fields'' must be `Visible''. If you update `required_fields:[f1], editable_fields:[f2], visible_fields[f3], the result will be required_fields:[f1], editable_fields[f1, f2], visible_fields[f1, f2, f3].

The following fields through special API: children_set:Array of Workflow Node JSON object. On behalf of the child nodes. Increase or decrease through workflow_node/add_child and workflow_node/remove_child.

The following fields are read-only: node_type:There are four value department, user, group and userrank. The workflow initiators'' and to be specified'' are the user types.

Create

/api/v0.1/workflow_node/create/

1.Generate the node of ``To be specified'':

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_node/create/ \
  -H 'content-type: application/json' \
  -d '{
  "apikey": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "workflow": {"__id__": 2 },
  "node":{
    "note":"待指定負責人節點",
    "as_specified": true,
    "job_assignment_node": {"__id__": 21 },
    "job_assignment_type": "ASSIGN",
    "n_sign": 1,
    "visible_fields": [{"__id__": 404}],
    "editable_fields": [{"__id__": 405}],
    "required_fields": [{"__id__": 406}]
  }
}'

Response:

{
    "node": {
        "node_type": "user",
        "job_assignment_node": { ... },
        "n_sign": 1,
        "allowed_cc_groups": [],
        "allowed_cc_users_ids": [],
        "children_set_ids": [],
        "job_assignment_node_id": 21,
        "user": null,
        "note": "待指定負責人節點",
        "as_doc_creator": false,
        "allowed_cc_users": [],
        "organization_id": 10,
        "allowed_cc_departments": [],
        "allowed_cc_departments_ids": [],
        "require_all_cc_response": false,
        "job_assignment_type": "ASSIGN",
        "organization": { ... },
        "is_active": true,
        "is_complete": false,
        "allowed_cc_groups_ids": [],
        "organization_name": "Organization Name",
        "allow_cc": true,
        "__id__": 98,
        "children_set": [],
        "as_specified": true,
        "autocomplete_condition": null
    },
    "RESPONSE": "OK"
}

2.Generate the node of ``Workflow initiator'':

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_node/create/ \
  -H 'content-type: application/json' \
  -d '{
  "apikey": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "workflow": {"__id__": 2 },
  "node":{
    "note":"發起人節點",
    "as_doc_creator": true,
    "n_sign": 1
  }
}'

3.Generate the node of ``User'':

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_node/create/ \
  -H 'content-type: application/json' \
  -d '{
  "apikey": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "workflow": {"__id__": 2 },
  "node":{
    "note": "user節點",
    "user": {"__id__": 16},
    "n_sign": 1
  }
}'

4.Generate the node of ``Department'':

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_node/create/ \
  -H 'content-type: application/json' \
  -d '{
  "apikey": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "workflow": {"__id__": 2 },
  "node":{
    "note": "部門節點",
    "department": {"__id__": 40},
    "n_sign": 1
  }
}'

5.Generate the node of ``Group'':

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_node/create/ \
  -H 'content-type: application/json' \
  -d '{
  "apikey": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "workflow": {"__id__": 2 },
  "node":{
    "note": "群組節點",
    "group": {"__id__": 30},
    "n_sign": 1
  }
}'

6.Generate the node of ``Supervisor approval'':

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_node/create/ \
  -H 'content-type: application/json' \
  -d '{
  "apikey": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "workflow": {"__id__": 2 },
  "node":{
    "note": "主管簽核節點(發起人)",
    "rank": {"__id__": 4},
    "reference_node": null,
    "n_sign": 1
  }
}'

List

/api/v0.1/workflow_node/list/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_node/list/ \
  -H 'content-type: application/json' \
  -d '{
      "apikey":"3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
      "workflow":{"__id__": 2}
}'

Response:

 {
    "RESPONSE": "OK",
    "nodes": [
        {
            "group": { ... },
            "allowed_cc_groups": [],
            "is_active": true,
            "children_set_ids": [],
            "__id__": 71,
            "organization_id": 10,
            "allowed_cc_departments_ids": [],
            "require_all_cc_response": false,
            "node_type": "group",
            "n_sign": 1,
            "organization_name": "Organization Name",
            "group_name": "10_coolgroup",
            "is_complete": false,
            "allow_cc": true,
            "job_assignment_node": { ... },
            "job_assignment_type": "ASSIGN",
            "min_rank": null,
            "__model__": "ProcessFlowNode",
            "deadline": 0,
            "children_set": [],
            "autocomplete_condition": null,
            "trigger_workflow": null,
            "organization": { ... },
            "job_assignment_node_id": 21,
            "trigger_workflow_field_content": {},
            "allowed_cc_users": [],
            "group_id": 18,
            "allowed_cc_groups_ids": [],
            "allowed_cc_users_ids": [],
            "allowed_cc_departments": [],
            "autocomplete_deadline": 0,
            "max_rank": null,
            "note": "群組節點"
        },
        { ... },
        { ... },
        { ... }
    ]
}

Delete

/api/v0.1/workflow_node/delete/

If the deleted node has to specify to a different node, there will have mistakes.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_node/delete/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "node": {
    "__id__": 101
  }
}'

Response:

{
    "RESPONSE": "OK"
}

Update

/api/v0.1/workflow_node/update/

Like workflow_node/create to upload as a parameter, but there has id to assign which node you want to modify.

Note that this method Internal Implementation is to cut off the original node. The relations between nodes will maintain, so be aware of the return id.

It is recommended that modifying only the same type of node. For example:department node modify department is secure, but it is not recommended to modify the department node to group node (not test what happens).

Return:

node:The node after modifying.

job_assigned_nodes_ids:Array of Integer. All nodes specified by approval of the node ID.

referenced_nodes_ids:Array of Integer. All of the reference node ID for this node.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_node/update/ \
  -H 'content-type: application/json' \
  -d '{
  "apikey": "b0a771b0f98d6f6c66b87712f71131660b58e3283d2bbaac2fde3c6e4b2c8a1c",
  "node":{
          "__id__": 10414,
    "note":"New Name"
  }
}'

Response:

{
    "job_assigned_nodes_ids": [456],
    "referenced_nodes_ids": [123],
    "node": {
        "allowed_cc_users": [],
        "allowed_cc_departments_ids": [],
        "require_all_cc_response": false,
        "trigger_workflow_field_content": {},
        "trigger_workflow": null,
        "autocomplete_deadline": 0,
        "autocomplete_condition": null,
        "job_assignment_node": null,
        "organization": { ... },
        "user": null,
        "note": "New Name",
        "allowed_cc_groups_ids": [],
        "allow_cc": true,
        "children_set_ids": [],
        "__id__": 10415,
        "allowed_cc_groups": [],
        "n_sign": 1,
        "allowed_cc_users_ids": [],
        "children_set": [],
        "is_active": true,
        "node_type": "user",
        "is_notifying_member_on_enter": false,
        "organization_id": 414,
        "allowed_cc_departments": [],
        "deadline": 0,
        "organization_name": "YSL",
        "as_specified": false,
        "as_doc_creator": true,
        "is_complete": false,
        "job_assignment_type": ""
    },
    "RESPONSE": "OK"
}

Add Child

/api/v0.1/workflow_node/add_child/

The establishment of relations between nodes.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_node/add_child/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "node": { "__id__": 100 },
  "child": { "__id__": 99 }
}'

Response:

{
    "RESPONSE": "OK",
    "node": {
        "children_set_ids": [99],
        "children_set": [
            {
                "job_assignment_node": null,
                "job_assignment_type": "",
                "as_specified": false,
                "__model__": "ProcessFlowNode",
                "deadline": 0,
                "is_active": true,
                "children_set_ids": [],
                "__id__": 99,
                "autocomplete_condition": null,
                "trigger_workflow": null,
                "organization_id": 10,
                "allowed_cc_departments_ids": [],
                "require_all_cc_response": false,
                "node_type": "user",
                "allowed_cc_groups_ids": [],
                "as_doc_creator": true,
                "allowed_cc_users_ids": [],
                "user": null,
                "n_sign": 1,
                "organization_name": "hypo",
                "autocomplete_deadline": 0,
                "is_complete": false,
                "trigger_workflow_field_content": {},
                "allow_cc": true,
                "note": "發起人節點"
            }
        ],
        ... (其他屬性不變)
    }
}

Remove Child

/api/v0.1/workflow_node/remove_child/

Delete the relations between nodes.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_node/remove_child/ \
  -H 'content-type: application/json' \
  -d '{
  "api_key": "3f709f63643853c7d772d412de5597dd891dc83f7263d9e8690d8c47d739d969",
  "node": { "__id__": 100 },
  "child": { "__id__": 99 }
}'

Response:

{
    "RESPONSE": "OK",
    "node": {
        "children_set_ids": [],
        "children_set": [],
        ... (其他屬性不變)
    }
}

Workflow Field

{
        "organization_id": 10,
        "data_type": "UTF8",
        "is_active": true,
        "__id__": 55,
        "organization_name": "Organization Name",
        "organization": { ... },
        "name": "NEWFIELD",
}
  • data_type:Legal value UTF8 / BOOL / DECIMAL / INT / FORMULA / DATE.

  • name:Fields name.

  • formula:Formula content.

Can not delete and decide whether display by is_active.

Create

/api/v0.1/workflow_field/create/

When establishing, the default will allow the workflow of all nodes (visible_fields). If you want to change the settings, please use the workflow_node/update API.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_field/create/ \
  -H 'content-type: application/json' \
  -d '{
  "apikey": "test_key",
  "workflow": {"__id__": 24 },
  "field":{
    "name":"NEWFIELD",
    "data_type": "UTF8"
  }
}'

Response:

{
    "RESPONSE": "OK",
    "field": {
        "organization_id": 10,
        "data_type": "UTF8",
        "is_active": true,
        "__id__": 55,
        "organization_name": "Organization Name",
        "organization": { ... },
        "name": "NEWFIELD"
    }
}

Batch

/api/v0.1/workflow_field/batch/

The establishment of more than one field.

fields To create a field list.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_field/batch/ \
  -H 'content-type: application/json' \
  -d '{
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3",
  "workflow": {"__id__": 1 },
  "fields":[
    {
      "name":"Gender",
      "data_type": "UTF8"
    },
    {
      "name":"Age",
      "data_type": "UTF8"
    },
    {
      "name":"Address",
      "data_type": "UTF8"
    }
  ]
}'

Response:

{
    "RESPONSE": "OK",
    "fields": [
        {
            "is_complete": false,
            "name": "Gender",
            "is_active": true,
            "organization_id": 1,
            "data_type": "UTF8",
            "__id__": 10,
            "organization": { ... }
        },
        {
            "is_complete": false,
            "name": "Age",
            "is_active": true,
            "organization_id": 1,
            "data_type": "UTF8",
            "__id__": 11,
            "organization": { ... }
        },
        {
            "is_complete": false,
            "name": "Address",
            "is_active": true,
            "organization_id": 1,
            "data_type": "UTF8",
            "__id__": 12,
            "organization": { ... }
        }
    ]
}

List

/api/v0.1/workflow_field/list/

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_field/list/ \
  -H 'content-type: application/json' \
  -d '{
    "apikey": "test_key",
    "workflow": { "__id__": 24 }
}'

Response:

{
    "RESPONSE": "OK",
    "fields": [
        {
            "organization_id": 10,
            "data_type": "UTF8",
            "is_active": true,
            "__id__": 55,
            "organization_name": "Organization Name",
            "organization": { ... },
            "name": "NEWFIELD",
            "workflow_visible": true
        },
        {
            "organization_id": 10,
            "data_type": "UTF8",
            "is_active": true,
            "__id__": 54,
            "organization_name": "Organization Name",
            "organization": { ... },
            "name": "Another field",
            "workflow_visible": false
        }
    ]
}

Activate

/api/v0.1/workflow_field/activate/

workflow:Workflow object. The workflow need to add fields.

fields:Array of field object. The workflow want to add fields.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_field/activate/ \
  -H 'content-type: application/json' \
  -d '{
    "apikey":"test_key",
    "workflow": {"__id__": 32},
    "fields":[{"__id__": 65}]
}'

Response:

{
    "RESPONSE": "OK"
}

Inactivate

/api/v0.1/workflow_field/inactivate/

workflow:Workflow object. The workflow need to delete fields.

fields:Array of field object. The workflow want to delete fields.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_field/inactivate/ \
  -H 'content-type: application/json' \
  -d '{
    "apikey":"test_key",
    "workflow":{"__id__": 32},
    "fields":[{"__id__": 65}]
}'

Response:

{
    "RESPONSE": "OK"
}

Update

/api/v0.1/workflow_field/update/

workflow:workflow

field can update the fields.

  • name:Fields name.

  • formula:When the field type is FORMULA that can be uploaded.

  • visible_nodes:Visible fields.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/workflow_field/update/ \
  -H 'content-type: application/json' \
  -d '{
    "apikey":"test_key",
    "workflow":{"__id__": 13},
    "field":{"__id__": 55, "name": "UPDATED_FIELDNAME"}
}'

Response:

{
    "RESPONSE": "OK",
    "field": {
        "organization_id": 10,
        "data_type": "UTF8",
        "is_active": true,
        "__id__": 55,
        "organization_name": "Organization Name",
        "organization": { ... },
        "name": "UPDATED_FIELDNAME",
    }
}

Document

Document object important fields as follows:

  • creator:User object, document initiator.

  • creation_time:Date object, document creation time.

  • last_time:Date object, document last modified time.

  • completion_time:Date object, document completed time.

  • current_nodes:Array of node object, the current node.

  • completed_nodes:Array of node object, the completed node.

  • current_users:Array of user object, the current users of node.

  • current_responsible_users:Array of user object, the current responsible users of node with the CC staff to respond.

  • signed_users:Array of user object, the signed users.

  • workflow:Workflow.

  • signatures:Array of signature object.

  • comments:Array of comment.

  • filled_fields:Array of field object, all the filled fields.

  • cc_list:Array of cc object.

  • latest_version:Integer, document latest version.

  • is_cancelled:Whether to be cancelled.

  • is_hidden:Whether to be hidden.

  • is_revoked:Whether to be revoked.

  • is_complete:Whether to be completed.

  • title:String, document title.

Signature

{
    "user_id": 2,
    "creation_time": {
          "__type__": "datetime",
          "__value__": "2017-08-14T12:23:30.013970+08:00"
    },
    "document_id": 48,
    "is_invalidated": false,
    "__id__": 50,
    "version": 1,
    "type": "NEXT"
}

Performance considerations and note that the signature does not have to expand the object just with the ID to record.

Important fields:

  • user_id:User ID.

  • creation_time:Signature creation time.

  • document_id:Document ID.

  • version:Which version with the signature.

  • type:Value is NEXT | REJ | CC.

  • is_invalidated:Boolean, whether to be rejected.

  • fulfilled_fields_ids:Array of ID, which fields is fulfilled.

  • fulfilled_nodes_ids:Array of ID, which nodes is fulfilled.

  • completed_nodes_ids:Array of ID, which nodes is completed.

CC

{
    "from_user_id": 2,
    "to_user_id": 1,
    "sender_comment_version": 2,
    "is_complete": false,
    "__id__": 1,
    "doc_id": 26,
    "parent_cc": null,
    "receiver_comment_version": -1
}

Performance considerations and note that CC does not have to expand the object just with the ID to record.

Important fields:

  • from_user_id:CC initiator ID。

  • to_user_id:The CC user ID.

  • sender_comment_version:CC sender comment version.

  • receiver_comment_version:CC receiver comment version, and -1 do not reply.

Comment: Comment object havs no ID and it is derived by the document data.

{
    "reject_to_user_id": null,
    "comment": "Hello",
    "user_id": 2,
    "user": "yllan",
    "is_cc_reply": false,
    "sender_cc_id": 1,
    "receiver_cc_id": null,
    "reject_to_version": null,
    "is_rejection": false,
    "datetime": {
      "__type__": "datetime",
      "__value__": "2017-08-09T12:30:47.403961+08:00"
    }
}

Important fields:

  • comment:String, comment content.

  • datetime:Creation time.

  • is_rejection:Boolean, comment whether to be rejected.

  • reject_to_user_id:If is_rejection is true, this field is returned to the user id, otherwise will be null.

  • reject_to_version:If is_rejection is true, this field is returned to the version, otherwise will be null.

  • is_cc_reply:Boolean, whether to reply CC.

  • sender_cc_id:CC Object ID, sender CC ID.

  • receiver_cc_id:CC Object ID, receiver CC ID.

Create

/api/v0.1/document/create/

Required:

workflow:Workflow.

creator:Workflow initiator, User object.

document:Document content, including

  • title:Document title.

delegated_user:Optional, creator=A and delegated_user=B represent that B agent A and establish a document by A.

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/document/create/ \
  -H 'content-type: application/json' \
  -d '{
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3",
  "workflow": {"__id__": 2 },
  "creator": {"__id__": 2},
  "document": {"title": "GREAT DOC"}
}'

Response: Reference Document Get format.

List

/api/v0.1/document/list/

current_user:User.

The following conditions must be at least one. Each condition is union(OR).

current_document:Boolean, TODO documents.

signed_document:Boolean, current_user signed document.

archived_document:Boolean, archived document.

created_document:Boolean, current_user created document.

all_document:Boolean, all document can read.

The following conditions is optional. Each condition is intersection(AND).

creator:User object, the creator of the document.

created_after:The creation time is later than (included) the current document.

created_before:The creation time is earlier than (included) the current document.

The time format is as follows:

{
  "__value__":"2017-08-01T12:20:57.560650+08:00",
  "__type__":"datetime"
}

The result based on the status of the document is divided into four arrays:

  • processing:Processing documents.

  • completed:Completed documents.

  • revoked:Pevoked documents.

  • cancelled:Cancelled documents.

After simplifying the content:

  • creator_id:Creator ID.

  • creator_username:Creator username.

  • creator_display_name:Creator display name.

  • latest_version:Document latestversion.

  • last_time:Document last modification time.

  • creation_time:Document creation time.

  • title:Document title.

  • workflow_name:Workflow name.

  • workflow_id:Workflow ID.

  • id:Document ID.

      {
        "workflow_id": 2,
        "creation_time": {
          "__type__": "datetime",
          "__value__": "2017-08-14T12:20:57.560650+08:00"
        },
        "creator_display_name": "yllan",
        "title": "Omni!",
        "__id__": 48,
        "workflow_name": "FLOW_FROM_API",
        "creator_id": 2,
        "latest_version": 5,
        "creator_username": "yllan@HYPO",
        "last_time": {
          "__type__": "datetime",
          "__value__": "2017-08-14T15:43:59.356933+08:00"
        }
      }

Request:

curl -X "POST" \
     https://demo.omnibpm.com/api/v0.1/document/list/ \
     -H "Content-Type: application/json" \
     -d '{
  "current_document": true,
  "current_user": {"__id__": 2},
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3"
}'

Response:

{
  "RESPONSE": "OK",
  "processing": [
    { ... },
    { ... },
    { ... }
  ],
  "revoked": [],
  "cancelled": [],
  "completed": []
}

Submit

/api/v0.1/document/submit/

Required:

document: Document object, including

  • latest_version:If latest_version is not the latest version, representing that others have checked, but the information on hand is outdated so that we need to grab the new document information. Now it will return {"RMSG": "Outdated Document Version:Outdated document.", "RESPONSE": "Outdated Document Version"}, please document/get grab the new information and then send again.

  • field_content:The form contents is a dictionary, key is field_id, and value follows field that data_type have a different type:

    • INT123

    • UTF8"Free text"

    • DECIMAL{"type": "decimal", "value": 3.14}

    • DATE{"type": "datetime", "value": "2017-12-13T00:00:0.000+08:00"}

    • BOOLtrue / false

user:The identity of checking the document must be the responsible person of the ongoing workflow of any one of the nodes. Otherwise an error will occur.

comment:The comment of the signed document.

Optional: delegated_user:Optional, user=A and delegated_user=B represent that B agent A and return a document by A.

Return:

  • version:The version after checking.

  • document:Only id.

  • is_completed:Document whether to be completed.

Request:

curl -X "POST" "https://demo.omnibpm.com/api/v0.1/document/submit/" \
     -H "Content-Type: application/json" \
     -d '{
  "document": {
    "field_content": {
      "1": "Bill",
      "2": "0987654321",
      "3": "Very Good",
      "4": "I love you"
    },
    "latest_version": 1,
    "__id__": 48
  },
  "comment": "First step",
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3",
  "user": {"__id__": 2}
}'

Response:

{
  "version": 2,
  "document": {
    "__id__": 48
  },
  "is_complete": false,
  "RESPONSE": "OK"
}

Reject

/api/v0.1/document/reject/

Required:

document:Current document.

user:Returned users.

signature:Signature object, to return the signature.

comment:Return the comment of document.

Optional: delegated_user:Optional, creator=A and delegated_user=B represent that B agent A and return a document by A.

Request:

curl -X "POST" "https://demo.omnibpm.com/api/v0.1/document/reject/" \
     -H "Content-Type: application/json" \
     -d '{
  "document": {
    "latest_version": 3,
    "__id__": 48
  },
  "signature": {
    "__id__": "52"
  },
  "comment": "I don't allow this to happen!",
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3",
  "user": {
    "__id__": 2
  }
}'

Response:

{
  "RESPONSE": "OK"
}

Revoke

/api/v0.1/document/revoke/

The completed document can be revoked. If the status is not completed, an error will occur.

Parameter:

document:Document object.

user:User object.

delegated_user:Optional, creator=A and delegated_user=B represent that B agent A and revoke a document by A.

Request:

## document/revoke/
curl -X "POST" "https://demo.omnibpm.com/api/v0.1/document/revoke/" \
     -H 'Content-Type: application/json' \
     -d $'{
  "document": {
    "__id__": 13
  },
  "user": {
    "__id__": 2
  },
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3"
}'

Response:

{
  "RESPONSE": "OK"
}

Cancel

/api/v0.1/document/cancel/

Before the document is not completed, the initiator can cancel the document.

Parameter:

document:Document object.

user:User object.

delegated_user:Optional, creator=A and delegated_user=B represent that B agent A and cancel a document by A.

Request:

## document/cancel/
curl -X "POST" "https://demo.omnibpm.com/api/v0.1/document/cancel/" \
     -H 'Content-Type: application/json' \
     -d $'{
  "document": {
    "__id__": 47
  },
  "user": {
    "__id__": 2
  },
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3"
}'

Response:

{
  "RESPONSE": "OK"
}

Get

/api/v0.1/document/get/

Required:

document:Document object

user:User object, API will mark the user as reading this document.

version:Version, do not upload the default is 0.(latest version)

Request:

curl -X POST \
  https://demo.omnibpm.com/api/v0.1/document/get/ \
  -H 'content-type: application/json' \
  -d '{
  "apikey": "test_key",
  "user": {"__id__": 16},
  "document": {"__id__": 26}
}'

Return:

In the document object, the following field:

unused_fields:Array of Workflow field object

hidden_fields:Array of Workflow field object

required_fields:Array of Workflow field object

document_fields:Array of Workflow field object

field_content:Map from field id to content

cc_list:Array of CC object

logs:Array of log object

signatures:Array of Signature object

comments:Array of Comment object

current_nodes:Array of Workflow node object

completed_nodes:Array of Workflow node object

required_job_assignments:Array of Workflow node object

nodes:Array of Workflow node object

current_users:Array of User object

signed_users:Array of User object

For UI to determine the display button:

is_rejectable:Boolean, whether to display reject button.

is_submittable:Boolean, whether to display summit button.

is_cancellable:Boolean, whether to display cancel button.

allow_cc_for_user:Boolean, whether to display CC button.

is_cc_responsible:Boolean, whether to display reply button.

is_cc_reply_readable:Boolean, whether to display read button.

Response:

{
  "RESPONSE": "OK",
  "document": {
    "cc_list": [],
    "nodes": [
      { ... },
      { ... },
      { ... }
    ],
    "is_hidden": false,
    "filled_fields_ids": [105, 106],
    "is_revivable": false,
    "organization_id": 1,
    "is_poked": false,
    "last_time": {
      "__type__": "datetime",
      "__value__": "2017-12-10T21:43:20.838290+08:00"
    },
    "current_users_ids": [15, 1, 20, 7, 8, 11, 12],
    "is_cc_reply_readable": false,
    "is_cc_responsible": false,
    "completed_nodes": [
      { ... }
    ],
    "upcomming_tasks": [
      { ... },
      { ... }
    ],
    "is_read": true,
    "hidden_fields": [],
    "is_classified": false,
    "web_layout": "{\"order\":[\"field_105\",\"field_106\",\"field_107\"],\"description\":\"\",\"field_105\":{\"id\":105,\"type\":\"UTF8\",\"text\":\"F1\",\"col\":1,\"row\":1,\"proportion\":0},\"field_106\":{\"id\":106,\"type\":\"UTF8\",\"text\":\"F2\",\"col\":1,\"row\":1,\"proportion\":0},\"field_107\":{\"id\":107,\"type\":\"UTF8\",\"text\":\"F3\",\"col\":1,\"row\":1,\"proportion\":0}}",
    "is_ccable": false,
    "field_content": {
      "106": "yyy",
      "105": "xxx",
      "TITLE": "fff"
    },
    "visible_department_heads_ids": [1, 5],
    "deadline": null,
    "is_rejectable": true,
    "is_cancelled": false,
    "version": 0,
    "completion_time": null,
    "current_nodes": [
      { ... }
    ],
    "formula_recalc_fields": [],
    "priority_name": "Normal",
    "creator_username": "yllan@HYPO",
    "fill_by_current_user": false,
    "current_nodes_ids": [208],
    "title_formula": null,
    "visible_users_ids": [2],
    "allow_cc_for_user": true,
    "creation_time": {
      "__type__": "datetime",
      "__value__": "2017-12-10T21:41:45.377481+08:00"
    },
    "is_revoked": false,
    "comments": [],
    "is_revokable": false,
    "signed_users_ids": [2],
    "creator_id": 2,
    "title": "fff",
    "completed_nodes_ids": [205],
    "signatures": [
      { ... }
    ],
    "disable_file_upload": false,
    "is_completed": false,
    "__id__": 72,
    "organization_name": "Hypo",
    "unused_fields": [],
    "attachedfiles": [],
    "creator": { ... },
    "is_visible": true,
    "current_responsible_users": [
      { ... },
      { ... },
      { ... },
      { ... }
    ],
    "serial": "Process-20171210-00001",
    "required_fields": [
      { ... },
      { ... }
    ],
    "__model__": "Document",
    "document_fields": [
      { ... },
      { ... },
      { ... }
    ],
    "current_users": [
      { ... },
      { ... },
      { ... },
      { ... },
      { ... }
    ],
    "is_creator": true,
    "signed_users": [
      { ... }
    ],
    "required_job_assignments": [],
    "is_submittable": false,
    "latest_version": 1,
    "related_documents_ids": [],
    "is_cancellable": true,
    "all_signatures": [
      { ... }
    ],
    "responsible_nodes": [
      { ... }
    ],
    "creator_name": "yllan",
    "workflow": { ... },
    "is_created": true,
  }
}

CC

/api/v0.1/document/cc/

Export document.

Parameter:

document:Document object, the processing document.

from_user:User object, from user.

to_user:User object, to user.

reply_required:Boolean, whether required to reply.

comment:String, export the message.

node:Node object, the node from which to launch the export.

Request:

## document/cc/
curl -X "POST" "https://demo.omnibpm.com/api/v0.1/document/cc/" \
     -H "Content-Type: application/json" \
     -d '{
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3",
  "document": {
    "__id__": 26
  },
  "from_user": {
    "__id__": 2
  },
  "reply_required": false,
  "to_user": {
    "__id__": "1"
  },
  "comment": "Hello",
  "node": {
    "__id__": 46
  }
}'

Response:

{
  "RESPONSE": "OK",
  "document": {
    "last_time": {
      "__type__": "datetime",
      "__value__": "2017-08-14T11:28:17.443226+08:00"
    },
    "is_revoked": false,
    "latest_version": 4,
    "creation_time": {
      "__type__": "datetime",
      "__value__": "2017-08-09T12:09:11.923197+08:00"
    },
    "comments": [
      {
        "reject_to_user_id": null,
        "comment": "Hello",
        "login_user": { ... },
        "user_id": 2,
        "user": "yllan",
        "is_cc_reply": false,
        "sender_cc_id": 1,
        "receiver_cc_id": null,
        "reject_to_version": null,
        "is_rejection": false,
        "datetime": {
          "__type__": "datetime",
          "__value__": "2017-08-09T12:30:47.403961+08:00"
        }
      },
      {
        "reject_to_user_id": null,
        "comment": "Hello",
        "login_user": { ... },
        "user_id": 2,
        "user": "yllan",
        "is_cc_reply": false,
        "sender_cc_id": 2,
        "receiver_cc_id": null,
        "reject_to_version": null,
        "is_rejection": false,
        "datetime": {
          "__type__": "datetime",
          "__value__": "2017-08-09T12:33:14.411610+08:00"
        }
      },
      {
        "reject_to_user_id": null,
        "comment": "Hello",
        "login_user": { ... },
        "user_id": 2,
        "user": "yllan",
        "is_cc_reply": false,
        "sender_cc_id": 3,
        "receiver_cc_id": null,
        "reject_to_version": null,
        "is_rejection": false,
        "datetime": {
          "__type__": "datetime",
          "__value__": "2017-08-14T11:28:17.131581+08:00"
        }
      }
    ],
    "signed_users": [],
    "visible_users_ids": [ 1, 2 ],
    "visible_users": [
      { ... },
      { ... }
    ],
    "is_completed": false,
    "current_users_ids": [ 8 ],
    "organization_id": 1,
    "related_documents_ids": [],
    "creator_id": 2,
    "current_nodes_ids": [
      41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52
    ],
    "is_created": true,
    "completion_time": null,
    "completed_nodes": [],
    "visible_department_heads_ids": [
      1,
      5
    ],
    "current_nodes": [
      { ... },
      { ... },
      { ... },
      { ... },
      { ... },
      { ... },
      { ... },
      { ... },
      { ... },
      { ... },
      { ... },
      { ... }
    ],
    "organization_name": "Hypo",
    "creator": { ... },
    "current_users": [
      { ... }
    ],
    "priority_id": 1,
    "__model__": "Document",
    "organization": { ... },
    "subscribed_users": [],
    "completed_nodes_ids": [],
    "is_cancelled": false,
    "creator_username": "yllan@HYPO",
    "signatures": [],
    "visible_department_heads": [
      { ... },
      { ... }
    ],
    "title": "HAHAHA",
    "subscribed_users_ids": [],
    "is_hidden": false,
    "creator_name": "yllan",
    "workflow": { ... },
    "__id__": 26,
    "is_classified": false,
    "serial": null,
    "filled_fields": [],
    "cc_list": [
      {
        "__model__": "CC",
        "sender_comment_version": 2,
        "is_complete": false,
        "from_user_username": "yllan@HYPO",
        "__id__": 1,
        "doc_id": 26,
        "to_user_id": 1,
        "to_user_username": "admin@HYPO",
        "to_user_name": "admin",
        "parent_cc": null,
        "organization_id": 1,
        "organization_name": "Hypo",
        "from_user_name": "yllan",
        "from_user_id": 2,
        "receiver_comment_version": -1
      },
      {
        "__model__": "CC",
        "sender_comment_version": 3,
        "is_complete": false,
        "from_user_username": "yllan@HYPO",
        "__id__": 2,
        "doc_id": 26,
        "to_user_id": 1,
        "to_user_username": "admin@HYPO",
        "to_user_name": "admin",
        "parent_cc": null,
        "organization_id": 1,
        "organization_name": "Hypo",
        "from_user_name": "yllan",
        "from_user_id": 2,
        "receiver_comment_version": -1
      },
      {
        "__model__": "CC",
        "sender_comment_version": 4,
        "is_complete": false,
        "from_user_username": "yllan@HYPO",
        "__id__": 3,
        "doc_id": 26,
        "to_user_id": 1,
        "to_user_username": "admin@HYPO",
        "to_user_name": "admin",
        "parent_cc": null,
        "organization_id": 1,
        "organization_name": "Hypo",
        "from_user_name": "yllan",
        "from_user_id": 2,
        "receiver_comment_version": -1
      }
    ],
    "current_responsible_users": [
      { ... },
      { ... }
    ],
    "related_documents": [],
    "signed_users_ids": [],
    "filled_fields_ids": [],
    "deadline": null
  }
}

CC List Target

/api/v0.1/document/cc/list_target/

According to the incoming document and the user, you need to list the nodes that the users can export the list (if the user exists on multiple nodes simultaneously, return the list). Return users and go export ``array of user object''.

document:Document object。

user:User object。

Request:

curl -X "POST" "https://demo.omnibpm.com/api/v0.1/document/cc/list_target/" \
     -H "Content-Type: application/json" \
     -d '{
  "document": {
    "__id__": 26
  },
  "user": {
    "__id__": 4
  },
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3"
}'

Response:

{
  "users": [
    {
      "rank": { ... },
      "organization": { ... },
      "department": { ... },
      "display_name": "admin",
      "email": "",
      "username": "admin@HYPO",
      "is_active": true,
      "department_name": "MIS Department",
      "rank_name": "Manager",
      "is_external": false,
      "__id__": 1
    },
    {
      "rank": { ... },
      "organization": { ... },
      "department": { ... },
      "display_name": "yllan",
      "email": "yllan@hypo.cc",
      "username": "yllan@HYPO",
      "is_active": true,
      "department_name": "Sales Department",
      "rank_name": "Director",
      "is_external": false,
      "__id__": 2
    }
  ],
  "RESPONSE": "OK"
}

CC Reply

/api/v0.1/document/cc/reply/

Reply CC.

Required parameter:

document:Document object.

user:User object.

cc:CC object.

comment:String.

Request:

## document/cc/reply/
curl -X "POST" "https://demo.omnibpm.com/api/v0.1/document/cc/reply/" \
     -H 'Content-Type: application/json' \
     -d $'{
  "document": {
    "__id__": 26
  },
  "cc": {
    "__id__": 8
  },
  "comment": "World.",
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3",
  "user": {
    "__id__": "1"
  }
}'

Response:

{
  "RESPONSE": "OK",
  "cc": {
    "doc": { ... },
    "__id__": 8,
    "parent_cc": null,
    "sender_comment_version": 7,
    "from_user": { ... },
    "organization_id": 1,
    "to_user": { ... },
    "doc_id": 26,
    "organization": { ... },
    "receiver_comment_version": 8,
    "is_complete": true,
    "__model__": "CC"
  }
}

Assign Agent

/api/v0.1/document/assign_agent/

When you meet ``To be specified'' node, you need to assign the responsible person of the nodes for this API. The node can assign the number of users.

Required:

document:Document.

user:The identity of the user.

node:The node of ``To be specified''.

agents:List of users, the responsible person of the node.

Request:

curl -X "POST" "https://demo.omnibpm.com/api/v0.1/document/assign_agent/" \
     -H "Content-Type: application/json" \
     -d '{
  "document": {"__id__": 45},
  "node": {"__id__": 34},
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3",
  "agents": [
    {"__id__": 1}
  ],
  "user": {"__id__": 2}
}'

Response:

{
  "RESPONSE": "OK"
}

Log

/api/v0.1/document/log

Display the editing document records.

Document log format is as follows:

{
    "user": {...},
    "delegated_user": {...},
    "creation_time":{
      "__value__":"2017-12-18T15:18:41.290731+08:00",
      "__type__":"datetime"
    },
    "action":"create",
    "type":"new_document"
}

Creator=A and delegated_user=B represent that actually B agent A and act by A. If no agent that user == delegated_user.

Which action / type determines the type of log. Restful API can generate types are as follows:

  • action = create, type = new_document: Establish document. Additional fields: document{"id": doc_id}.

  • action = sign, type = sign: Sign. Additional fields: signature:Signature object. comment:string.

  • action= reject, type = reject: Return. Additional fields: reject:Signature object. comment:string.

  • action = change, type = designate: Assign the responsible person. Additional fields: node:Workflow Node Object, the assigned node. users:Array of User Object, the specified user.

  • action = cc, type = to_user Start the CC. Additional fields: cc:CC Object. comment:string.

  • action = cc_reply, type = cc_read Read / Reply CC. Additional fields: cc:CC Object. comment:string.

(The web interface may generate more type, such as uploading the file, tagging, priority and so on.)

Request:

## document/log/
curl -X "POST" "https://demo.omnibpm.com/api/v0.1/document/log/" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "document": {
    "__id__": 86
  },
  "apikey": "761533a4119c437cf5531d9de6a1f7c6008512871a0c4339eda7caa246ab28a3"
}'

Response:

{
  "RESPONSE": "OK",
  "logs": [
    {
      "creation_time": {
        "__value__": "2017-12-18T15:18:41.290731+08:00",
        "__type__": "datetime"
      },
      "action": "create",
      "user": {
        "__model__": "UserProfile",
        "__id__": 2
      },
      "document": {
        "__id__": 86
      },
      "type": "new_document"
    },
    {
      "action": "sign",
      "user": {
        "__model__": "UserProfile",
        "__id__": 2
      },
      "comment": "yllan's sign",
      "signature": {
        "login_user_name": "yllan",
        "__model__": "Signature",
        "creation_time": {
          "__value__": "2017-12-18T15:28:31.580108+08:00",
          "__type__": "datetime"
        },
        "login_user_username": "yllan@HYPO",
        "completed_nodes_ids": [
          210
        ],
        "autocompleted_for_others_nodes_ids": [],
        "document_id": 86,
        "organization_id": 1,
        "rejection_target": null,
        "version": 2,
        "is_invalidated": true,
        "login_user_id": 2,
        "__id__": 131,
        "user_name": "yllan",
        "user_username": "yllan@HYPO",
        "user_id": 2,
        "fulfilled_nodes_ids": [
          210,
          211
        ],
        "signed_as_id": 1,
        "type": "NEXT",
        "organization_name": "Hypo",
        "autocompleted_nodes_ids": [],
        "fulfilled_fields_ids": [
          108,
          109,
          110,
          111,
          112,
          113
        ],
        "processing_time": 0
      },
      "type": "sign",
      "creation_time": {
        "__value__": "2017-12-18T15:28:31.583767+08:00",
        "__type__": "datetime"
      }
    },
    {
      "action": "reject",
      "user": {
        "__model__": "UserProfile",
        "__id__": 2
      },
      "comment": "I don't agree this!",
      "type": "reject",
      "reject": {
        "login_user_name": "yllan",
        "__model__": "Signature",
        "creation_time": {
          "__value__": "2017-12-18T15:31:00.528649+08:00",
          "__type__": "datetime"
        },
        "login_user_username": "yllan@HYPO",
        "completed_nodes_ids": [],
        "autocompleted_for_others_nodes_ids": [],
        "document_id": 86,
        "organization_id": 1,
        "version": 3,
        "is_invalidated": false,
        "rejection_target_id": 131,
        "login_user_id": 2,
        "__id__": 132,
        "user_name": "yllan",
        "user_username": "yllan@HYPO",
        "user_id": 2,
        "fulfilled_nodes_ids": [],
        "signed_as_id": 1,
        "type": "REJ",
        "organization_name": "Hypo",
        "autocompleted_nodes_ids": [],
        "fulfilled_fields_ids": [],
        "processing_time": 0
      },
      "creation_time": {
        "__value__": "2017-12-18T15:31:00.529615+08:00",
        "__type__": "datetime"
      }
    },
    {
      "action": "change",
      "user": {
        "__model__": "UserProfile",
        "__id__": 2
      },
      "node": { ... },
      "type": "designate",
      "users": [
        {
          "__model__": "UserProfile",
          "__id__": 1
        },
        {
          "__model__": "UserProfile",
          "__id__": 9
        }
      ],
      "creation_time": {
        "__value__": "2017-12-18T15:54:30.795323+08:00",
        "__type__": "datetime"
      }
    }
  ]
}
Contact us
Check our apps
More to known
Ⓒ 2018 Omniscient Cloud Technology Inc.
About Us
Press