The following are the REST endpoints available for the Administration section of the ProcessMaker REST API 1.0:
All these endpoints and their methods are explained below.
GET /usersGET /user/{usr_uid}POST /userPOST /user/{usr_uid}/image-uploadPUT /user/{usr_uid}DELETE /user/{usr_uid}GET /groupsGET /group/{grp_uid}POST /groupPUT /group/{usr_uid}DELETE /group/{grp_uid}GET /group/{grp_uid}/usersGET /group/{grp_uid}/available-usersPOST /group/{grp_uid}/userDELETE /group/{grp_uid}/user/{usr_uid}GET /departmentsGET /department/{dep_uid}POST /departmentPUT /department/{dep_uid}DELETE /department/{dep_uid}GET /department/{dep_uid}/assigned-userGET /department/{dep_uid}/available-userPUT /department/{dep_uid}/assign-user/{usr_uid}POST /department/{dep_uid}/assign-userPUT /department/{dep_uid}/unassign-user/{usr_uid}PUT /department/{dep_uid}/set-manager/{usr_uid}GET /rolesGET /role/{rol_uid}POST /rolePUT /role/{rol_uid}DELETE /role/{rol_uid}GET /role/{rol_uid}/usersGET /role/{rol_uid}/available-usersPOST /role/{rol_uid}/userDELETE /role/{rol_uid}/user/{usr_uid}GET /role/{rol_uid}/permissionsGET /role/{rol_uid}/available-permissionsPOST /role/{rol_uid}/permissionDELETE /role/{rol_uid}/permission/{per_uid}GET /pmtableGET /pmtable/{pmt_uid}GET /pmtable/{pmt_uid}/dataPOST /pmtablePOST /pmtable/{pmt_uid}/dataPUT /pmtable/{pmt_uid}PUT /pmtable/{pmt_uid}/dataDELETE /pmtable/{pmt_uid}DELETE /pmtable/{pmt_uid}/data/...GET /project/categoriesGET /project/category/{cat_uid}POST /project/categoryPUT /project/category/{cat_uid}DELETE /project/category/{cat_uid}The following REST endpoints are used to manage users in ProcessMaker.
2. Get information of a specific user
3. Create user
5. Update the information of a user
6. Delete user
Available methods:
GET /usersReturns a list of all users in the workspace, including users with "INACTIVE" and "VACATION" status. The users are returned in the order which they appear in the wf_<WORKSPACE>.USERS table.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
Optional GET Parameters:
| Name | Type | Description |
|---|---|---|
| filter | string | Case insensitive string to search for in the user's first name, last name or username. For example, "api/1.0/workspace/users?filter=mit" would return the users "smith", "Mitter" and "solmit". |
| start | integer | The number of users where the list begins. The counting starts from number 0, which is always the "admin" user. For example, "api/1.0/workspace/users?start=3" would start the list of users with the fourth user. |
| limit | integer | The maximum number of users which are returned in the list. For example if wanting to return 10 users at a time and there are 25 users in total, then call this endpoint 3 times: "api/1.0/workspace/users?limit=10" (returns users 0-9)"api/1.0/workspace/users?start=10&limit=10" (returns users 10-19)"api/1.0/workspace/users?start=20&limit=10" (returns users 20-24) |
Result:
If a successful request, the HTTP status code is 200 and it returns a JSON array of user objects with the following structure:
| Element | Description | Example |
|---|---|---|
| [ | Start array | |
| { | Start user object | |
| "usr_uid" | User's unique ID. | "11826545154db794ca22b52025081429" |
| "usr_username" | The username, which is unique and is used to login to ProcessMaker | "jdoe" |
| "usr_password" | The MD5 hash for the user's password. | "21232f297a57a5a743894a0e4a801fc3" |
| "usr_firstname" | The user's first name. | "John Jake" |
| "usr_lastname" | The user's last name. | "Doe" |
| "usr_email" | The user's email address. | "jdoe@example.com" |
| "usr_due_date" | The date in "YYYY-MM-DD" when the user's account will expire. After this date, the user will not be able to login to ProcessMaker. | "2020-01-01" |
| "usr_create_date" | The datatime in "YYYY-MM-DD HH:MM:SS" format when the user was created. | "2005-11-30 08:11:57" |
| "usr_update_date" | The datetime in "YYYY-MM-DD HH:MM:SS" format when the user's record was last updated. | "2014-05-23 18:36:19" |
| "usr_status" | The user's status, which can be "ACTIVE", "INACTIVE" or "VACATION" | "ACTIVE" |
| "usr_country" | Two letter ISO country code. See the wf_<WORKSPACE>.ISO_COUNTRY table in the database. | "US" (United States) |
| "usr_city" | One or two letter code to identify the region, state or province. Note: This field is misnamed. See the wf_<WORKSPACE>.ISO_SUBDIVISION table in the database. | "FL" (Florida in the US) |
| "usr_location" | Code which is 1 to 3 letters to identify the city or locality. See the wf_<WORKSPACE>.ISO_LOCATION table in the database. | "MMK" (Miami Lakes in Florida) |
| "usr_address" | The user's address. This field may contain line breaks (\n). | "540 Mytle Lane" |
| "usr_phone" | The user's phone number. | "1-305-402-1234" |
| "usr_fax" | The user's fax number. | "1-305-402-0282" |
| "usr_cellular" | The user's cellular telephone number. | "1-305-675-1400" |
| "usr_zip_code" | The user's zip or postal code | "46135" |
| "dep_uid" | The unique ID of the user's department. If the user isn't a member of a department then an empty string "". | "54883398754db7993002ae1030708956" |
| "usr_position" | The user's position. | "Accountant" |
| "usr_resume" | Always set to "" since the resume is no longer used. | "" |
| "usr_birthday" | The user's birthday in "YYYY-MM-DD" format. | "1973-02-25" |
| "usr_role" | The user's role, which can be "PROCESSMAKER_ADMIN", "PROCESSMAKER_OPERATOR", "PROCESSMAKER_MANAGER" or a custom role. | "PROCESSMAKER_ADMIN" |
| "usr_reports_to" | The unique ID of the manager to whom the user reports. This is used when using a Reports To assignment rule. If the user is not a member of a department, then an empty string "". | "14680180454ca4477335a27034362107" |
| "usr_replaced_by" | Unique ID of another user who will replace this user if status changes to "INACTIVE" or "VACATION". Set to empty string "" if there is no replacement user. | "14680180454ca4477335a27034362107" |
| "usr_ux" | The user experience, which is the type of interface seen by the user. It can be "NORMAL", "SWITCHABLE", "MOBILE" or "SINGLE". | "NORMAL" |
| }, | End user object. | |
| ... | Additional user objects. | |
| ] | End array. |
If a bad request, than the HTTP status code is set to 400 or greater and it returns a JSON error object.
Example in JavaScript:
This JavaScript example creates a array of active users. It obtains the list of all the users for the workspace and stores it in an array named aUsers. Then it loops through the array and checks whether the user's status is "ACTIVE". If so, it adds the user's UID and username to an new array named aActiveUsers.
Example in PHP:
This PHP example creates a array of active users. It obtains the list of all the users for the workspace and stores it in an array named $aUsers. Then it loops through the array and checks whether the user's status is "ACTIVE". If so, it adds the user's UID and username to an new array named $aActiveUsers.
GET /user/{usr_uid}Get information about a specified user.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| usr_uid | String | User UID |
Result:
Returns the HTTP status code 200 and the same user object as the GET /users endpoint. For example:
If a bad request, then it returns the HTTP status code 400 and an error object like the following:
Example in PHP:
POST /userCreate a new user.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
POST Parameters:
| Name | Type | Description |
|---|---|---|
| usr_username | String | Username which is used to login to ProcessMaker and is unique. |
| usr_firstname | String | User's first name |
| usr_lastname | String | User's last name |
| usr_email | String | User's email address |
| usr_due_date | String | The date in "YYYY-MM-DD" when the user's account will expire. After this date, the user will not be able to login to ProcessMaker. Ex: "2020-12-31" |
| usr_status | String | The user's status, which can be "ACTIVE", "INACTIVE" or "VACATION". |
| usr_role | String | The user's role, which can be "PROCESSMAKER_ADMIN", "PROCESSMAKER_OPERATOR", "PROCESSMAKER_MANAGER" or a custom role. |
| usr_new_pass | String | The user's password. Remember that passwords should adhere to the password security policies. |
| usr_cnf_pass | String | Enter the password a second time to confirm it. |
| usr_address | String | Optional. The user's address. Use \n to include line breaks in the address. Ex: "345 Radcliff Drive\nC/O Brad Williams" |
| usr_zip_code | String | Optional. User's zip or postal code. |
| usr_country | String | Optional. Two letter ISO country code. See the wf_<WORKSPACE>.ISO_COUNTRY table in the database. |
| usr_city | String | Optional. One or two letter code to identify the region, state or province. Note: This field is misnamed. See the wf_<WORKSPACE>.ISO_SUBDIVISION table in the database. |
| usr_location | String | Optional. Code which is 1 to 3 letters long to identify the city or locality. See the wf_<WORKSPACE>.ISO_LOCATION table in the database. |
| usr_phone | String | Optional. The user's telephone number. |
| usr_position | String | Optional. The user's position in the organization. |
| usr_replaced_by | String | Optional. Unique ID of another user who will replace this user if his/her status changes to "INACTIVE" or "VACATION". |
| usr_calendar | String | Optional. The unique ID of the calendar which is used to calculate the due dates of tasks which the user is assigned to work on. To get the UID of a calendar, see the wf_<WORKSPACE>.CALENDAR_DEFINITION.CALENDAR_UID field in the database. |
Result:
If a user was successfully created, the HTTP status code will be set to 200 and a JSON object with information about the new user is returned:
If an error occurred, the HTTP status code will be set to 400 or greater and a JSON object will be returned like the following:
PHP Example:
POST /user/{usr_uid}/image-uploadUpload an image of the specified user, which will appear in the user's profile screen.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| usr_uid | String | User UID |
POST Parameters:
| Name | Type | Description | Examples |
|---|---|---|---|
| USR_PHOTO | string | The full path on the ProcessMaker server where the image file is located. The image file must be JPEG, PNG or GIF format. Note: If using PHP, make sure to place @ in front of the path to suppress error messages. Otherwise, this endpoint will not work. | "/home/bob/images/myphoto.jpg" "C:\Users\bob\images\myphoto.gif" |
Result:
Returns an HTTP status code of 200 if the image was uploaded correctly. Otherwise, returns 0.
PHP Example:
If needing to upload image files which are not located on the ProcessMaker server, first use ssh2_scp_send() to copy the files to the ProcessMaker server, then use the code above to call the /api/1.0/{workspace}/user/{usr_uid}/image-upload endpoint.
PUT /user/{usr_uid}Update the information about a specified user.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| usr_uid | String | User UID |
PUT Parameters:
Only set the fields which need to be updated. PUT parameters need to be URL-encoded. In PHP, place the parameters in an associative array and use http_build_query() to encode it. In JavaScript, place the parameters in an object and then use encodeURIComponent() to encode it.
| Name | Type | Description |
|---|---|---|
| usr_username | String | Optional. Username which is used to login to ProcessMaker and is unique. |
| usr_firstname | String | Optional. User's first name |
| usr_lastname | String | Optional. User's last name |
| usr_email | String | Optional. User's email address |
| usr_due_date | String | Optional. The date in "YYYY-MM-DD" when the user's account will expire. After this date, the user will not be able to login to ProcessMaker. Ex: "2020-12-31" |
| usr_status | String | Optional. The user's status, which can be "ACTIVE", "INACTIVE" or "VACATION". |
| usr_role | String | Optional. The user's role, which can be "PROCESSMAKER_ADMIN", "PROCESSMAKER_OPERATOR", "PROCESSMAKER_MANAGER" or a custom role. |
| usr_address | String | Optional. The user's address. Use \n to include line breaks in the address. Ex: "345 Radcliff Drive\nC/O Brad Williams" |
| usr_zip_code | String | Optional. User's zip or postal code. |
| usr_country | String | Optional. Two letter ISO country code. See the wf_<WORKSPACE>.ISO_COUNTRY table in the database. |
| usr_city | String | Optional. One or two letter code to identify the region, state or province. Note: This field is misnamed. See the wf_<WORKSPACE>.ISO_SUBDIVISION table in the database. |
| usr_location | String | Optional. Code which is 1 to 3 letters long to identify the city or locality. See the wf_<WORKSPACE>.ISO_LOCATION table in the database. |
| usr_phone | String | Optional. The user's telephone number. |
| usr_cellular | String | Optional. The user's cellular phone number. |
| usr_fax | String | Optional. The user's fax number. |
| usr_position | String | Optional. The user's position in the organization. |
| usr_birthday | String | Optional. The user's birthday in "YYYY-MM-DD" format. Ex: "1984-08-23" |
| usr_replaced_by | String | Optional. Unique ID of another user who will replace this user if his/her status changes to "INACTIVE" or "VACATION". |
| usr_new_pass | String | Optional. The user's password. Remember that passwords should adhere to the password security policies. |
| usr_cnf_pass | String | Optional. Enter the password a second time to confirm it. If this password doesn't match the one in usr_new_pass, then an error will occur. |
Result:
If the user account was updated, the HTTP status code is set to 200 and it returns the following object with the updated information about the user:
If an error occurred, the HTTP status code is set to 400 and an error object like the following is returned:
PHP Example:
The following example, changes the status to "VACATION" and sets the user who will replace this user when she goes on vacation.
Note that the following line sets the request to be a PUT request:
Also note that the POST parameters need to be passed to http_build_query() to generate a URL-encoded query string which can be used with PUT requests.
DELETE /user/{usr_uid}Delete a specified user.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| usr_uid | String | User UID |
Result:
If the user was successfully deleted, then the HTTP response code will be 200. If an error occurs, then the HTTP response code is set to 400 and an object like the following is returned:
PHP Example:
The following REST endpoints are used to manage groups, as well as their member users in ProcessMaker.
4. Update group
Groups - Users
6. List all assigned users to a group
7. List available users to assign to a group
9. Unassign a user from a group
Available methods:
GET /groupsGet a list of all the groups in the workspace (including groups with "INACTIVE" status). The groups are returned in alphabetical order.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
Optional GET Parameters:
| Name | Type | Description |
|---|---|---|
| filter | string | Case insensitive string to search for in the group name. For example, "api/1.0/workspace/groups?filter=sal" would return the groups "Sales" and "Condiments & salts". |
| start | integer | The number of groups where the list begins. The counting starts from the number 0. For example, "api/1.0/workspace/groups?start=3" would start the list of groups with the fourth group. |
| limit | integer | The maximum number of groups which are returned in the list. For example if wanting to return 10 groups at a time and there are 25 groups in total, then call this endpoint 3 times: "api/1.0/workspace/groups?limit=10" (returns groups 0-9)"api/1.0/workspace/groups?start=10&limit=10" (returns groups 10-19)"api/1.0/workspace/groups?start=20&limit=10" (returns groups 20-24) |
Result:
Returns an HTTP status code of 200 and the following array of group objects:
| Element | Description |
|---|---|
| [ | Start array |
| { | Start group object |
| grp_uid | The group's unique ID. |
| grp_title | The group's title. |
| grp_status | The group's status, which can be "ACTIVE" or "INACTIVE". |
| grp_users | The number of users who are members of the group, including users who have "INACTIVE" and "VACATION" status. |
| grp_tasks | The number of tasks to which the group is assigned. Note that this number includes tasks which are in deactivated processes, but it does not include ad hoc assignment to tasks. |
| }, | End group object. |
| ... | Additional group objects. |
| ] | End array. |
For example:
If there is are no groups, then an empty array is returned. If an error occurs, then
PHP Example: The following example creates an array of the active groups which are assigned to one or more tasks.
GET /group/{grp_uid}Get information about a specified group.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| grp_uid | String | Group UID |
Result:
Returns the HTTP status code 200 and the same group object as the GET /groups endpoint. For example:
If a bad request, then it returns the HTTP status code 400 and an error object like this:
PHP Example:
This example prints out how many users are in a group with the ID "47113834154e4a6c5cd1f11014216675":
POST /groupCreate a new group.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
POST Fields:
| Name | Type | Description |
|---|---|---|
| grp_title | String | The name of the group. |
| grp_status | String | The group's status, which can be "ACTIVE" or "INACTIVE". If the group is assigned to a task and its status is "INACTIVE", then members of the group will NOT be assigned to the task when cases are run. |
Result:
If a new group was created, then the HTTP status code is 201 and a JSON object with information about the new group is returned. For example:
If a bad request, then the HTTP status code is 400 or greater and a JSON object like the following is returned:
PHP Example:
PUT /group/{usr_uid}Update information about a specified group.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| grp_uid | String | Group unique ID. |
Optional Fields:
| Name | Type | Description |
|---|---|---|
| grp_title | String | The group's title. |
| grp_status | String | Group status, which can be "ACTIVE" or "INACTIVE". If the group is assigned to a task and its status is "INACTIVE", then members of the group will NOT be assigned to the task when cases are run. |
Result:
If the group was successfully updated, the HTTP status code is 200 and there is nothing returned.
If it is a bad request, then the HTTP status code is set to 400 or greater, and a JSON object like the following is returned:
PHP Example:
The following example changes the group title to "Accounting" and sets its status to "INACTIVE":
Note that the following line sets the request to be a PUT request:
Also note that the POST parameters need to be passed to http_build_query() to generate a URL-encoded query string which can be used with PUT requests.
DELETE /group/{grp_uid}Delete a specified group. Note that this endpoint deletes the group's record from the GROUPWF table and its title from the CONTENT table in the database, but it doesn't delete the group's membership list from the GROUP_USER table.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| grp_uid | String | Group unique ID. |
Result:
If the group was deleted, then the HTTP status code is 200. Otherwise, the HTTP status code is 400 or greater and a JSON object is returned like the following:
PHP Example:
GROUPS - USERS
GET /group/{grp_uid}/usersList the assigned users to a specified group.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| grp_uid | String | Group UID |
Optional GET Parameters:
| Name | Type | Description |
|---|---|---|
| filter | string | Case insensitive string to search for in the user's first name, last name or username. For example, "api/1.0/workspace/group/47113834154e4a6c5cd1f11014216675/users?filter=mit" would return the users "smith", "Mitter" and "solmit". |
| start | integer | The number of users where the list begins. The counting starts from number 0. For example, "api/1.0/workspace/group/47113834154e4a6c5cd1f11014216675/users?start=3" would start the list of users with the fourth user. |
| limit | integer | The maximum number of users which are returned in the list. For example if wanting to return 10 users at a time and there are 25 users in total, then call this endpoint 3 times: "api/1.0/workspace/group/47113834154e4a6c5cd1f11014216675/users?limit=10" (returns users 0-9)"api/1.0/workspace/group/47113834154e4a6c5cd1f11014216675/users?start=10&limit=10" (returns users 10-19)"api/1.0/workspace/group/47113834154e4a6c5cd1f11014216675/users?start=20&limit=10" (returns users 20-24) |
Result:
If a successful request, the HTTP status code is set to 200 and a JSON array of user objects is returned, like the following one:
If a bad request, then the HTTP status code is 400 or greater and a JSON error object is returned, like this one:
PHP Example:
This PHP example creates a list of active users who are members of a group with the unique ID of "47113834154e4a6c5cd1f11014216675" and places them in the array $aActiveUsers.
GET /group/{grp_uid}/available-usersGet a list of available users, which can be assigned to a specified group. All users which aren't yet assigned to the group will be listed, including users with "INACTIVE" and "VACATION" status.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| grp_uid | String | Group unique ID. |
Optional GET Parameters:
| Name | Type | Description |
|---|---|---|
| filter | string | Case insensitive string to search for in the user's first name, last name or username. For example, "api/1.0/workspace/group/47113834154e4a6c5cd1f11014216675/users?filter=mit" would return the users "smith", "Mitter" and "solmit". |
| start | integer | The number of users where the list begins. The counting starts from number 0. For example, "api/1.0/workspace/group/47113834154e4a6c5cd1f11014216675/users?start=3" would start the list of users with the fourth user. |
| limit | integer | The maximum number of users which are returned in the list. For example if wanting to return 10 users at a time and there are 25 users in total, then call this endpoint 3 times: "api/1.0/workspace/group/47113834154e4a6c5cd1f11014216675/users?limit=10" (returns users 0-9)"api/1.0/workspace/group/47113834154e4a6c5cd1f11014216675/users?start=10&limit=10" (returns users 10-19)"api/1.0/workspace/group/47113834154e4a6c5cd1f11014216675/users?start=20&limit=10" (returns users 20-24) |
Result:
If a successful request, the HTTP status code is set to 200 and a JSON array of user objects is returned, like the following one:
If a bad request, then the HTTP status code is 400 or greater and a JSON error object is returned, like this one:
PHP Example:
This example gets a list of the first 10 available users to be assigned to a group with the ID ""47113834154e4a6c5cd1f11014216675":
POST /group/{grp_uid}/userAssign a user to a specified group.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| grp_uid | String | The group's unique ID |
POST Fields:
| Name | Type | Description |
|---|---|---|
| usr_uid | String | The unique ID of the user who will be added to the group as a member. Note that it is possible to add a user with "INACTIVE" or "VACATION" status to a group, but that user will not be assigned to any cases until his/her status changes to "ACTIVE" status. |
Optional Fields:
These fields may be included, but they will be ignored by the REST endpoint.
| Name | Type | Description |
|---|---|---|
| usr_username | String | Username |
| usr_firstname | String | User first name |
| usr_lastname | String | User last name |
| usr_email | String | User email |
| usr_status | String | User status |
Result:
If the user was assigned to the group, then the HTTP status code is 201 (Created) and there is no return object. Otherwise, it is 400 or greater and returns a JSON error object like:
PHP Example:
DELETE /group/{grp_uid}/user/{usr_uid}Unassign (remove) a user from a group so no longer a member of the group.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| grp_uid | String | Group UID |
| usr_uid | String | Group UID |
Result:
If the user was removed from the group, then the HTTP status code is 200 and there is no return object. Otherwise, the HTTP status code is 400 or greater and a JSON error object is returned, such as:
PHP Example:
These are the REST endpoints to manage departments in ProcessMaker:
GET /departmentsGet a list of all the departments in the workspace, including departments with "INACTIVE" status.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
Result:
If successful, the HTTP status code is set to 200 and it returns a JSON array of department objects with the following structure:
| Element | Description | Example |
|---|---|---|
| [ | Start array. | |
| { | Start department object | |
| dep_uid, | The department's unique ID. | "11826545154db794ca22b52025081429" |
| dep_parent, | The unique ID of the parent department. If this is a top-level deparment, then set to "" (empty string). | "" |
| dep_title, | The department's title. | "Human Resources" |
| dep_status, | The department's status, which can be "ACTIVE" or "INACTIVE". | "ACTIVE" |
| dep_manager, | The department's supervisor, to whom the other members of the department and the supervisors of the subdepartments report. By default, the supervisor is the first user assigned to the department. | "14680180454ca4477335a27034362107" |
| dep_ldap_dn, | The user's distinguished name if imported from LDAP. If a normal user whose account wasn't imported, then then set to "" (empty string). | "" |
| dep_last, | If the last department object in the current array, then set to 1. If not the last, then set to 0. | 1 |
| dep_manager_username, | The username of the department's supervisor. | "liliana" |
| dep_manager_firstname, | The first name of the department's supervisor. | "Liliana" |
| dep_manager_lastname, | The last name of the department's supervisor. | "Ortiz" |
| has_children, | The number of subdepartments of this department. | "2" |
| dep_children | A array of subdepartment objects for this department. If there are no subdepartments, then an empty array. | [] |
| }, | End the department object | |
| {...} | Any additional department objects. | |
| ] | End array. |
For example:
PHP Example:
This example prints out the directory structure of an organization with the supervisor's name in parentheses.
For the departments shown in the example above, this script would print out:
GET /department/{dep_uid}Get information about a specified department.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| dep_uid | String | Department UID |
Result:
If successful, the HTTP status code is 200 and a department object is returned like the GET departments endpoint, but it doesn't include the dep_children array. For example:
If unsuccessful, the HTTP status code is 400 or greater and a JSON error object is returned, such as:
PHP Example:
This example prints out the department's title and its supervisor's full name:
POST /departmentCreate a new department.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
POST Fields:
| Name | Type | Description |
|---|---|---|
| dep_title | String | Department's title (name). Note that the department's title must be unique, so an error will occur if trying to create a department title which already exists. |
| dep_parent | String | Optional. Parent department's unique ID. If not included or set to "" (empty string), then this is a top-level department. |
| dep_manager | String | Optional. Department supervisor's unique ID. Users may only be assigned to ONE department, so the supervisor may NOT be a member of another department. |
| dep_status | String | Optional. Department status, which can be "ACTIVE" or "INACTIVE". If not included, then "ACTIVE" by default. |
Result:
If the new department was created, the HTTP status code is 201 (Created) and a department object is returned, like the following:
dep_last element in the returned object is always set to 0 and is not correct. To check whether the new department is the last department at the current level, call the GET /departments or GET /department/{dep_uid} endpoint and check the value of the dep_last element.If an error occurred, the HTTP status code is 400 or greater and an error object is returned, like the following:
PHP Example:
PUT /department/{dep_uid}Update the information about a department.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| dep_uid | String | Department UID. |
Optional Fields:
| Name | Type | Description |
|---|---|---|
| dep_title | String | The department title (name), which must be unique. |
| dep_parent | String | Unique ID of the parent department. Set to "" (empty string) to make a top-level department. |
| dep_manager | String | Unique ID of the department supervisor, to whom the members of the department [[1]], as well as the supervisors of subdepartments. |
| dep_status | String | Department status, which can be "ACTIVE" or "INACTIVE". |
Result:
If the department was successfully updated, then the HTTP status code is set to 200 and there is no return object. Otherwise, it is set to 400 and greater and returns an error object, such as:
PHP Example:
DELETE /department/{dep_uid}Delete a specified department. Note that it is not possible to delete a department while it has assigned users, so all the users must be unassigned from the department before deleting it.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| dep_uid | String | Unique ID of the department to be deleted. |
Result:
If the department was deleted, the HTTP status code is set to 200 and nothing is returned. Otherwise, it is set to 400 or greater and an error object is returned like the following:
PHP Example:
Departments - Users:
GET /department/{dep_uid}/assigned-userGet a list of the users assigned to a specified department.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| dep_uid | String | Unique ID of department. |
Result:
If successful, the HTTP status code is 200 and an array of user objects is returned, like the following:
PHP Example:
This example cycles through all the departments, looking for the username "janedoe" and prints out her department. First it calls the GET /departments endpoint to get a list of departments, then it calls the GET /department/{dep_uid}/assigned-user endpoint for each department and searches for the user.
GET /department/{dep_uid}/available-userGet a list of the available users, which can be assigned to a specified department. The list contains all users which aren't yet assigned to any department (including users which have "INACTIVE" and "VACATION" status).
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| dep_uid | String | Unique ID of department. |
Result:
If successful, the HTTP status code is set to 200 and it returns an array of user objects, like the following:
Note that the user objects are not arranged in any particular order.
If an error occurred, the HTTP status code is set to 400 or greater, and an error object is returned, such as:
PHP Example:
Get a list of available users and sort them in alphabetical order according to their full names and print them. All the user objects are placed in the $aUsersWithKeys array which has the full names as the keys and then they are sorted using the ksort() function.
PUT /department/{dep_uid}/assign-user/{usr_uid}Assign a user to a specified department in version 2.8. If using version 3.0 or later, see POST /department/{dep_uid}/assign-user. If the user is already a member of another department, the user will be transfered to the specified department. If reassigning a user who is a supervisor of another department, see this bug.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| dep_uid | String | Unique ID of department. |
| usr_uid | String | Unique ID of user to assign to the department. |
Result:
If the user was assigned to the department, the HTTP status code is 200 and there is no return object. Otherwise, the HTTP status code is 400 or greater and there is a return object such as:
PHP Example:
POST /department/{dep_uid}/assign-userAssign a user to a specified department in version 3.0 and later. If the user is already a member of another department, the user will be transfered to the specified department. If reassigning a user who is a supervisor of another department, see this bug.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| dep_uid | String | Unique ID of department. |
POST Fields:
| Name | Type | Description |
|---|---|---|
| usr_uid | String | Unique ID of a user to assign to the department. |
Result:
If the user was assigned to the department, the HTTP status code is 201 and there is no return object. Otherwise, the HTTP status code is 300 or greater and there is a return object such as:
PHP Example:
PUT /department/{dep_uid}/unassign-user/{usr_uid}Unassign a user from a department, so no longer a member of the department. If unassigning a supervisor from a department, see this bug.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| dep_uid | String | Unique ID of department. |
| usr_uid | String | Unique ID of the user to unassign from the department. |
Result:
If the user was unassigned from the department, the HTTP status code is 200 and there is no return object. Otherwise, the HTTP status code is 400 or greater and there is a return object such as:
PHP Example:
PUT /department/{dep_uid}/set-manager/{usr_uid}Set a user to be the manager (supervisor) for a department. The other members of the department will report to the manager, as well as the managers of subdepartments. Note that this endpoint has a number of outstanding bugs.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| dep_uid | String | Unique ID of the department. |
| usr_uid | String | Unique ID of the user to become the the manager of the department. |
Result:
If the manager was successfully set, then the HTTP status code is 200 and there is no return object. Otherwise, the HTTP status code is 400 or greater and an error object is returned, like the following:
PHP Example:
The following REST endpoints are used to manage roles in ProcessMaker.
Roles
Roles - Users
6. List assigned users to a role
7. List available users to assign to a role
Roles - Permissions
10. List assigned permissions to a role
11. List available permissions to assign to a role
12. Assign permissions to a role
13. Unassign permissions from a role
GET /rolesGet a list of the roles in the workspace.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/roles |
| Optional filters | ||
| filter={text} | Case insensitive text to search for in the role codes (but not the role names). Remember to URL encode in UTF-8, if it contains spaces, symbols or non-ASCII characters, using a function such as urlencode() in PHP or encodeURIComponent() in JavaScript. | /api/1.0/workflow/roles?filter=reviewer |
| start={number} | Integer which indicates the initial position of the role. | /api/1.0/workflow/roles?start=20&limit=10 |
| limit={number} | Integer which limits the number of roles returned | /api/1.0/workflow/roles?start=30&limit=10 |
Result:
If successful, the HTTP status is200 (OK) and an array of role objects is returned, such as:
PHP example
Print out a list of the roles with "ACTIVE" status and the number of users assigned to each role.
GET /role/{rol_uid}Get information about a specified role.
URL Parameters:
| Name | Type | Description |
|---|---|---|
| workspace | String | Workspace name |
| rol_uid | String | Role UID |
Result:
If successful, the HTTP status is set to 200 and an object with information about the role is returned, such as
POST /roleCreate a new role.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/role |
POST fields:
| Name | Description |
|---|---|
| rol_code | The role code, which is an identifier consisting of letters, numbers and underscores ("_"). It may not contain any spaces or special characters. |
| rol_name | The role name, which is any identifier which can contain any type of characters and is displayed in the ProcessMaker. |
| rol_status | Optional. Role status, which may be "ACTIVE" or "INACTIVE". If not specified, then set to "ACTIVE" by default. If set to "INACTIVE", any users assigned to the role will not be able to login to ProcessMaker, nor may any cases be assigned to those users. |
Result:
If the role was created, then the HTTP status code is set to 201 (Created) and an object containing information about the new role is returned, such as:
PUT /role/{rol_uid}Update information about a specified role.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/role/14539701455e9bf5e9dfc40009566988 |
| rol_uid | Unique ID of role | /api/1.0/workflow/role/14539701455e9bf5e9dfc40009566988 |
POST fields:
| Name | Description |
|---|---|
| rol_code | Optional. The role code, which is an identifier consisting of letters, numbers and underscores ("_"). It may not contain any spaces or special characters. |
| rol_name | Optional. The role name, which is any identifier which can contain any type of characters and is displayed in the ProcessMaker. |
| rol_status | Optional. Role status, which may be "ACTIVE" or "INACTIVE". If set to "INACTIVE", any users assigned to the role will not be able to login to ProcessMaker, nor may any cases be assigned to those users. |
Result:
If the information about a case has been updated, then the HTTP status is set to 200 (OK) and there is no return object.
PHP example:
DELETE /role/{rol_uid}Delete a specified role. Note that it is not possible to delete a role which still has assigned users, so all users must be assigned to different roles before deleting the role.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/role/14539701455e9bf5e9dfc40009566988 |
| rol_uid | Unique ID of role | /api/1.0/workflow/role/14539701455e9bf5e9dfc40009566988 |
Result:
If the role is deleted, the HTTP status code is set to 200 and there is no return object. If the HTTP status code is 300 or greater than an error occurred and a error object will usually be returned, such as:PHP example:
ROLES - USERS
GET /role/{rol_uid}/usersGet a list of the users assigned to a role.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/role/00000000000000000000000000000003/users |
| rol_uid | Unique ID of role | /api/1.0/workflow/role/00000000000000000000000000000003/users |
| Optional filters: | ||
| filter={text} | Case insensitive text to search for users in their first name, last name or username. Remember to URL encode in UTF-8, if it contains spaces, symbols or non-ASCII characters, using a function such as urlencode() in PHP or encodeURIComponent() in JavaScript. | /api/1.0/workflow/role/00000000000000000000000000000003/users?filter=mary |
| start={number} | Integer which indicates the initial position of the user in the list. | /api/1.0/workflow/role/00000000000000000000000000000003/users?start=20&limit=10 |
| limit={number} | Integer which limits the number of users returned. | /api/1.0/workflow/role/00000000000000000000000000000003/users?start=30&limit=10 |
Result:
If successful, the HTTP status code is set to 200 (OK) and an array of user objects is returned, such as:
If no users are assigned to the role, then an empty array will be returned.
GET /role/{rol_uid}/available-usersGet a list of users who currently are assigned to other roles and are available to be reassigned to the specified role.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/role/00000000000000000000000000000003/available-users |
| rol_uid | Unique ID of role | /api/1.0/workflow/role/00000000000000000000000000000003/available-users |
| Optional filters: | ||
| filter={text} | Case insensitive text to search for in the first name, last name or username of users. Remember to URL encode in UTF-8, if it contains spaces, symbols or non-ASCII characters, using a function such as urlencode() in PHP or encodeURIComponent() in JavaScript. | /api/1.0/workflow/role/00000000000000000000000000000003/available-users?filter=mary |
| start={number} | Integer which indicates the initial position of the user in the list. | /api/1.0/workflow/role/00000000000000000000000000000003/available-users?start=20&limit=10 |
| limit={number} | Integer which limits the number of users returned. | /api/1.0/workflow/role/00000000000000000000000000000003/available-users?start=30&limit=10 |
Result:
If successful, the HTTP status code is set to 200 (OK) and an array of user objects is returned, such as:
If no users are assigned to other roles, then an empty array will be returned.
POST /role/{rol_uid}/userAssign a user to a role.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/role/00000000000000000000000000000003/user |
| rol_uid | Unique ID of role. The 3 predefined roles in ProcessMaker are Administrator '00000000000000000000000000000002', Operator '00000000000000000000000000000003', and Manager '00000000000000000000000000000004'. | /api/1.0/workflow/role/00000000000000000000000000000003/user |
POST Fields:
| Name | Type | Description |
|---|---|---|
| usr_uid | String | Unique ID of user to be assigned to a role. |
Result:
If the user has been successfully assigned to a role, then the HTTP status is set to 201 (Created) and there is no return object.
Note that the "admin" user may not be reassigned to a different role, which generates the following error:
PHP example
DELETE /role/{rol_uid}/user/{usr_uid}Unassign (remove) a user from a role. It is not recommended to call this endpoint, unless wishing for the user to have no role and be unable to login or be used in any capacity in ProcessMaker. The user will need to be reassigned to another role in order to have any function inside ProcessMaker.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/role/00000000000000000000000000000003/user/55625662755e0e42fe83f41018778834 |
| rol_uid | Unique ID of role. The 3 predefined roles in ProcessMaker are Administrator '00000000000000000000000000000002', Operator '00000000000000000000000000000003', and Manager '00000000000000000000000000000004'. | /api/1.0/workflow/role/00000000000000000000000000000003/user/55625662755e0e42fe83f41018778834 |
| usr_uid | Unique ID of user | /api/1.0/workflow/role/00000000000000000000000000000003/user/55625662755e0e42fe83f41018778834 |
Result:
If unassigned from the role, the HTTP status code is set to 200 (OK) and there is no return object. Otherwise, the HTTP status code is set to 300 or greater and an error object is often returned, such as:PHP Example
ROLES - PERMISSIONS
GET /role/{rol_uid}/permissionsGet a list of the permissions assigned to a specified role.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/role/00000000000000000000000000000002/permissions |
| rol_uid | Unique ID of the Role. The 3 predefined roles in ProcessMaker are Administrator '00000000000000000000000000000002', Operator '00000000000000000000000000000003', and Manager '00000000000000000000000000000004'. | /api/1.0/workflow/role/00000000000000000000000000000002/permissions |
| Optional filters: | ||
| filter={text} | Case-insensitive text to search for in the permission codes. | /api/1.0/workflow/role/00000000000000000000000000000002/permissions?filter=setup |
| start={number} | Position of the initial permission be returned | /api/1.0/workflow/role/00000000000000000000000000000002/permissions?start=5&limit=5 |
| limit={number} | Number of permissions to be returned. | /api/1.0/workflow/role/00000000000000000000000000000002/permissions?start=5&limit=5 |
Result:
If successful the HTTP status code is 200 and the response is an array of permission objects for the role, such as:PHP example:
Print out the list of permissions in the PROCESSMAKER_ADMIN role:
GET /role/{rol_uid}/available-permissionsGet a list of the available permissions, which can be assigned to a specified role.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/role/00000000000000000000000000000003/available-permissions |
| rol_uid | Unique ID of the Role. The 3 predefined roles in ProcessMaker are Administrator '00000000000000000000000000000002', Operator '00000000000000000000000000000003', and Manager '00000000000000000000000000000004'. | /api/1.0/workflow/role/00000000000000000000000000000003/available-permissions |
| Optional filters: | ||
| filter={text} | Case-insensitive text to search for in the permission codes. | /api/1.0/workflow/role/00000000000000000000000000000003/available-permissions?filter=setup |
| start={number} | Position of the initial permission be returned | /api/1.0/workflow/role/00000000000000000000000000000003/available-permissions?start=5&limit=5 |
| limit={number} | Number of permissions to be returned. | /api/1.0/workflow/role/00000000000000000000000000000003/available-permissions?start=5&limit=5 |
Result:
If successful the HTTP status code is 200 and the response is an array of available permission objects for the role, such as:PHP example:
Search through the list of available permissions for the Operator role to see whether it includes the PM_DASHBOARD permission. If available, then assign it to the Operator role:
POST /role/{rol_uid}/permissionAssign a permission to a role.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/role/00000000000000000000000000000003/permission |
| rol_uid | Unique ID of the Role. The 3 predefined roles in ProcessMaker are Administrator '00000000000000000000000000000002', Operator '00000000000000000000000000000003', and Manager '00000000000000000000000000000004'. | /api/1.0/workflow/role/00000000000000000000000000000003/permission |
POST Fields:
| Name | Type | Description |
|---|---|---|
| per_uid | String | Unique ID of the permission to assign to a role. |
Result:
If the permission is successfully assigned to the role, then the HTTP status code is set to 201 (Created) and there is no response.
PHP example:
This example assigns the PM_REASSIGNCASE permission to the Operator role.
DELETE /role/{rol_uid}/permission/{per_uid}Unassign (remove) a permission from a role.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/role/00000000000000000000000000000003/permission/00000000000000000000000000000007 |
| rol_uid | Unique ID of the Role. The 3 predefined roles in ProcessMaker are Administrator '00000000000000000000000000000002', Operator '00000000000000000000000000000003', and Manager '00000000000000000000000000000004'. | /api/1.0/workflow/role/00000000000000000000000000000003/permission/00000000000000000000000000000007 |
| per_uid | Unique ID of the permission to unassign from the role. | /api/1.0/workflow/role/00000000000000000000000000000003/permission/00000000000000000000000000000007 |
Result:
If the permission is successfully unassigned from the role, then the HTTP status code is set to 200 (OK) and there is no response.
PHP example:
This example unassigns the PM_REASSIGNCASE permission from the Operator role.
The following REST endpoints are used to manage PM tables in ProcessMaker:
PM Tables:
| Name | Description | Type | Value |
|---|---|---|---|
| pmt_tab_name | PM Table name | String | "name" o "pmt_NAME"(String) |
| pmt_tab_dsc | PM Table description | String | "PM table description"(String) |
| fields | PM Table fields | Array | |
| fld_dyn | Field name known in a DynaForm | String | "Acceptance"(String) |
| fld_name | Field name for the MySQL table creation | String | "ACCEPTED" (String) |
| fld_label | Field label in the PM graphic | String | "PM Table description"(String) |
| fld_type | MySQL field type, which may be: "BOOLEAN", "TINYINT", "SMALLINT", "INTEGER", "BIGINT", "DOUBLE", "FLOAT", "REAL", "DECIMAL", "CHAR", "VARCHAR", "LONGVARCHAR", "DATE", "TIME" or "DATETIME" | String | "VARCHAR"(String MySQL type field) |
| fld_size | MySQL field size | Integer | 23 (Numeric) |
Available methods:
GET /pmtableGet a list of the PM tables in the workspace. It does not include any Report Tables.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/pmtable |
Result:
If successful, the HTTP status is set to 200 (OK) and an array of PM Table objects is returned:
| [ | Start array. |
| { | Start PM Table object. |
| "pmt_uid", | Unique ID of the PM Table. |
| "pmt_tab_name", | Table in the wf_{workspace} database. |
| "pmt_tab_description", | Description of the PM Table. |
| "pmt_tab_class_name", | PHP class name for the PM Table. |
| "pmt_num_rows", | Number of records in the PM Table. |
| "fields": [ | An array of fields in the PM Table. |
| { | Start Field object. |
| "fld_uid", | Unique ID of the field. |
| "fld_index": | Index number of the field, counting from the number 0. |
| "fld_name": | Name of the field in the database. |
| "fld_description": | Label of the field. |
| "fld_type": | Type of the field. |
| "fld_size": | Field size. |
| "fld_null": | Set to "1" if a NULL (empty) value is allowed. Otherwise, set to "0". |
| "fld_auto_increment": | Set to "1" if the field will be auto-incremented. Otherwise, set to "0". |
| "fld_key": | Set to "1" if a key field, meaning that its values are unique. Otherwise, set to "0". |
| "fld_table_index": | Set to "1" if the field will be indexed. Otherwise, set to "0". |
| }, | End Field object. |
| ... | Any additional Field objects. |
| ] | End array of Field objects. |
| }, | End PM Table object. |
| ... | Any additional PM Table objects. |
| ] | End array of PM Table objects. |
For example:
PHP Example:
Print out the PM Tables and the fields in each table.
GET /pmtable/{pmt_uid}Get the structure from a specified PM Table, including a list of its fields and their properties.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/pmtable/33532851355ef56860e8297082884997 |
| pmt_uid | Unique ID of the PM Table | /api/1.0/workflow/pmtable/33532851355ef56860e8297082884997 |
Result:
If successful, the HTTP status is set to 200 (OK) and a PM Table object is returned, such as:
PHP Example:
Print out the number of records in a PM Table and list the fields in the PM Table.
GET /pmtable/{pmt_uid}/dataGet the data (records) from a PM table.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/pmtable/33532851355ef56860e8297082884997/data |
| pmt_uid | Unique ID of the PM Table | /api/1.0/workflow/pmtable/33532851355ef56860e8297082884997/data |
Result:
If successful, the HTTP status is set to 200 (OK) and an object is returned with the rows of data in the PM Table and the number of rows.
For example:
Note: The field names are automatically converted to lowercase.
Note: Integers, floating-point numbers (real numbers) and boolean values are converted to strings. In the above example, the id is an integer and the has_contract is a boolean in MySQL. Also, the __index__ field is automatically created by MySQL to index the PM Table.
PHP Example:
Print out the records in a PM Table in an HTML table. First get the structure of the PM Table with GET /api/1.0/workflow/pmtable/{pmt_uid} in order to print out the label (description) of each field in the headers of the HTML table. Then, get the records with GET /api/1.0/workflow/pmtable/{pmt_uid}/data and print out each record as a record in the HTML table.
POST /pmtableCreate a new PM Table.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/pmtable |
POST Fields:
| Name | Description |
|---|---|
| { | Start object. |
| "pmt_tab_name", | The name of the PM Table, which only consists of ASCII letters, numbers and underscores ("_"). It will automatically be converted to UPPERCASE. It is strongly recommended that it begin with "PMT_". |
| "pmt_tab_dsc", | Optional. Description of the PM Table. |
| "fields" | An array of field objects. |
| [ | Start the array. |
| { | Start object defining field. |
| "fld_name", | The field name, which should only contain ASCII letters, numbers and underscores ("_"). It will automatically be converted to UPPERCASE. It is recommended that it be in UPPERCASE. |
| "fld_label, | The field's label. |
| "fld_type", | The field type, which can be:
|
| "fld_size", | The field size is required for CHAR and VARCHAR fields, where it sets the maximum number of allowed characters. The field size is optional for BOOLEAN, TINYINT, SMALLINT, INTEGER and BIGINT fields, where it sets the maximum number of allowed digits. It is also optional for FLOAT, REAL and DECIMAL fields, where it sets the maximum number of digits before the decimal point. The number of decimal digits cannot be specified, although it is automatically set to 2 in DECIMAL fields. For example, setting fld_size to 4 allows numbers between -9999.X and 9999.X with the number of decimals determined by the maximum for the data type.The fld_size should NOT be included in DOUBLE, DATE, TIME, DATETIME, TIMESTAMP and LONGVARCHAR fields or it will cause a 400 error with no response object. Likewise, a 400 error will be caused if the fld_size is set to a value larger than the allowed size, such as 50 for an INTEGER. |
| "fld_null", | Optional. Set to 1 if this field may have a value of NULL, meaning "no data". Otherwise, set to 0, meaning that the field must have a value. If not included, then set to 1 by default. |
| "fld_autoincrement", | Optional. Set to 1 if this field will be auto-incremented, meaning that the value will be automatically inserted as the maximum existing value in the field plus 1. This option is recommended for ID fields. Otherwise set to 0, which is the default. |
| "fld_key" | Optional. Set to 1 if this field should be a primary key field, meaning that its value will be unique and it will used to index the table. Otherwise set to 0, which is the default if not included. |
| } | End of object defining the field. |
| ... | Any additional field objects. |
| ] | End array of field objects. |
| } | End object. |
Result:
If the table is created, then the HTTP status code is set to 201 (Created) and a object is returned with information about the new PM Table. See the JSON example below.
JSON example:
Request:
Response:
PHP example:
Note: If using PHP, the POST variables will need to be passed through the http_build_query() which will cause problems with fields which include the fld_size. The ProcessMaker source code needs to be changed to avoid an error.
POST /pmtable/{pmt_uid}/dataAdd a new record to a PM Table.
URL Parameters:
| Name | Description | Example |
|---|---|---|
| workspace | Workspace name | /api/1.0/workflow/pmtable/22815673755f209dd749c90081062413/data |
| pmt_uid | Unique ID of PM Table | /api/1.0/workflow/pmtable/22815673755f209dd749c90081062413/data |
POST Fields:
The following object where the member variables have the same names as the fields in the PM Table and their values will be inserted in a new record in the PM Table.
For example:Result:
If successful, the HTTP status is set to 201 (Created) and the new record which has been inserted in the PM Table is returned, with the field names in lowercase.
PHP example:
