WorkFlow API Documentation11
WorkFlow API Documentation11
Documentation
Contents
Introduction…………………………………………………………………………………………………………………………………
Authentication ……………………………………………………………………………………………………………………………
JWT Authentication ……………………………………………………………………………………………………………………
Entity Beans …………………………………………………………………………………………………………………………
Complete and Simple Bean…………………………………………………………………………………………
Setting Entity’s Child Beans…………………………………………………………………………………………
Searching entities…………………………………………………………………………………………
Limiting attributes returned in search…………………………………………………………………………………
Include additional fields in response……………………………………………………………………………….
Returning the list of log entries…………………………………………………………………………………………
Returning errors with messages…………………………………………………………………………………………
Date and Date Time Bean attributes…………………………………………………………………………………
Number and Decimal Bean attributes………………………………………………………………………………
Reading Custom Field values…………………………………………………………………………………………
Setting Custom Field values…………………………………………………………………………………………
Custom Field formats…………………………………………………………………………………………
Length options…………………………………………………………………………………………
Entity Beans listing…………………………………………………………………………………………
HTTP response codes…………………………………………………………………………………………
APIs Listing…………………………………………………………………………………………
Account…………………………………………………………………………………………
Case…………………………………………………………………………………………
Case Type…………………………………………………………………………………………
Company…………………………………………………………………………………………
Contact …………………………………………………………………………………………
Custom Field…………………………………………………………………………………………
Custom Table…………………………………………………………………………………………
Department…………………………………………………………………………………………
Message…………………………………………………………………………………………
Project…………………………………………………………………………………………
PermissionGroup……………………………………………………………………………
User…………………………………………………………………………………………
User Type…………………………………………………………………………………………
Detailed Workflow API…………………………………………………………………………………………
Account…………………………………………………………………………………………
Case…………………………………………………………………………………………
Case Type…………………………………………………………………………………………
Company…………………………………………………………………………………………
Contact …………………………………………………………………………………………
Custom Field…………………………………………………………………………………………
Custom Table…………………………………………………………………………………………
Department…………………………………………………………………………………………
Message…………………………………………………………………………………………
Project…………………………………………………………………………………………
PermissionGroup…………………………………………………………………………………
User…………………………………………………………………………………………
User Type…………………………………………………………………………………………
Appendix A – Countries…………………………………………………………………………………………
Appendix B – States…………………………………………………………………………………………
Appendix C – Custom Field Types……………………………………………………………………………
Appendix D – Error Codes…………………………………………………………………………………………
Introduction
The Workflow RESTful Service API (further referenced as Workflow API) is intended to allow third
party applications to collaborate with Workflow. Workflow API enables its consumers to easily
perform various operations over Workflow objects using standard HTTP methods: GET, POST,
PUT and DELETE.
For the call to be successfully completed user performing an API call must be authenticated.
Note: In order to easily try out the examples from this document you can use Google Chrome’s
“Postman – Rest Client” extension, Mozila Firefox’s “RESTClient” add on or any other similar
product. We recommend Google Chrome’s extension “Postman – Rest Client” which has a lot of
options including call history, favourite calls, support for authorization, support for uploading
files etc.
Authentication
Each Workflow API request must be authenticated. Two request headers are required in reach
request in order to authenticate the user performing an API call:
1) Authorization header
Workflow API uses Basis Authentication mechanism with standard HTTP headers which
means that no handshakes have to be done. User performing Workflow API call must
be a Workflow user with admin rights. Username used for Workflow API authentication
is user’s login name and password is user’s WS Token which can be found in Setup ->
Users -> Users -> Edit specific user.
Example: For user with login name “jsmith” and WSToken “0mr3ot99LYMvit77J9sf”
Authorization header will look like this:
Java code example for creating Authorization header looks like this:
JWT Authentication
JWT authentication is an authentication type for Workflow API and it can be used by various
applications. It should be used primarily for application integration.
To use JWT authentication with Workflow, private and public keys need to be generated.
Private key is located on client-side (as secret, it should be stored in key store), and the public
key will be on the Server side (It can be safely stored in the database).
When a client needs to call Workflow API on the server side, instead of sending username and
password, the client should:
• create header and payload (these are JSONs with information about JWT token and
user)
• sign header and payload using the private key and RS256 algorithm
• create a JWT token from header, payload and signature, encoding it using Base64Url
and send it to the client as Bearer header
On server-side, the app gets Bearer token, decodes it, parses header and payload, and
validates the JWT signature using the public key.
Note: Workflow supports the server side for this implementation and the other application
should support the client side.
For setting JWT user synch between Workflow (Server side) and Commissions (Client side):
• go to Workflow app, setup => users add/update user with the public key
The JWT token must contain the following JSON properties:
Header
• typ : JWT
• alg : RS256
Payload
• sub - subject (required, this is userid (systemId) which public key is used for validation
of JWT signature)
base64UrlEncode(header)+"."+base64UrlEncode(payload)+"."+signatureRSA256(base64UrlEncode(header)+"."+base64
UrlEncode(payload), privateKey)
Note: The private/public key pair will be generated by the SAP Ops team. The Implementation
team will add the private key in Commissions and the public key in Workflow > Setup > Users.
Workflow provides an automated way to utilize a service account and upload the public key
for the user.
(http://$ENV_URL/wpm/api/users/$SYSTEM_ID/public_key)
Authorization Basic Auth (password: WS token)
Description This API sets the public key for a specific user from the
selected file.
Example:
Each Workflow entity (case, account, contact, user etc.) has it’s Bean representation which
contains entity’s attributes. Beans are used to transfer data between requestor and Workflow.
Here is what you need to know about Entity Beans before starting to use Workflow API.
GET /accounts/account_b
Response body:
{
"billing_address": {
"address2": "Fake Street 456",
"address3": "Third Street 100",
"city": "San Francisco",
"country": {
"name": "USA",
"system_id": "usa"
},
"state": {
"name": "California",
"system_id": "CA"
},
"street": "Some Street 123",
"zip": "12345"
},
"custom_fields": [
{
"name": "Day Went Live",
"system_id": "day_went_live",
"type_name": "Date",
"type_system_id": 3,
"value": "10/01/13",
"value_formatted": "01/10/13"
}
],
"description": "This is Account B.",
"employees": "500",
"fax": "555-555-777",
"location": "San Francisco",
"name": "Account B",
"phone": "555-555-777",
"shipping_address": { "address2":
"Fake Street 456", "address3":
"Third Street 100", "city":
"San Francisco", "country":
{
"name": "USA",
"system_id": "usa"
},
"state": {
"name": "California",
"system_id": "CA"
},
"street": "Some Street 123",
"zip": "12345"
},
"system_id": "account_b",
"uri": "http://localhost:8080/wpm/api/accounts/account_b",
"web_site": "www.accountb.com"
}
We can see that the complete AccountBean contains more than 10 attributes.
GET /contacts/jsmith_someaddress_com
Response body:
{
"account": {
"name": "Account B",
"system_id": "account_b",
"uri": "http://localhost:8080/wpm/api/accounts/account_b"
},
"active": true,
"address": {
"address2": "Second Street 456",
"address3": "Third Street 789",
"city": "San Francisco",
"country": {
"name": "USA",
"system_id": "usa"
},
"state": {
"name": "California",
"system_id": "CA"
},
"street": "First Street 123",
"zip": "12345"
},
"cell_phone": "555-555-456",
"custom_fields": [
{
"name": "Contact Role",
"system_id": "contact_role",
"type_name": "Checkbox",
"type_system_id": 8,
"value": "Consultant",
"value_formatted": "Consultant"
}
],
"department": "",
"email": "[email protected]",
"fax": "555-555-741",
"first_name": "John",
"home_phone": "555-555-789",
"id": 1894,
"job_title": "Developer",
"last_name": "Smith",
"middle_name": "",
"name": "John Smith",
"phone": "555-555-123",
"system_id": "jsmith_someaddress_com",
"uri": "http://localhost:8080/wpm/api/contacts/jsmith_someaddress_com"
}
POST /contacts
Request body:
{
"account_system_id": "account_b",
"active": true,
"cell_phone": "555-555-111",
"custom_fields": [
{
"systemId": "contact_role",
"value": "consultant"
}
],
"department": "",
"email": "[email protected]",
"first_name": "John",
"home_phone": "555-555-987",
"job_title": "Developer",
"last_name": "Smith",
"phone": "866.612.7312"
}
Searching Entities
Most resources have methods for performing a search based on set criteria. Search criteria is set
through query parameters. Response which is returned contains ResultBean which has list of
objects and a few other attributes:
GET /departments?name=accounting&page=1&page_size=5
{
"completed_in": 89,
"departments": [
{
"company": {
"name": "My Company Inc.",
"system_id": "my_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/my_company_inc"
},
"gate_keeper": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith2",
"system_id": "jsmith2",
"uri": "http://localhost:8080/wpm/api/users/jsmith2",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"name": "Accounting",
"system_id": "accounting",
"uri": "http://localhost:8080/wpm/api/departments/accounting"
},
{
"company": {
"name": "Other Company, Inc.",
"system_id": "other_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/other_company_inc"
},
An example case search which returns all case attributes would look like this:
GET /cases?assignee=jsmithtsmith&owner=tsmith&page=1&page_size=5
Response body would contain 5 cases that have jsmith and smith as assigness and in which
tsmith is the owner. All these cases would have complete Bean representation (all case attributes
would be returned). To return only case key, case name, assignees and status we form the
request thisway:
Search result will contain CaseBeans with 4 required fields. Response body:
{
"cases": [
{
"assignees": [
{
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
}
],
"case_key": "Task-sp-3",
"name": "REST API - Case 3 - UPDATED",
"status": {
"name": "Described",
"system_id": "described"
}
},
{
"assignees": [
{
As listed above, search response contains a list of complete Bean objects. If there is a need to return additional
fields with already existing fields, then these attribute names must be sent as query parameter with name
“extend”. This parameter has the value of the attribute names separated by space and it tells the Workflow API
which attributes should be included inside the response in addition to default fields.
This extended functionality is implemented for user APIs (for all users as well as for single user, as shown in
example below).
As it is a generic functionality, it can be implemented for other APIs, but for now it is implemented for user’s
attributes: “last_login_date” and “permissions”.
Both, “extend” as well as “mask” query parameter could be used in a single request.
1[
2 {
3 "login_name": "jsmith",
4 "first_name": "John",
5 "last_name": "Smith",
6 "email": "[email protected]",
7 "department": {
8 "name": "WorkFlow Administration",
9 "system_id": "workflow_administration",
10 "uri": "http://localhost:8080/wpm/api/departments/workflow_administration"
11 },
12 "user_type": {
13 "name": "WorkFlow Administrator",
14 "system_id": "workflow_administrator",
15 "uri": "http://localhost:8080/wpm/api/user_types/workflow_administrator"
16 },
17 "administrator": true,
18 "active": true,
19 "system_id": "admin",
20 "uri": "http://localhost:8080/wpm/api/users/admin",
"last_login_date": 1277456582000,
22 "permissions": [
23 {
24 "name": "[ All Users ]",
25 "system_id": "_all_users_"
26 },
27 {
28 "name": "Managers",
29 "system_id": "managers"
30 },
31 ]
32 }
33]
1[
2 {
3 "login_name": "jsmith",
4 "first_name": "John",
5 "email": "[email protected]",
6 "last_login_date": "02/17/2022 12:00:10 CST"
7 }
8]
1[
2 {
3 "login_name": "jsmith",
4 "first_name": "John",
5 "last_name": "Smith",
6 "email": "[email protected]",
7 "permissions": [
8 {
9 "name": "[ All Users ]",
10 "system_id": "_all_users_"
11 },
12 {
13 "name": "Managers",
14 "system_id": "managers"
15 },
16 ]
17 }
18]
Then application will return response without last login date and permission details.
Example is below:
1[
2 {
3 "login_name": "customer",
4 "first_name": "Carlo",
5 "last_name": "Customer",
6 "email": "[email protected]",
7 "department": {
8 "name": "External Users",
9 "system_id": "external_users",
10 "uri": "http://localhost:8080/wpm/api/departments/external_users"
11 },
12 "user_type": {
13 "name": "Customer",
14 "system_id": "customer",
15 "uri": "http://localhost:8080/wpm/api/user_types/customer"
16 },
17 "administrator": false,
18 "active": true,
19 "system_id": "customer",
20 "uri": "http://localhost:8080/wpm/api/users/customer"
21 }
22]
We are introducing the new API method which returns the list of log entries. For each log entry
we return all information which are now available on the System Log page. You can filter logs by
the following Attributes:
o event_id
o event_date_from
o event_date_to
o log_level
o logger
o message
o exception_trace
o script_system_id
o user_name
o case_id
o pid
o parent_pid
o root_pid
o job_name
o session_id
o category
• use paging
o page - this is used for fetching desired page of results (if not specified it will show page=1)
o page_size - this is used to define page size (if not specified it will use page_size=100)
GET https://qa.workflow.dev.sap/wpm/api/system_log
If a specific Workflow REST API call fails, besides HTTP Status code API returns ErrorBean with
two attributes: “error_code” and “error_messages”. Atribute “error_code” tells which exception
type occured and “error_messages” provide a list of messages which describe the error with
the specific details. Error codes returned by Workflow REST API are listed in Appendix D.
{
"error_code": "LENGTH_GREATER_THAN_MAXIMUM",
"error_messages": [
"Invalid custom Field Participate In Event value '[event_1, event_2, event_3]'. Must be less than or
equal to 2."
]
}
For example:
CaseBean has “created_on” attribute. User performing REST API call has the followingsettings:
or example, if user has “1,234.5” number format, fields will look like in the example below: GET
/accounts/some_company_account
Response body:
CustomFieldBean has two attributes which are used to show the value of custom field:
{
"name": "When the issue resolved",
"system_id": "when_the_issue_resolved",
"type_name": "Date and Time",
"type_system_id": 16,
"value": "10/08/2013 17:16:00",
"value_formatted": "08.10.13 17:16:00"
}
For example, user John Smith uses “1.234,56” number format settings.
{
"name": "Price",
"system_id": "price",
"type_name": "Currency",
"type_system_id": 33,
"value": "123456789.12",
"value_formatted": "123.456.789,12"
}
c) Custom Fields with predefined values (checkbox, radio button, pick list…)
The following Custom Field Types have Predefined Values option: Autocomplete, Checkbox,
Multiple Autocomplete, Multiple Choice Pick Up List, Pick List and Radio Button.
Label SystemID
Blue bl
Red rd
Green grn
Yellow ylw
White wht
Black blk
{
"name": "Available colors",
"system_id": "available_colors",
"type_name": "Checkbox",
"type_system_id": 8,
"value": "Blue; Green; White",
"value_formatted": "Blue; Green; White"
}
{
"autocomplete_value": "sp:Sales Project",
"name": "project auto",
"system_id": "project_auto",
"type_name": "Project Autocomplete",
"type_system_id": 13,
"value": "Sales Project",
"value_formatted": "Sales Project"
}
Two CustomFieldBean’s attributes must be sent to Workflow API: “system_id” and “value”.
Example request:
POST /cases/Task-sp-2/custom_fields Request body:
{
"system_id": "business_phone",
"value": "555-555-123"
}
This table shows the formats of certain Custom Fields values by Field Type expected by Workflow
API:
{
"system_id": "day_went_live",
"value": "02.25.13"
}
{
"error_code": "BAD_DATE_FORMAT",
"error_messages": [
"Value '02.25.13' cannot be converted to Date. Expected date formats (02/25/13, 2013-02-25 or Feb 25,
2013)."
]
}
{
...
"case_key": "Task-sp-2",
...
"custom_fields": [
{
"name": "Day Went Live",
"system_id": "day_went_live",
"type_name": "Date",
"type_system_id": 3,
"value": "02/25/13",
"value_formatted": "25.02.13"
},
...
],
...
"system_id": "Task-sp-2",
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-2"
}
Label SystemID
Blue bl
Red rd
Green grn
Yellow ylw
White wht
Black blk
{
"system_id": "available_colors",
"value": "bl,grn,somenonexistingcolor"
}
Response body:
{
"error_code": "CUSTOM_FIELD_VALUE_DOES_NOT_EXIST",
"error_messages": [
"'bl,grn,somenonexistingcolor' is not valid value for Custom Field Available colors."
]
}
{
...
"case_key": "Task-sp-2",
...
"custom_fields": [
{
"name": "Available colors",
"system_id": "available_colors",
"type_name": "Checkbox",
"type_system_id": 8,
"value": "Blue; White; Yellow",
"value_formatted": "Blue; White; Yellow"
},
...
],
...
"system_id": "Task-sp-2",
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-2"
}
Label SystemID
Group 1 group_1
Group 2 group_2
Group 3 group_3
Response body:
{
"error_code": "CUSTOM_FIELD_VALUE_NOT_VALID",
"error_messages": [
"Multiple value 'group_1, group_2' cannot be set to Radio Button. Single system_id expected."
]
}
{
...
"case_key": "Task-sp-2",
...
"custom_fields": [
{
"name": "Product Group",
"system_id": "product_group",
"type_name": "Radio Button",
"type_system_id": 7,
"value": "Group 2",
"value_formatted": "Group 2"
},
...
],
...
"system_id": "Task-sp-2",
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-2"
}
On example, Project Autocomplete has all projects available for selection. Selected projects
system_id is sent along with the system_id of selected project.
a) Sending invalid value: POST /cases/Task-sp-2/custom_fields
Request body:
{
"system_id": "project_auto",
"value": "some_non_existing_system_id"
}
{
"error_code": "CUSTOM_FIELD_VALUE_DOES_NOT_EXIST",
"error_messages": [
"'some_non_existing_system_id' is not valid value for Custom Field project auto."
]
}
{
...
"case_key": "Task-sp-2",
...
"custom_fields": [
{
"autocomplete_value": "sp:Sales Project",
"name": "project auto",
"system_id": "project_auto",
"type_name": "Project Autocomplete",
"type_system_id": 13,
"value": "Sales Project",
"value_formatted": "Sales Project"
},
...
],
...
"system_id": "Task-sp-2",
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-2"
}
Custom Field values which are set through CustomFieldBean must meet specific requirements.
For example, we have a Custom Field “Business Phone” with type Text and we set “Length” to
15 and “Minimum” to 5. Let’s set this custom fields value for case “Task-sp-2”. Two request
with less than 5 characters and more than 15 characters will look like this:
- Less than 5 characters: POST /cases/Task-sp-2/custom_fields
Request body:
{
"system_id": "business_phone",
"value": "555"
}
Response body:
{
"error_code": "LENGTH_LESS_THAN_MINUMUM",
"error_messages": [
"Invalid custom Field Business Phone value '555'. Must be greater than or equal to 5."
]
}
{
"system_id": "business_phone",
"value": "Phone/fax: 555-123-1234"
}
Response body:
{
"error_code": "LENGTH_GREATER_THAN_MAXIMUM",
"error_messages": [
"Invalid custom Field Business Phone value 'Phone/fax: 555-123-1234'. Must be less than or equal to
15."
]
}
Label SystemID
Event 1 event_1
Event 2 event_2
Event 3 event_3
Under “Advanced” tab, “Maximum” option has value of 2 and “Minimum” option has value of
1. This means that the user has to pick at least 1 event he wants to participate in but can pick
no more than 2 events.
a) Choosing more than 2 events POST /cases/Task-sp-2/custom_fields
Request body:
{
"system_id": "participate_in_event",
"value": "event_1, event_2, event_3"
}
{
"error_code": "LENGTH_GREATER_THAN_MAXIMUM",
"error_messages": [
"Invalid custom Field Participate In Event value '[event_1, event_2, event_3]'. Must be less than or
equal to 2."
]
}
{
"system_id": "participate_in_event",
"value": ""
}
Response body:
{
"error_code": "LENGTH_LESS_THAN_MINUMUM",
"error_messages": [
"Invalid custom Field Participate In Event value ''. Must be greater than or equal to 1."
]
}
c) Choosing 2 events
POST /cases/Task-sp-2/custom_fields Request body:
{
"system_id": "participate_in_event",
"value": "event_2, event_3"
}
{
...
"case_key": "Task-sp-2",
...
"custom_fields": [
{
"name": "Participate In Event",
"system_id": "participate_in_event",
"type_name": "Checkbox",
AccountBean
AddressBean
CountryBean
StateBean
CustomFieldBean
PredefinedValueBean
ProjectBean
PermissionBean
UserBean
UserTypeBean
CompanyBean
StatusBean
ActionBean
MessageBean
CustomTableRowBean
CustomTableCellBean
TotalBean
QueryBean
CaseBean
AttachmentBean
CommentBean
ActionParamsBean
ResultBean
ErrorBean
The table below shows the listing of some of the most common HTTP status codes returned
by Workflow APIs. For detailed desctiptions of each API method and information about each
response code, see D etailed Workflow API.
Workflow RESTful API exposes 13 different entities to third party applications. Besides basic CRUD
operations API contains various useful operations for entity manipulation. Tables below show the
listing of all available methods. D etailed Workflow API will go into the details of all methods
and show the examples.
GET http://social.webcomserver.com/api/accounts .
The following tables contain all available API paths and short description. Each HTTP Method is a
Hyperlink to the detailed description in D etailed Workflow API.
Note: Each entity has it’s own system_id field. This field represents a unique human readable id
for each entity. System_id is visible inside Workflow web application. System_id is unique on
entity level. For example, two departments cannot have two the same system_id values.
However, department and permission group can have the same vales as system_id.
7. DELETE /cases/{system_id}/delete_with_related Deletes the case with specified system id and deletes
it’s related cases (cases for which case with system id
“system_id” is their parent).
10. PUT /cases/{system_id}/close_with_related Closes the case with specified system id and closes
it’s related cases (cases for which case with system id
“system_id” is their parent).
Example:
https://qa.workflow.salescloud.dev.sap/
wpm/api/cases?closed=true
With this request closed cases on the specific tenant are
retrieved.
Parameter closed can be used in combination with
other parameters that can be used for searching cases, for
example, case_type, name, status, etc.
Example:
https://qa.workflow.salescloud.dev.sap/
wpm/api/cases?case_type=dispute&closed=
true
Here dispute is the systemId of the specific
workflow. Using this request, users will be able to retrieve
disputed cases that were closed.
If the parameter closed has the value false, all
disputed cases except the closed ones will be retrieved.
Bulk Cases
12. POST /cases/create_bulk Creates a list of cases based on received list of
CaseBean objects.
Case Lists
14. GET /cases/list/{system_id} Returns cases which belong to the list withspecified
system id.
31. DELETE /cases/{system_id}/related_cases/{related_system_id} Deletes the relation between case with system id
"system_id" and its related case with system id
"related_system_id".
Custom Fields
32. GET /cases/{system_id}/custom_fields/{custom_field_system_id} Returns specified custom field with its value which is
set for specified case.
33. POST /cases/{system_id}/custom_fields Sets custom field value in specified case based on
received CustomFieldBean.
34. PUT /cases/{system_id}/custom_fields Updates custom field value in specified case based
on received CustomFieldBean.
35. DELETE /cases/{system_id}/custom_fields/{custom_field_system_id} Deletes the value of specified custom field in
specified case.
Attachments
36. GET /cases/{system_id}/attachments Returns a list of attachments from specified case
which user who is performing a REST call has
permission to see.
37. GET /cases/{system_id}/attachments/{attachment_system_id} Returns (downloads) attached file with specified
attachment system id from case with specified
system id.
38. POST /cases/{system_id}/attachments Uploads attachment to specified case.
39. DELETE /cases/{system_id}/attachments/{attachment_system_id} Deletes the attachment with specified attachment
system id from specified case.
Comments
40. G ET /cases/{system_id}/comments Returns a list of comments from specified case which
user who is performing a REST call has permission to
see.
41. G ET /cases/{system_id}/comments/{comment_system_id} Returns a comment with specified comment system
id from specified case.
Methods:
Department
Resource: Department Main path: /departments
Custom Fields
9. GET /users/{system_id}/custom_fields/{custom_field_system_id} Returns specified custom field with its value which is
set for specified user.
10. POST /users/{system_id}/custom_fields Sets custom field value to specified user based on
received CustomFieldBean.
11. PUT /users/{system_id}/custom_fields Updates custom field value for specified user based
on received CustomFieldBean.
12. DELETE /users/{system_id}/custom_fields/{custom_field_system_id} Deletes the value of specified custom field for
specified user.
This section shows the detailed listing of WokFlow APIs with examples for each API call.
For each request, return MIME type is determined based on “Accept” request header which is
sent by user calling Workflow API. Workflow API returns the result inside request body in
specified format and sets MIME type value into Content-Type response header. JSON format is
currently supported and fully tested.
For list of countries with their System IDs, go to Appendix A, for list of states with their System IDs, go to
Appendix B and for list of Custom Field Types with their System IDs, go to Appendix C.
Account
Resource: Account Main path: /accounts
GET /accounts/{system_id}
JSON example:
a) GET /accounts/some_company_account
{
"annual_revenue": 123456789.21,
"annual_revenue_formatted": "123,456,789.21",
"billing_address": {
"address2": "Second Street 456",
"address3": "Third Street 789",
"city": "Phoenix",
"country": {
"name": "USA",
"system_id": "usa"
},
"state": {
"name": "Arizona",
"system_id": "AZ"
},
"street": "First Street 123",
"zip": "11123"
},
"custom_fields": [
{
"name": "Number of Employees",
"system_id": "number_of_employees",
"type_name": "Number",
"type_system_id": 2,
"value": "1000",
"value_formatted": "1000"
},
{
"name": "Number of Users",
"system_id": "number_of_users",
"type_name": "Number",
"type_system_id": 2,
"value": "500",
"value_formatted": "500"
}
],
"description": "Company Some Company from USA - specializes in marketing.",
"employees": 10523,
"employees_formatted": "10,523",
"fax": "555-555-456",
"location": "Phoenix, Arizona, USA",
"name": "Some Company Account",
"phone": "555-555-789",
"shipping_address": {
"address2": "Second Street 456",
"address3": "Third Street 789",
"city": "Phoenix",
"country": {
"name": "USA",
"system_id": "usa"
},
"state": {
"name": "Arizona",
"system_id": "AZ"
},
"street": "First Street 123",
"zip": "11123"
},
"system_id": "some_company_account",
"uri": "http://localhost:8080/wpm/api/accounts/some_company_account",
"web_site": "www.somecompany.com"
}
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Account does not exist."
]
}
POST /accounts
JSON example:
a) POST /accounts
Request body:
{
"annual_revenue": 123456789.21,
"billing_address": {
"city": "Phoenix",
"country_system_id": "usa",
"state_system_id": "AZ",
"street": "First Street 123",
"zip": "11123"
},
"custom_fields": [
{
"name": "Number of Employees",
"system_id": "number_of_employees",
"type_name": "Number",
"type_system_id": 2,
"value": "1000",
"value_formatted": "1000"
},
{
{
"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"Account name is required."
]
}
PUT /accounts
Request body:
{
"annual_revenue": 555456789.65,
"billing_address": {
"city": "Phoenix",
"country_system_id": "usa",
"state_system_id": "AZ",
"street": "First Street 123",
"zip": "11123"
},
"custom_fields": [
{
"system_id": "number_of_employees",
"value": "1100"
},
{
"system_id": "number_of_users",
"value": "650"
}
],
"description": "Company Some Company from USA - specializes in marketing. - UPDATED DESCRIPTION",
"employees": 10540,
"fax": "555-555-456",
"location": "Phoenix, Arizona, USA",
"name": "Some Company Account",
"phone": "555-555-789",
"shipping_address": {
"city": "Phoenix",
"country_system_id": "usa",
"state_system_id": "AZ",
"street": "a21",
"zip": "11123",
"address2": "Second Street 457"
},
"system_id": "some_company_account",
"web_site": "www.webcominc.com"
}
GET /accounts
JSON example:
There are three accounts: Account A (Location: San Francisco, Employees 100), Account B
(Location: San Francisco, Employees 500) and Account C (Location: Milwaukee, Employees 350).
If we search accounts from San Francisco with word “Account” in account name we should
get two accounts. Number of returned results can be limited with “page_size” and “page”
attributes. We form the following request:
Response body:
{
"accounts": [
{
"annual_revenue": 54321.35,
"annual_revenue_formatted": "54,321.35",
"billing_address": {
"address2": "Second Street 456",
"address3": "Third Street 789",
"city": "San Francisco",
"country": {
"name": "USA",
"system_id": "usa"
},
"state": {
"name": "California",
"system_id": "CA"
},
"street": "First Street 123",
"zip": "12345"
},
"custom_fields": [
{
"name": "Day Went Live",
"system_id": "day_went_live",
"type_name": "Date",
"type_system_id": 3, "value":
"10/01/13",
"value_formatted": "01/10/13"
}
],
"description": "",
"employees": 1100,
"employees_formatted": "1,100",
"fax": "555-555-001",
"location": "San Francisco",
"name": "Account A",
"phone": "555-555-001",
"shipping_address": {
"address2": "Second Street 456",
"address3": "Third Street 789",
"city": "San Francisco",
],
"description": "This is Account B.",
"employees": 1560,
"employees_formatted": "1,560",
"fax": "555-555-777",
"location": "San Francisco",
"name": "Account B",
"phone": "555-555-777",
"shipping_address": {
"address2": "Fake Street 456",
"address3": "Third Street 100",
"city": "San Francisco",
"country": {
"name": "USA",
"system_id": "usa"
},
"state": {
"name": "California",
"system_id": "CA"
},
"street": "Some Street 123",
"zip": "12345"
},
"system_id": "account_b",
"uri": "http://localhost:8080/wpm/api/accounts/account_b",
"web_site": "www.accountb.com"
}
],
"completed_in": 432,
"page": 1,
"page_size": 10,
"total": 2
}
JSON example:
GET /accounts/account_a/custom_fields/day_went_live
Response body:
{
"name": "Day Went Live",
"system_id": "day_went_live",
"type_name": "Date",
"type_system_id": 3,
"value": "10/01/13",
"value_formatted": "01/10/13"
}
JSON example:
POST /accounts/account_a/custom_fields
Request body:
{
"system_id": "additional_notes",
"value": "Account A is the leader in electronic industry."
}
Response body:
{
"annual_revenue": 54321.35,
"annual_revenue_formatted": 54,321.35,
"billing_address": {
"address2": "Second Street 456",
"address3": "Third Street 789",
"city": "San Francisco",
"country": {
"name": "USA",
"system_id": "usa"
},
"state": {
"name": "California",
"system_id": "CA"
},
"street": "First Street 123",
"zip": "12345"
},
"custom_fields": [
PUT /accounts/{system_id}/custom_fields
JSON example:
PUT /accounts/account_a/custom_fields
Request body:
{
"system_id": "day_went_live",
"value": "11/20/13"
}
Response body:
{
"annual_revenue": 54321.35,
"annual_revenue_formatted": 54,321.35,
"billing_address": {
"address2": "Second Street 456",
"address3": "Third Street 789",
"city": "San Francisco",
"country": {
"name": "USA",
"system_id": "usa"
},
"state": {
"name": "California",
"system_id": "CA"
},
"street": "First Street 123",
"zip": "12345"
},
"custom_fields": [
{
"name": "Day Went Live",
"system_id": "day_went_live",
"type_name": "Date",
"type_system_id": 3,
"value": "10/01/13",
"value_formatted": "01/10/13"
},
{
"name": "Additional Notes",
"system_id": "additional_notes",
"type_name": "Large Text",
"type_system_id": 5,
"value": "Account A is the leader in electronic industry.",
"value_formatted": "Account A is the leader in electronic industry."
}
],
"description": "",
"employees": 1100,
"employees_formatted": 1,100,
"fax": "555-555-001",
"location": "San Francisco",
"name": "Account A",
"phone": "555-555-001",
DELETE /accounts/{system_id}/custom_fields/{custom_field_system_id}
GET /cases/{system_id}
JSON example:
a) GET /cases/Task-sp-3
Response body:
{
"assignees": [
{
"first_name":
"Tom",
"last_name":
"Smith",
"login_name":
"tsmith",
"system_id":
"tsmith",
"uri":
"http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and
Marketing", "system_id":
"sales_and_marketing"
}
},
{
"first_name":
"John",
"last_name":
"Smith",
"login_name":
"jsmith",
b) GET /cases/some_non_existing_case
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Case does not exist."
]
}
POST /cases
Note: The case will not be created if you don't populate all required fields.
e.g If you have a form with custom fields: contact(required), case name(required)
and Priority(not required), the case will not be created if you don't populate contact and case
name, priority is optional. This is applied to all actions with the case not just for creating case
action.
a) POST /cases
Request body:
{
"case_type_system_id": "Task",
"description": "This case is created via REST API.",
"name": "REST API - Case 3",
"project_system_id": "sp",
"owner_system_id": "jsmith",
"assignees": [
{
"system_id": "jsmith"
},
{
"system_id": "tsmith"
}
],
"custom_fields": [
{
"system_id": "duration",
"value": "20"
},
{
"system_id": "effort_left",
"value": "15"
}
],
"related_to_cases": [
{
"system_id": "Task-sp-1"
},
{
"system_id": "Task-sp-2"
}
]
}
Response body:
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Owner does not exist."
]
}
POST /cases/user/{user_system_id}
JSON example:
POST /cases/user/tsmith
{
"case_type_system_id": "Task",
"description": "This case is created via REST API.",
"name": "REST API - Case 3",
"project_system_id": "sp",
"owner_system_id": "jsmith",
"assignees": [
{
"system_id": "jsmith"
},
{
"system_id": "tsmith"
}
],
"custom_fields": [
{
"system_id": "duration",
"value": "20"
},
{
"system_id": "effort_left",
"value": "15"
}
],
"related_to_cases": [
{
"system_id": "Task-sp-1"
},
{
"system_id": "Task-sp-2"
}
]
}
Response body:
{
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
{
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
}
],
"case_key": "Task-sp-5",
"case_type": {
"name": "Task",
"system_id": "task",
"unique_key": "task"
},
"closed": false,
"created_on": "09/10/13 15:55:32",
"creator": {
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"custom_fields": [
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "20",
"value_formatted": "20"
},
{
"name": "Effort Left",
"system_id": "effort_left",
"type_name": "Number",
"type_system_id": 2,
"value": "15",
"value_formatted": "15"
}
],
"description": "This case is created via REST API.",
"name": "REST API - Case 4",
"owner": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"priority": {
"name": "Medium",
"system_id": "Non-Critical"
},
"project": {
"description": "",
"is_default": false,
"name": "Sales Project",
"system_id": "sp",
"uri": "http://localhost:8080/wpm/api/projects/sp"
},
"status": {
"name": "Described",
"system_id": "described"
},
"system_id": "Task-sp-5",
"updated_on": "09/10/13 15:55:32",
"updater": {
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-5"
}
PUT /cases
Important note: Case Type and Project cannot be changed using this
method. Corresponding case actions should be invoked using this
method: PUT /cases/{system_id}/actions/{action_system_id}
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body CaseBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case successfully updated.
404 Not Found – Case or any child entity with sent system_id not
found.
Body CaseBean - success.
ErrorBean - failure.
JSON example:
If we want to update the case created in POST /cases request we would have the following
request:
PUT /cases
User performing REST call is jsmith. This user created a case. Request body:
{
"system_id": "Task-sp-3",
"case_type_system_id":
"Bug",
"name": "REST API - Case 3 - UPDATED",
"project_system_id": "sp",
"owner_system_id": "tsmith",
"assignees": [
{
"system_id": "jsmith"
}
],
"custom_fields": [
{
"system_id": "duration",
"value": "20"
},
{
"system_id": "effort_left",
"value": "5"
}
],
"related_to_cases": [
{
"system_id": "Task-sp-1"
},
{
"system_id": "Task-sp-2"
}
]
}
Response body:
{
"assignees": [
{
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
}
],
"case_key": "Task-sp-3",
"case_type": {
"name": "Task",
"system_id": "task",
"unique_key": "task"
},
"closed": false,
"created_on": "09/10/13 14:50:49",
"creator": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"custom_fields": [
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "20",
"value_formatted": "20"
},
{
"name": "Effort Left",
"system_id": "effort_left",
"type_name": "Number",
"type_system_id": 2,
"value": "5",
"value_formatted": "5"
}
],
"description": "This case is created via REST API.",
"name": "REST API - Case 3 - UPDATED",
"owner": {
"first_name": "Tom",
"last_name":
"Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"priority": {
"name": "Medium",
"system_id": "Non-Critical"
},
"project": {
"description": "",
"is_default": false,
"name": "Sales Project",
"system_id": "sp",
"uri": "http://localhost:8080/wpm/api/projects/sp"
},
"status": {
"name": "Described",
"system_id": "described"
},
"system_id": "Task-sp-3",
"updated_on": "09/10/13 16:54:34",
"updater": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-3"
}
PUT /cases/user/{user_system_id}
Important note: Case Type and Project cannot be changed using this
method. Corresponding case actions should be invoked using this
method:
PUT /cases/{system_id}/actions/{action_system_id}/{user_system_id}
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body CaseBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case successfully updated.
404 Not Found – User, Case or any child entity with sent system_id
not found.
Body CaseBean - success.
ErrorBean - failure.
JSON example:
If we want to update the case created in POST /cases/user/tsmith request we would have the following
request:
PUT /cases/user/jsmith
User performing REST call is tsmith. User tsmith created a case. Request body:
{
"system_id": "Task-sp-5",
"case_type_system_id": "Bug",
"description": "This case is created via REST API.",
"name": "REST API - Case 3 - UPDATED",
"project_system_id": "sp",
"owner_system_id": "tsmith",
"assignees": [
{
"system_id": "tsmith"
}
],
"custom_fields": [
{
"system_id": "duration",
"value": "20"
},
{
"system_id": "effort_left",
"value": "1"
}
],
"related_to_cases": [
{
"system_id": "Task-sp-2"
}
]
}
Response body:
{
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
}
],
"case_key": "Task-sp-5",
"case_type": {
"name": "Task",
"system_id": "task",
"unique_key": "task"
},
"closed": false,
"created_on": "09/10/13 15:55:32",
"creator": {
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"custom_fields": [
{
"name": "Effort Left",
"system_id": "effort_left",
"type_name": "Number",
"type_system_id": 2,
"value": "1",
"value_formatted": "1"
},
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "20",
"value_formatted": "20"
}
],
"description": "This case is created via REST API.",
"name": "REST API - Case 3 - UPDATED",
"owner": {
"first_name": "Tom",
"last_name":
"Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"priority": {
"name": "Medium",
"system_id": "Non-Critical"
},
"project": {
"description": "",
"is_default": false,
"name": "Sales Project",
"system_id": "sp",
"uri": "http://localhost:8080/wpm/api/projects/sp"
},
"status": {
"name": "Described",
"system_id": "described"
},
"system_id": "Task-sp-5",
"updated_on": "09/10/13 17:07:04",
"updater": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-5"
}
DELETE /cases/{system_id}/delete_with_related
JSON example:
1. 2. 3.
name: Case 1 name: Case 2 name: Case 3
case_key: Task-sp-1 case_key: Task-sp-2 case_key: Bug-dev-1
project: sp project: sp project: dev
assignees: jsmith, tsmith assignees: jsmith, tsmith assignees: tsmith
owner: jsmith owner: tsmith owner: jsmith
a) Complete CaseBean
If we want to find cases which are assigned to jsmith and tsmith and which has tsmith as case
owner we will get only Case 2 in the result. We would form the following request:
GET /cases?assignee=jsmithtsmith&owner=tsmith&page=1&page_size=5
Response body:
{
"cases": [
{
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
{
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
}
],
"case_key": "Task-sp-2",
"case_type": {
"name": "Task",
"system_id": "task",
"unique_key": "task"
},
"closed": false,
"created_on": "10/10/13 11:11:31",
"creator": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"custom_fields": [
{
"name": "Effort Left",
"system_id": "effort_left",
"type_name": "Number",
"type_system_id": 2,
"value": "1",
"value_formatted": "1"
},
],
"description": "",
"name": "Case 2",
"owner": {
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"priority": {
"name": "High",
"system_id": "Critical"
},
"project": {
"description": "",
"is_default": false,
"name": "Sales Project",
"system_id": "sp",
"uri": "http://localhost:8080/wpm/api/projects/sp"
},
"status": {
"name": "Described",
"system_id": "described"
},
"system_id": "Task-sp-2",
"updated_on": "10/10/13 11:11:55",
"updater": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-2"
}
],
"completed_in": 580,
"page": 1,
"page_size": 5,
"total": 1
}
b) Using mask to return only specified fields
Reponse body:
{
"cases": [
{
"case_key": "Task-sp-3",
"name": "REST API - Case 3 - UPDATED",
"project": {
"description": "",
"is_default": false,
"name": "Sales Project",
"system_id": "sp",
"uri": "http://localhost:8080/wpm/api/projects/sp"
}
},
{
"case_key": "Task-sp-5",
"name": "REST API - Case 3 - UPDATED",
"project": {
"description": "",
"is_default": false,
"name": "Sales Project",
"system_id": "sp",
"uri": "http://localhost:8080/wpm/api/projects/sp"
}
},
{
"case_key": "Task-sp-7",
"name": "Case 2",
"project": {
"description": "",
"is_default": false,
"name": "Sales Project",
"system_id": "sp",
"uri": "http://localhost:8080/wpm/api/projects/sp"
}
}
],
"completed_in": 395,
"page": 1,
"page_size": 5,
"total": 3
}
PUT /cases/{system_id}/close
Request example:
PUT /cases/Task-sp-3/close
PUT /cases/{system_id}/close_with_related
JSON example:
a) POST /cases/create_bulk
User performing REST call is jsmith.
Request body:
[{
"case_type_system_id": "Task",
"description": "This case is created via REST API.",
"name": "REST API - Case 1",
"project_system_id": "sp",
"owner_system_id": "jsmith",
"assignees": [{
"system_id": "jsmith"
},
{
"system_id": "tsmith"
}],
"custom_fields": [{
"system_id": "duration",
"value": "20"
},
{
"system_id": "effort_left",
"value": "15"
}],
"related_to_cases": [{
"system_id": "Task-sp-1"
},
{
"system_id": "Task-sp-2"
}]
},
{
"case_type_system_id": "nonexistent",
"description": "This case is created via REST API.",
"name": "REST API - Case 2",
"project_system_id": "nonexistent",
"status_system_id": "nonexistent",
"contact_system_id": "nonexistent",
"account_system_id": "nonexistent",
"priority_system_id": "nonexistent",
"owner_system_id": "nonexistent",
"assignees": [{
"system_id": "jsmith"
},
{
"system_id": "tsmith"
}],
"custom_fields": [{
"system_id": "duration",
"value": "20"
},
{
"system_id": "effort_left",
"value": "15"
}],
"related_to_cases": [{
"system_id": "Task-sp-1"
},
{
"system_id": "Task-sp-2"
}]
}]
Response body:
{
"errors": [
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Case type does not exist.",
"Status does not exist.",
"Priority does not exist.",
"Project does not exist.",
"Account does not exist.",
"Contact does not exist.",
"Owner does not exist."
],
"failed_index": 2
}
],
"processed_entities": [
{
"name": "REST API - Case 1",
"case_key": "Task-sp-24",
"system_id": "task-sp-24",
"description": "This case is created via REST API.",
"closed": false,
"created_on": "09/01/2016 10:24:57",
"updated_on": "09/01/2016 10:24:57",
"case_type": {
"name": "Task",
"unique_key": "task",
"system_id": "task"
},
"status": {
"name": "Closed",
"system_id": "closed"
},
"priority": {
"name": "Critical",
"system_id": "Critical"
},
"project": {
"name": "sp",
"system_id": "sp",
"is_default": false,
"uri": "http://localhost:8080/wpm/api/projects/sp"
},
},
"creator": {
"login_name": "rest",
"first_name": "rest",
"last_name": "",
"user_type": {
"name": "Internal User",
"system_id": "internal_user"
},
"system_id": "rest",
"uri": "http://localhost:8080/wpm/api/users/rest"
},
"updater": {
"login_name": "rest",
"first_name": "rest",
"last_name": "",
"user_type": {
"name": "Internal User",
"system_id": "internal_user"
},
"system_id": "rest",
"uri": "http://localhost:8080/wpm/api/users/rest"
},
"owner": {
"login_name": "jsmith",
"first_name": "John",
"last_name": "Smith",
"user_type": {
"name": "Internal User",
"system_id": "internal_user"
},
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith"
},
"assignees": [
{
"login_name": "jsmith",
"first_name": "John",
"last_name": "Smith",
"user_type": {
"name": "Internal User",
"system_id": "internal_user"
},
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith"
}
],
"related_to_cases": [
{
"name": "REST API - Case 2",
"case_key": "Task-sp-2",
"system_id": "task-sp-2",
"uri": "http://localhost:8080/wpm/api/cases/task-sp-2"
},
{
"name": "REST API - Case 1",
"case_key": "Task-sp-1",
"system_id": "task-sp-1",
"uri": "http://localhost:8080/wpm/api/cases/task-sp-1"
}
"errors": [
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Case type does not exist.",
"Owner does not exist.",
"Project does not exist.",
"Status does not exist.",
"Priority does not exist.",
"Account does not exist.",
"Contact does not exist.",
],
"failed_index": 1
}
]
Important note: Case Type and Project cannot be changed using this
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body List of CaseBean objects
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case successfully updated.
404 Not Found – Case or any child entity with sent system_id not
found.
Body processed_entities - success.
errors – failure.
JSON example:
PUT/cases/update_bulk
Request body:
[{
"system_id": "Task-sp-1",
"case_type_system_id": "Task",
"description": "This case is updated via REST API.",
"name": "REST API - Case 1 UPDATED",
"project_system_id": "sp",
"owner_system_id": "jsmith",
"assignees": [{
"system_id": "jsmith"
},
{
"system_id": "tsmith"
}],
"related_to_cases": [{
"system_id": "Task-sp-1"
},
{
"system_id": "Task-sp-2"
}]
},
{
"system_id": "Task-sp-2",
"case_type_system_id": "Task",
"description": "This case is updated via REST API.",
"name": "REST API - Case 2 UPDATED",
"project_system_id": "nonexistent",
"status_system_id": "nonexistent",
"contact_system_id": "nonexistent",
"account_system_id": "nonexistent",
"priority_system_id": "nonexistent",
"owner_system_id": "nonexistent",
"assignees": [{
"system_id": "jsmith"
},
{
"system_id": "tsmith"
}],
"custom_fields": [{
"system_id": "duration",
"value": "20"
},
{
"system_id": "effort_left",
"value": "15"
}],
"related_to_cases": [{
"system_id": "Task-sp-1"
},
{
"system_id": "Task-sp-2"
}]
}]
{
"errors": [
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Status does not exist.",
"Priority does not exist.",
"Account does not exist.",
"Contact does not exist.",
"Owner does not exist."
],
"failed_index": 2
}
],
"processed_entities": [
{
"name": "REST API - Case 1 UPDATED",
"case_key": "Task-sp-1",
"system_id": "task-sp-1",
"description": "This case is updated via REST API.",
"closed": false,
"created_on": "08/31/2016 16:48:51",
"updated_on": "09/01/2016 11:04:26",
"case_type": {
"name": "Task",
"unique_key": "task",
"system_id": "task"
},
"status": {
"name": "Closed",
"system_id": "closed"
},
"priority": {
"name": "Critical",
"system_id": "Critical"
},
"project": {
"name": "sp",
"system_id": "sp",
"is_default": false,
"uri": "http://localhost:8080/wpm/api/projects/sp"
},
"creator": {
"login_name": "rest",
"first_name": "rest",
"last_name": "",
"user_type": {
"name": "Internal User",
"system_id": "internal_user"
},
"system_id": "rest",
"uri": "http://localhost:8080/wpm/api/users/rest"
},
"updater": {
"login_name": "rest",
"first_name": "rest",
"last_name": "",
"user_type": {
"name": "Internal User",
"system_id": "internal_user"
},
"system_id": "rest",
"uri": "http://localhost:8080/wpm/api/users/rest"
},
JSON example:
GET /cases/list/list_of_tasks?page=1&page_size=10
Response body:
{
"cases": [
{
"assignees": [
{
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
b) GET /cases/list/some_non_existing_list
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Case list does not exist."
]
}
JSON example:
a) Smart list with system id “toms_smart_list” returns cases where John Smith and Tom
Smith are assignees, Tom Smith is case owner and cases belong to Sales Project. List
returns two cases.
GET /cases/smart_list/toms_smart_list?page=1&page_size=10
Response body:
{
"cases": [
{
"assignees": [
{
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
b) GET /cases/smart_list/some_non_existing_smart_list
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Smart list does not exist."
]
}
JSON example:
GET /cases/system_list/creator?page=1&page_size=10
Response body:
{
"cases": [
{
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
}
],
"case_key": "Task-sp-8",
"case_type": {
"name": "Task",
"system_id": "task",
JSON example:
Tom Smith created one case. REST call is performed by John Smith and he needs a list of cases
created by Tom Smith.
GET /cases/system_list/creator/tsmith?page=1&page_size=10
Response body:
{
"cases": [
{
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
}
],
GET /cases/system_list/assignee
Request example:
GET /cases/system_list/assignee?page=1&page_size=10
Request example:
GET /cases/system_list/assignee/tsmith?page=1&page_size=10
Request example:
GET /cases/system_list/owner?page=1&page_size=10
1. GET /cases/system_list/owner/{user_system_id}
Request example:
GET /cases/system_list/owner/tsmith?page=1&page_size=10
GET /cases/system_list/team_member
HTTP Method GET
Path /cases/system_list/team_member
Description Returns a list of cases in which user performing the REST call is the
team member.
Request example:
GET /cases/system_list/team_member?page=1&page_size=10
Response body has the same format as in GET /cases/system_list/creator.
GET /cases/system_list/team_member/{user_system_id}
Request example:
GET /cases/system_list/team_member/tsmith?page=1&page_size=10
GET /cases/system_list/referral
GET /cases/system_list/referral?page=1&page_size=10
GET /cases/system_list/referral/{user_system_id}
Request example:
GET /cases/system_list/referral/tsmith?page=1&page_size=10
Request example:
GET /cases/system_list/follower?page=1&page_size=10
Request example:
GET /cases/system_list/follower/tsmith?page=1&page_size=10
JSON example:
GET /cases/Task-sp-3/related_cases
Response body:
[
{
"case_key": "Task-sp-1",
"name": "REST API - Case 1",
"system_id": "Task-sp-1",
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-1"
},
{
"case_key": "Task-sp-2",
"name": "REST API - Case 2",
"system_id": "Task-sp-2",
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-2"
}
]
GET /cases/{system_id}/related_cases/inverse
JSON example:
Case Task-sp-3 is related from two cases: Task-sp-4 and Task-sp-5. In other words, cases Task-sp-
4 and case Task-sp-5 have realted case Task-sp-3.
GET /cases/Task-sp-3/related_cases/inverse
Response body:
[
{
"case_key": "Task-sp-4",
"name": "Task 4",
"system_id": "Task-sp-4",
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-4"
},
{
"case_key": "Task-sp-5",
"name": "Task 5",
"system_id": "Task-sp-5",
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-5"
}
]
Request example:
PUT /cases/Task-sp-3/related_cases/Task-sp-7
DELETE /cases/{system_id}/related_cases/{related_system_id}
JSON example:
GET /cases/Task-sp-1/custom_fields/duration
Response body:
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "10",
"value_formatted": "10"
}
JSON example:
POST /cases/Task-sp-1/custom_fields
Request body:
{
"system_id": "due_date",
"value": "12/26/15"
}
Response body:
{
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
{
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
PUT /cases/{system_id}/custom_fields
JSON example:
PUT /cases/Task-sp-1/custom_fields
{
"system_id": "due_date",
"value": "01/15/16"
}
Response body:
{
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
{
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
}
],
"case_key": "Task-sp-1",
"case_type": {
"name": "Task",
"system_id": "task",
"unique_key": "task"
},
"closed": false,
"created_on": "09/10/13 14:35:09",
"creator": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"custom_fields": [
{
"name": "Due Date",
"system_id": "due_date",
"type_name": "Date",
"type_system_id": 3,
"value": "01/15/16",
"value_formatted": "15/01/16"
},
GET /cases/{system_id}/attachments
1. 2. 3. 4.
name: a1-public-jsmith.txt name: a2-public-jane.txt name: a3-internal-jsmith.txt name: a4-internal-jane.txt
visibility: public visibility: public visibility: internal visibility: internal
uploaded by: Jonh Smith uploaded by: Jane Smith uploaded by: Jonh Smith uploaded by: Jane Smith
uploaders company: My uploaders company: Other uploaders company: My uploaders company: Other
Company Inc. Company Inc. Company Inc. Company Inc.
John Smith can see attachments: 1 (public), 2 (public) and 3 (internal from his company). Jane
Smith can see attachments: 1 (public), 2 (public) and 4 (internal from her company).
a) John is performing REST call:
GET /cases/Task-sp-1/attachments
Response body:
[
{
"download_link": "http://localhost:8080/wpm/downloadDocument.do?attachId=29156&tenantName=default",
"internal": false,
"name": "a1-public-jsmith.txt",
"system_id": "29156",
"uploader": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
}
},
{
"download_link": "http://localhost:8080/wpm/downloadDocument.do?attachId=29158&tenantName=default",
"internal": false,
"name": "a2-public-jane.txt",
"system_id": "29158",
"uploader": {
"first_name": "Jane",
"last_name": "Smith",
"login_name": "jane",
"system_id": "jane",
"uri": "http://localhost:8080/wpm/api/users/jane",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
}
},
{
"company": {
"name": "My Company Inc.",
GET /cases/Task-sp-1/attachments
Response body:
[
{
"download_link": "http://localhost:8080/wpm/downloadDocument.do?attachId=29158&tenantName=default",
"internal": false,
"name": "a2-public-jane.txt",
"system_id": "29158",
"uploader": {
"first_name": "Jane",
"last_name": "Smith",
"login_name": "jane",
"system_id": "jane",
"uri": "http://localhost:8080/wpm/api/users/jane",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
}
},
{
"download_link": "http://localhost:8080/wpm/downloadDocument.do?attachId=29156&tenantName=default",
"internal": false,
"name": "a1-public-jsmith.txt",
"system_id": "29156",
"uploader": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
}
},
{
"company": {
"name": "Other Company Inc.",
GET /cases/{system_id}/attachments/{attachment_system_id}
JSON example:
GET cases/Task-sp-1/attachments/29151
Response headers:
GET /cases/Task-sp-1/attachments/29155
Response body:
{
"error_code": "PERMISSION_DENIED",
"error_messages": [
"You do not have permission to download this attachment."
]
}
c) Jane is performing REST call and she wants to download attachment “a1-public-jane.txt”
with system_id 29158.
GET cases/Task-sp-1/attachments/29158
Response body:
This is a public attachment uploaded by Jane Smith from Other Company Inc.
Response headers:
Content-Disposition: attachment; filename="a2-public-jane.txt"
Content-Type: application/octet-stream
d) Jane is performing REST call and she wants to download attachment “a3-internal-
jsmith.txt” with system_id 29157.
GET /cases/Task-sp-1/attachments/29157
{
"error_code": "PERMISSION_DENIED",
"error_messages": [
"You do not have permission to download this attachment."
]
}
POST /cases/{system_id}/attachments
POST /cases/Task-sp-1/attachments
Response body:
{
"download_link": "http://localhost:8080/wpm/downloadDocument.do?attachId=29170&tenantName=default",
"internal": false,
"name": "public_attachment_123_jsmith.txt",
"system_id": "29170",
"uploader": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
}
}
POST /cases/Task-sp-1/attachments
Response body:
{
"company": {
"name": "My Company Inc.",
"system_id": "my_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/my_company_inc"
},
"download_link": "http://localhost:8080/wpm/downloadDocument.do?attachId=29171&tenantName=default",
"internal": true,
"name": "internal_attachment_123_jsmith.txt",
"system_id": "29171",
"uploader": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
DELETE /cases/{system_id}/attachments/{attachment_system_id}
JSON example:
DELETE /cases/Task-sp-1/attachments/29158
DELETE /cases/Task-sp-1/attachments/29151
{
"error_code": "PERMISSION_DENIED",
"error_messages": [
"You do not have permission to delete this attachment."
]
}
JSON example:
John Smith can see comments: 1 (public), 2 (internal from his company) and 3 (public) and 5
(public). Jane Smith can see comments: 1 (public), 3 (public) and 4 (internal from her company)
and 5 (public).
a) John is performing REST call:
GET /cases/Task-sp-2/comments
Response body:
[
{
"author": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
},
"comment": "Public - John - Reply to Jane's public comment.",
"created_on": "11/02/14 11:48:12",
"internal": false,
"parent_system_id": "158871",
"system_id": "158875",
"updated_on": "13/02/14 16:19:37",
"updater": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
}
},
{
"author": {
"first_name": "Jane",
"last_name": "Smith",
"login_name": "jane",
"system_id": "jane",
"uri": "http://localhost:8080/wpm/api/users/jane",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
},
"comment": "Public - Jane",
"created_on": "12/02/14 09:16:51",
"internal": false,
GET /cases/Task-sp-1/comments
Response body:
[
{
"author": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
},
"comment": "Public - John - Reply to Jane's public comment.",
"created_on": "11/02/14 11:48:12",
"internal": false,
GET /cases/{system_id}/comments/{comment_system_id}
JSON example:
GET /cases/Task-sp-1/comments/158868
Response body:
{
"author": { "first_name":
"John", "last_name":
"Smith", "login_name":
"jsmith", "system_id":
"jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
},
"comment": "Public - John",
"created_on": "11/02/14 11:48:12",
"internal": false,
"system_id": "158868"
}
Reponse body:
{
"error_code": "PERMISSION_DENIED",
"error_messages": [
"You do not have permission to read this comment."
]
}
POST /cases/{system_id}/comments
JSON example:
POST /cases/Task-sp-2/comments
{
"comment": "Public - John",
"internal": "false",
"author_system_id": "jsmith"
}
Response body:
{
"author": { "first_name":
"John", "last_name":
"Smith", "login_name":
"jsmith", "system_id":
"jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
},
"comment": "Public - John",
"created_on": "11/02/14 11:48:12",
"internal": false,
"system_id": "158868"
}
b) Internal comment by Jonh Smith. (John is performing REST API call and author_system_id
is not sent.)
POST /cases/Task-sp-2/comments
Request body:
{
"comment": "Internal - John",
"internal": "true"
}
Response body:
{
"author": { "first_name":
"John", "last_name":
"Smith", "login_name":
"jsmith", "system_id":
"jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
},
"comment": "Internal - John",
POST /cases/Task-sp-2/comments
Request body:
{
"comment": "Public - Jane",
"internal": "false"
}
Reponse body:
{
"author": {
"first_name": "Jane",
"last_name": "Smith",
"login_name": "jane",
"system_id": "jane",
"uri": "http://localhost:8080/wpm/api/users/jane",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
},
"comment": "Public - Jane",
"created_on": "12/02/14 09:16:51",
"internal": false,
"system_id": "158871"
}
POST /cases/Task-sp-2/comments
Request body:
{
"comment": "Internal - Jane",
"internal": "true"
}
Reponse body:
POST /cases/Task-sp-2/comments
Request body:
{
"comment": "Public - John - Reply to Jane's public comment.",
"internal": "false",
"parent_system_id": "158871"
}
Reponse body:
{
"author": { "first_name":
"John", "last_name":
"Smith", "login_name":
"jsmith", "system_id":
"jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
},
"comment": "Public - John - Reply to Jane's public comment.",
"created_on": "11/02/14 11:48:12",
"internal": false,
"parent_system_id": "158871",
"system_id": "158875"
}
POST /cases/Task-sp-2/comments
Response body:
{
"error_code": "PERMISSION_DENIED",
"error_messages": [
"You do not have permission to reply to this comment."
]
}
PUT /cases/{system_id}/comments/{comment_system_id}
JSON example:
PUT /cases/Task-sp-2/comments/158868
Response body:
{
"author": { "first_name":
"John", "last_name":
"Smith", "login_name":
"jsmith", "system_id":
"jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
},
"comment": "Public - John - UPDATED",
"created_on": "11/02/14 11:48:12",
"internal": false,
"system_id": "158868",
"updated_on": "13/02/14 16:19:37",
"updater": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
}
}
PUT /cases/Task-sp-2/comments/158872
Request body:
{
"comment": "Internal - Jane - UPDATED"
}
Response body:
{
"error_code": "PERMISSION_DENIED",
"error_messages": [
"You do not have permission to update this comment."
]
}
JSON example:
a) John wants to delete public his public comment with system_id 158868.
DELETE /cases/Task-sp-1/comments/158868
DELETE /cases/Task-sp-1/comments/158872
{
"error_code": "PERMISSION_DENIED",
"error_messages": [
"You do not have permission to delete this comment."
]
}
JSON example:
GET /cases/Task-sp-2/actions
Response body:
[
{
"name": "Add Comment",
"system_id": "3680",
"type": "Add Comment"
},
{
"name": "Assign",
"system_id": "1886",
"type": "Assign"
},
{
"name": "Change Status to Awaiting Clarification",
"system_id": "922",
"type": "Assign"
},
{
"name": "Task Complete",
"system_id": "1299",
"type": "Assign"
},
{
"name": "Attach File",
"system_id": "388",
"type": "Attach File"
},
{
JSON example:
Jonh is performing a REST call requesting a list of actions Tom Smith can execute.
GET /cases/Task-sp-2/actions/tsmith
Response body:
[
{
"name": "Add Comment",
"system_id": "3680",
"type": "Add Comment"
},
{
"name": "Assign",
"system_id": "1886",
"type": "Assign"
},
{
"name": "Change Status to Awaiting Clarification",
"system_id": "922",
"type": "Assign"
},
{
"name": "Task Complete",
"system_id": "1299",
"type": "Assign"
},
{
"name": "Attach File",
"system_id": "388",
"type": "Attach File"
},
{
"name": "Delete Attachment",
"system_id": "4840",
Supported actions:
1. Assign
2. Add Comment
3. Change Status
4. Close Case
5. Edit Case
6. Delete Case
7. Reopen Case
8. Copy Case
9. Change Case Type
10. Change Project
11. Approve
12. Reject
13. Scripting Action
Note: All REST API calls for executing actions will be made by John Smith (jsmith). Case updater
after executing actions will be Jonh Smith. Examples show what ActionParamsBean fields are
used foreach action.
1) Assign
PUT /cases/Task-sp-2/actions/my_assign_action
Request body:
{
"comment": "Execute assign action via REST API",
"comment_is_internal": true,
"assignees": [
{
"system_id": "jsmith"
},
{
"system_id": "tsmith"
}
],
"custom_fields": [
{
"system_id": "effort_left",
"value": "2"
},
{
"system_id": "duration",
"value": "15"
}
]
}
Response body:
{
"account": {
"name": "Some Company Account",
"system_id": "some_company_account",
"uri": "http://localhost:8080/wpm/api/accounts/some_company_account"
},
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
{
"first_name": "John",
"last_name": "Smith",
2) Add Comment
a) Public comment
PUT /cases/Task-sp-2/actions/my_add_comment
Request body:
{
"comment": "Execute add comment action via REST - public comment",
"comment_is_internal": false,
"custom_fields": [
{
"system_id": "effort_left",
"value": "1"
},
{
"system_id": "duration",
"value": "15"
}
]
}
PUT /cases/Task-sp-2/actions/my_add_comment
Request body:
{
"comment": "Execute add comment action via REST - internal comment",
"comment_is_internal": true,
"custom_fields": [
{
"system_id": "effort_left",
"value": "1"
},
{
"system_id": "duration",
"value": "15"
}
]
}
3) Change Status
PUT /cases/Task-sp-2/actions/change_status_to_awaiting_clarification
Request body:
{
"custom_fields": [
{
"system_id": "effort_left",
"value": "14"
},
{
"system_id": "duration",
"value": "15"
}
]
}
4) Close Case
Note: Case assignee it the first assignee from assignees list in receiverd ActionParamsBean. PUT
/cases/Task-sp-2/actions/my_close_case_action
{
"comment": "Execute close case action via REST - public comment",
"comment_is_internal": false,
"assignees": [
{
"system_id": "tsmith"
}
],
"custom_fields": [
{
"system_id": "effort_left",
"value": "0"
},
{
"system_id": "duration",
"value": "15"
}
]
}
5) Edit Case
PUT /cases/Task-sp-2/actions/my_edit_case
Request body:
{
"name": "Task 2 updated via Edit action",
"description": "Updating description via Edit action",
"priority_system_id": "Critical",
"account_system_id": "some_company_account",
"contact_system_id": "jsmith_someaddress_com",
"owner_system_id": "jsmith",
"referral_system_id": "tsmith",
"custom_fields": [
{
"system_id": "effort_left",
"value": "2"
},
{
"system_id": "duration",
"value": "15"
}
]
}
Response body:
{
"account": {
"name": "Some Company Account",
"system_id": "some_company_account",
"uri": "http://localhost:8080/wpm/api/accounts/some_company_account"
},
"assignees": [
{
PUT /cases/Task-sp-2/actions/my_delete_action
Request body:
{}
Response:
7) Reopen Case
Note: Case assignee it the first assignee from assignees list in receiverd ActionParamsBean.
PUT /cases/Task-sp-2/actions/my_close_case_action
Request body:
{
"comment": "Execute reopen case action via REST - internal comment",
"comment_is_internal": true,
"assignees": [
{
"system_id": "tsmith"
}
],
"custom_fields": [
{
"system_id": "effort_left",
"value": "2"
},
{
"system_id": "duration",
"value": "15"
}
]
}
Note: Reponse contains new case (new copy). Custom Fields are updated in both cases (original
and copy).
PUT /cases/Task-sp-2/actions/my_copy_case
Request body:
{
"custom_fields": [
{
"system_id": "effort_left",
"value": "5"
},
{
"system_id": "duration",
"value": "15"
}
]
}
Response body:
{
"account": {
"name": "Some Company Account",
"system_id": "some_company_account",
"uri": "http://localhost:8080/wpm/api/accounts/some_company_account"
},
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
}
],
"case_key": "Task-sp-10",
"case_type": {
"name": "Task",
"system_id": "task",
"unique_key": "task"
},
"closed": false,
"contact": {
"email": "[email protected]",
"first_name": "John", "last_name":
"Smith", "middle_name":
"",
"system_id": "[email protected]",
"uri": "http://localhost:8080/wpm/api/contacts/[email protected]"
},
"created_on": "15/10/13 14:27:54",
"creator": {
PUT /cases/Task-sp-10/actions/my_change_case_type_action
Request body:
{
"case_type_system_id": "Bug",
"custom_fields": [
{
"system_id": "effort_left",
"value": "10"
},
{
"system_id": "duration",
"value": "15"
}
]
}
Response body:
{
"account": {
"name": "Some Company Account",
"system_id": "some_company_account",
"uri": "http://localhost:8080/wpm/api/accounts/some_company_account"
},
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
}
],
"case_key": "Bug-sp-1",
"case_type": {
"name": "Bug",
"system_id": "bug",
"unique_key": "bug"
},
"closed": false,
"contact": {
"email": "[email protected]",
"first_name": "John", "last_name":
"Smith", "middle_name":
"",
"system_id": "[email protected]",
"uri": "http://localhost:8080/wpm/api/contacts/[email protected]"
},
"created_on": "15/10/13 14:27:54",
"creator": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
PUT /cases/Task-sp-9/actions/my_change_project_action
Request body:
{
"project_system_id": "ap",
"custom_fields": [
{
"system_id": "effort_left",
"value": "1"
},
{
"system_id": "duration",
"value": "15"
}
]
}
Response body:
{
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
{
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
}
],
"case_key": "Task-ap-1",
"case_type": {
"name": "Task",
"system_id": "task",
"unique_key": "task"
},
"closed": false,
"created_on": "10/10/13 16:02:37",
"creator": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
Case “Task-sp-2” is in status “Awaiting Clarification”. Approve action sends case to “Task
Complete” status.
PUT /cases/Task-sp-2/actions/my_approve_action
Request body:
{
"custom_fields": [
{
"system_id": "effort_left",
"value": "0"
},
{
"system_id": "duration",
"value": "15"
}
]
}
Response body:
{
"account": {
"name": "Some Company Account",
"system_id": "some_company_account",
"uri": "http://localhost:8080/wpm/api/accounts/some_company_account"
},
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
}
],
"case_key": "Task-sp-2",
"case_type": {
"name": "Task",
"system_id": "task",
"unique_key": "task"
},
"closed": false,
"contact": {
"email": "[email protected]",
"first_name": "John", "last_name":
"Smith", "middle_name":
"",
"system_id": "[email protected]",
"uri": "http://localhost:8080/wpm/api/contacts/[email protected]"
},
"created_on": "09/10/13 14:36:44",
"creator": {
12) Reject
Case “Task-sp-2” is in status “Awaiting Clarification”. Reject action sends case to “Described”
status.
PUT /cases/Task-sp-2/actions/my_reject_action
Request body:
{
"custom_fields": [
{
"system_id": "effort_left",
"value": "5"
},
{
"system_id": "duration",
"value": "15"
}
]
}
Response body:
{
"account": {
"name": "Some Company Account",
"system_id": "some_company_account",
"uri": "http://localhost:8080/wpm/api/accounts/some_company_account"
},
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
}
],
"case_key": "Task-sp-2",
"case_type": {
"name": "Task",
"system_id": "task",
Scripting action with system id “my_scripting_action” has Workflow script attached to itself. The
sctipt is written in Groovy and changes case name to specific text.
Script code:
PUT /cases/Task-sp-2/actions/my_scripting_action
Request body
{
"custom_fields": [
{
"system_id": "effort_left",
"value": "4"
},
{
"system_id": "duration",
"value": "15"
}
]
}
{
"account": {
"name": "Some Company Account",
"system_id": "some_company_account",
"uri": "http://localhost:8080/wpm/api/accounts/some_company_account"
},
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
}
],
"case_key": "Task-sp-2",
"case_type": {
"name": "Task",
"system_id": "task",
"unique_key": "task"
},
"closed": false,
"contact": {
"email": "[email protected]",
"first_name": "John", "last_name":
"Smith", "middle_name":
"",
"system_id": "[email protected]",
"uri": "http://localhost:8080/wpm/api/contacts/[email protected]"
},
"created_on": "09/10/13 14:36:44",
"creator": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
},
"custom_fields": [
{
"name": "Effort Left",
"system_id": "effort_left",
"type_name": "Number",
"type_system_id": 2,
"value": "4",
"value_formatted": "4"
},
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "15",
"value_formatted": "15"
}
Supported actions:
1. Assign
2. Add Comment
3. Change Status
4. Close Case
5. Edit Case
6. Delete Case
7. Reopen Case
8. Copy Case
9. Change Case Type
10. Change Project
11. Approve
12. Reject
13. Scripting Action
Note: All REST API calls for executing actions will be made by John Smith (jsmith). Case updater
after executing actions will be user with system_id “user_system_id”.
Assign Action example:
PUT /cases/Task-sp-2/actions/my_assign_action/tsmith
Request body:
{
"comment": "Execute assign action via REST API",
"comment_is_internal": true,
"assignees": [
{
"system_id": "jsmith"
},
{
"system_id": "tsmith"
}
],
"custom_fields": [
{
"system_id": "effort_left",
"value": "6"
},
{
"system_id": "duration",
"value": "15"
}
]
}
Response body:
{
"account": {
"name": "Some Company Account",
"system_id": "some_company_account",
"uri": "http://localhost:8080/wpm/api/accounts/some_company_account"
},
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
{
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
<html>
<head>
</head>
<body>
<form action="http://localhost:8080/wpm/api/cases/Task-sp-2/actions/my_attach_file_action"
enctype="multipart/form-data" method="post">
Visibility:
<input type="radio" value="false" name="internal">Public
<input type="radio" value="true" name="internal">Internal
<br />
Comment: <input type="text" name="comment">
<br />
<INPUT type="submit" value="Upload"> <INPUT type="reset">
</form>
</body>
</html>
PUT /cases/Task-sp-2/actions/my_assign_action
Response body:
{
"account": {
"name": "Some Company Account",
"system_id": "some_company_account",
"uri": "http://localhost:8080/wpm/api/accounts/some_company_account"
},
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
{
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
}
],
"case_key": "Task-sp-2",
"case_type": {
"name": "Task",
"system_id": "task",
"unique_key": "task"
},
"closed": false,
"contact": {
"email": "[email protected]",
"first_name": "John", "last_name":
"Smith", "middle_name":
"",
"system_id": "[email protected]",
"uri": "http://localhost:8080/wpm/api/contacts/[email protected]"
},
"created_on": "10/09/2013 14:36:44",
3. POST /cases/{system_id}/actions/{action_system_id}/{user_system_id}
<html>
<head>
</head>
<body>
<form action="http://localhost:8080/wpm/api/cases/Task-sp-2/actions/my_attach_file_action/tsmith"
enctype="multipart/form-data" method="post">
Visibility:
<input type="radio" value="false" name="internal">Public
<input type="radio" value="true" name="internal">Internal
Request example:
John Smith is executing REST API call and uploading attachment using Attach File Action. Tom
Smithis supposed to be set as action executor.
PUT /cases/Task-sp-2/actions/my_assign_action/tsmith
Response body:
{
"account": {
"name": "Some Company Account",
"system_id": "some_company_account",
"uri": "http://localhost:8080/wpm/api/accounts/some_company_account"
},
"assignees": [
{
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
{
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Partner",
"system_id": "partner"
}
}
],
"case_key": "Task-sp-2",
"case_type": {
"name": "Task",
"system_id": "task",
"unique_key": "task"
},
"closed": false,
GET /case_types/{system_id}
JSON example:
a) GET /case_types/task
Response body:
{
"name": "Task",
"system_id": "task",
"unique_key": "task"
}
{
"case_types": [
{
"name": "Task",
"system_id": "task",
"unique_key": "task"
}
],
"completed_in": 35,
"page": 1,
"page_size": 10,
"total": 1
}
JSON example:
GET /case_types/task/statuses
Response body:
[
{
"name": "Described",
"system_id": "described"
},
{
"name": "In Preparation",
"system_id": "in_preparation"
},
{
"name": "Awaiting Clarification",
"system_id": "awaiting_clarification"
},
{
"name": "Task Complete",
"system_id": "task_complete"
},
{
"name": "Closed",
"system_id": "closed"
}
]
JSON example:
GET /case_types/task/statuses/awaiting_clarification/action
Response body:
[
{
"end_status": {
"name": "Awaiting Clarification",
"system_id": "awaiting_clarification"
},
"name": "Add Comment",
"start_status": {
"name": "Awaiting Clarification",
"system_id": "awaiting_clarification"
},
"system_id": "add_comment",
"type": "Add Comment"
},
{
"end_status": {
"name": "Task Complete",
"system_id": "task_complete"
},
"name": "Task Completed",
"start_status": {
"name": "Awaiting Clarification",
"system_id": "awaiting_clarification"
},
"system_id": "task_complete",
"type": "Assign"
}
]
GET /companies/{system_id}
JSON example:
a) GET /companies/my_company_inc
Response body:
{
"address_1": "Some Street 123",
"address_2": "",
"city": "San Francisco",
"country": "USA",
"name": "My Company Inc.",
"project": {
"description": "This is a project for grouping cases regarding sales.",
"is_default": false,
"name": "Sales project",
"system_id": "sp",
"uri": "http://localhost:8080/wpm/api/projects/sp"
},
"state": "California",
"system_id": "my_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/my_company_inc",
"zip": "12345"
}
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Company does not exist."
]
}
POST /companies
JSON example:
a) POST /companies
Request body:
{
"address_1": "Some Street 123",
"address_2": "",
"city": "San Francisco",
"country": "USA",
"name": "My Company Inc.",
"project_system_id": "sp",
"state": "California",
"system_id": "my_company_inc",
"zip": "12345"
}
PUT /companies
JSON example:
PUT /companies
Request body:
{
"address_1": "Some Street 456",
"address_2": "Oak Street 789",
"city": "San Francisco",
"country": "USA",
"name": "My Company Inc.",
"project_system_id": "sp",
"state": "California",
"system_id": "my_company_inc",
"zip": "12345"
}
{
"address_1": "Some Street 456",
"address_2": "Oak Street 789",
"city": "San Francisco",
"country": "USA",
"name": "My Company Inc.",
"project": {
"description": "",
"is_default": false,
"name": "Sales Project",
"system_id": "sp",
"uri": "http://localhost:8080/wpm/api/projects/sp"
},
"state": "California",
"system_id": "my_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/my_company_inc",
"zip": "12345"
}
DELETE /companies/{system_id}
JSON example:
GET /companies?name=inc&page=1&page_size=5
{
"companies": [
{
"address_1": "Some Street 123",
"address_2": "",
"city": "San Francisco",
"country": "USA",
"name": "My Company Inc.",
"project": {
"description": "This is a project for grouping cases regarding sales.",
"is_default": false,
"name": "Sales project",
"system_id": "sp",
"uri": "http://localhost:8080/wpm/api/projects/sp"
},
"state": "California",
"system_id": "my_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/my_company_inc",
"zip": "12345"
},
{
],
"completed_in": 68,
"page": 1,
"page_size": 5,
"total": 1
}
GET /contacts/{system_id}
JSON example:
a) GET /contacts/jsmith_someaddress_com
Response body:
{
"account": {
"name": "Account B",
"system_id": "account_b",
"uri": "http://localhost:8080/wpm/api/accounts/account_b"
},
"active": true,
"address": {
"address2": "Second Street 456",
"address3": "Third Street 789",
"city": "San Francisco",
"country": {
"name": "USA",
"system_id": "usa"
},
"state": {
"name": "California",
"system_id": "CA"
},
"street": "First Street 123",
"zip": "12345"
},
"cell_phone": "555-555-456",
"custom_fields": [
{
"name": "Contact Role",
b) GET /contacts/some_non_existing_contact
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Contact does not exist."
]
}
POST /contacts
a) POST /contacts
Request body:
{
"account_system_id": "account_b",
"active": true,
"cell_phone": "555-555-111",
"custom_fields": [
{
"systemId": "contact_role",
"value": "consultant"
}
],
"department": "",
"email": "[email protected]",
"first_name": "John",
"home_phone": "555-555-987",
"job_title": "Developer",
"last_name": "Smith",
"system_id": "[email protected]",
"phone": "866.612.7312"
}
Reponse body:
{
"account": {
"name": "Account B",
"system_id": "account_b",
"uri": "http://localhost:8080/wpm/api/accounts/account_b"
},
"active": true,
"cell_phone": "555-555-111",
"department": "",
"email": "[email protected]",
"first_name": "John",
"home_phone": "555-555-987",
"job_title": "Developer",
"last_name": "Smith",
"name": "John Smith",
"phone": "866.612.7312",
"system_id": "jsmith_someaddress_com",
"uri": "http://localhost:8080/wpm/api/contacts/jsmith_someaddress_com"
}
{
"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"Contact name is required."
]
}
JSON example:
PUT /contacts
Request body:
{
"account_system_id": "account_b",
"active": true,
"cell_phone": "555-555-222",
"custom_fields": [
{
"systemId": "contact_role",
"value": "consultant"
}
],
"department": "",
"email": "[email protected]",
"first_name": "John",
"home_phone": "555-555-999",
"job_title": "Developer",
"last_name": "Smith",
"system_id": "jsmith_someaddress_com",
"phone": "555-555-111"
}
{
"account": {
"name": "Account B",
"system_id": "account_b",
"uri": "http://localhost:8080/wpm/api/accounts/account_b"
},
"active": true,
"cell_phone": "555-555-222",
"department": "",
"email": "[email protected]",
"first_name": "John",
"home_phone": "555-555-999",
"job_title": "Developer",
"last_name": "Smith",
"name": "John Smith",
"phone": "555-555-111",
"system_id": "jsmith_someaddress_com",
"uri": "http://localhost:8080/wpm/api/contacts/jsmith_someaddress_com"
}
DELETE /contacts/{system_id}
JSON example:
GET /contacts?first_name=john&last_name=smith&account=accountb&page=1&page_size=5
Response body:
{
"completed_in": 134,
"contacts": [
{
"account": {
"name": "Account B",
"system_id": "account_b",
"uri": "http://localhost:8080/wpm/api/accounts/account_b"
},
"active": true,
"address": {
"address2": "Second Street 456",
"address3": "Third Street 789",
GET /contacts/{system_id}/custom_fields/{custom_field_system_id}
JSON example:
GET /contacts/jsmith_someaddress_com/custom_fields/contact_role
Response body:
{
"name": "Contact Role",
"system_id": "contact_role",
"type_name": "Checkbox",
"type_system_id": 8,
"value": "Consultant",
"value_formatted": "Consultant"
}
POST /contacts/{system_id}/custom_fields
JSON example:
POST /contacts/jsmith_someaddress_com/custom_fields
{
"system_id": "contact_role",
"value": "consultant"
}
PUT /contacts/{system_id}/custom_fields
JSON example:
PUT /contact/jsmith_someaddress_com/custom_fields
Request body:
{
"system_id": "contact_role",
"value": "business_analyst"
}
Request example:
DELETE /contacts/jsmith_someaddress_com/custom_fields/contact_role
GET /custom_fields/{system_id}
JSON example:
a) GET /custom_fields/product_category
Response body:
{
"label": "Product Category",
"name": "Product Category",
"predefined_values": [
{
"disabled": false,
"label": "First Category",
"position": 0,
"preselected": false,
"system_id": "first"
},
{
"disabled": false,
"label": "Second Category",
"position": 1,
"preselected": false,
"system_id": "second"
},
{
"disabled": false,
"label": "Third Category",
"position": 2,
"preselected": false,
"system_id": "third"
}
],
b) GET /custom_fields/some_non_existing_custom_field
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Custom field does not exist."
]
}
POST /custom_fields
JSON example:
a) POST /custom_fields
Request body:
{
"label": "Product Category",
"name": "Product Category",
"system_id": "product_category",
"type_system_id": 8,
"predefined_values": [
{
"disabled": false,
"label": "First Category",
"position": 0,
"preselected": false,
"system_id": "first"
},
Response body:
{
"label": "Product Category",
"name": "Product Category",
"predefined_values": [
{
"disabled": false,
"label": "First Category",
"position": 0,
"preselected": false,
"system_id": "first"
},
{
"disabled": false,
"label": "Second Category",
"position": 1,
"preselected": false,
"system_id": "second"
},
{
"disabled": false,
"label": "Third Category",
"position": 2,
"preselected": false,
"system_id": "third"
}
],
"system_id": "product_category",
"type_name": "Checkbox",
"type_system_id": 8,
"uri": "http://localhost:8080/wpm/api/custom_fields/product_category"
}
{
"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"CustomField label is required.",
"CustomField field type is required.",
"CustomField system id is required.",
"CustomField name is required."
]
}
JSON example: CustomFieldBean’s “system_id” field must be set. Predefined value’s system_id
must be set.
PUT /custom_fields
Request body:
{
"label": "Product Category",
"name": "Product Category",
"system_id": "product_category",
"predefined_values": [
{
"disabled": false,
"label": "First Category",
"position": 0,
"preselected": true,
"system_id": "first"
},
{
"disabled": true,
"label": "Second Category",
"position": 1,
"preselected": false,
"system_id": "second"
},
{
"disabled": false,
"label": "Third Category",
"position": 2,
"preselected": false,
"system_id": "third"
}
]
Response body:
{
"label": "Product Category",
"name": "Product Category",
"predefined_values": [
{
"disabled": false,
"label": "First Category",
"position": 0,
"preselected": true,
"system_id": "first"
},
{
"disabled": true,
"label": "Second Category",
"position": 1,
"preselected": false,
"system_id": "second"
},
{
"disabled": false,
"label": "Third Category",
"position": 2,
"preselected": false,
"system_id": "third"
}
],
"system_id": "product_category",
"type_name": "Checkbox",
"type_system_id": 8,
"uri": "http://localhost:8080/wpm/api/custom_fields/product_category"
}
DELETE /custom_fields/{system_id}
JSON example:
GET /custom_fields?name=product&page=1&page_size=5
Response body:
{
"completed_in": 20,
"custom_fields": [
{
"label": "Product Category",
"name": "Product Category",
"predefined_values": [
{
"disabled": false,
"label": "First Category",
"position": 0,
"preselected": false,
"system_id": "first"
},
{
"disabled": false,
"label": "Second Category",
"position": 1,
"preselected": false,
"system_id": "second"
GET /custom_tables/{system_id}
JSON example:
a) GET /custom_tables/territory
Response body:
{
"columns": [
"OID",
"NAME",
"NUMBER_OF_STORES"
],
"name": "Territory",
"system_id": "territory",
"uri": "http://localhost:8080/wpm/api/custom_tables/territory"
}
b) GET /custom_tables/some_non_existing_custom_table
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Custom Table does not exist."
]
}
JSON example:
a) POST /custom_tables
Request body:
{
"name": "Territory",
"system_id": "territory",
"columns": [
"name",
"number_of_stores"
]
}
Response body:
{
"columns": [
"OID",
"NAME",
"NUMBER_OF_STORES"
],
"name": "Territory",
"system_id": "territory",
"uri": "http://localhost:8080/wpm/api/custom_tables/territory"
}
{
"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"CustomTable name is required."
]
}
DELETE /custom_tables/{system_id}
JSON example:
GET /custom_tables?name=territory&page=1&page_size=5
{
"completed_in": 98,
"custom_tables": [
{
"columns": [
"OID",
"NAME",
"NUMBER_OF_STORES"
],
"name": "Territory",
"system_id": "territory",
"uri": "http://localhost:8080/wpm/api/custom_tables/territory"
}
],
"page": 1,
"page_size": 5,
"total": 1
}
JSON example:
POST /custom_tables/territory/column/location
Response body:
{
"columns": [
"OID",
"NAME",
"NUMBER_OF_STORES",
"LOCATION"
],
"name": "Territory",
"system_id": "territory",
"uri": "http://localhost:8080/wpm/api/custom_tables/territory"
}
JSON example:
a) GET/custom_tables/territory/rows
Response body:
{
"completed_in": 249,
"custom_table": {
"rows": [
{
"cells": [
{
"name": "OID",
"value": "1"
},
{
"name": "NAME",
"value": "USA"
},
{
"name": "NUMBER_OF_STORES",
"value": "60"
GET /custom_tables/{system_id}/rows/{oid}
Response body:
{
"rows": [
{
"cells": [
{
"name": "OID",
"value": "2"
},
{
"name": "NAME",
"value": "Europe 1"
},
{
"name": "NUMBER_OF_STORES",
"value": "20"
},
{
"name": "LOCATION",
"value": "Western Europe"
}
],
"oid": "2"
}
]
}
POST /custom_tables/{system_id}/rows
Request body:
{
"rows": [
{
"cells": [
{
"name": "name",
"value": "Africa"
},
{
"name": "NUMBER_OF_STORES",
"value": "25"
},
{
"name": "LOCATION",
"value": "Africa"
}
]
}
]
}
Response body:
{
"rows": [
{
"cells": [
{
"name": "OID",
"value": "3"
},
{
"name": "NAME",
"value": "Africa"
},
{
"name": "NUMBER_OF_STORES",
"value": "25"
},
{
"name": "LOCATION",
"value": "South Africa"
}
],
"oid": "3"
}
]
}
JSON example:
PUT /custom_tables/territory/rows
Request body:
{
"rows": [
{
"cells": [
{
"name": "OID",
"value": "3"
},
{
"name": "NAME",
"value": "Africa"
},
{
"name": "NUMBER_OF_STORES",
"value": "25"
},
{
"name": "LOCATION",
"value": "South Africa"
}
]
}
]
}
{
"rows": [
{
"cells": [
{
"name": "OID",
"value": "3"
},
{
"name": "NAME",
"value": "Africa"
},
{
"name": "NUMBER_OF_STORES",
"value": "25"
},
{
"name": "LOCATION",
"value": "South Africa"
}
],
"oid": "3"
}
]
}
DELETE /custom_tables/{system_id}/rows/{oid}
Example table:
JSON example:
a) PUT /custom_tables/query/select?page=1&page_size=5
Request body:
{
"query": "select oid,name,number_of_stores from territory where number_of_stores > 25 and number_of_stores < 40"
}
{
"completed_in": 2144,
"custom_table": {
"rows": [
{
"cells": [
{
"name": "OID",
"value": "3"
},
{
"name": "NAME",
"value": "USA"
},
{
"name": "NUMBER_OF_STORES",
"value": "26"
}
],
"oid": "3"
}
]
},
"page": 1,
"page_size": 10,
"total": 1
}
POST /custom_tables/query/insert
JSON example:
a) POST/custom_tables/query/insert
Request body:
{
"query": "insert into territory (name, number_of_stores, location) values ('Europe 2', '15', 'South Europe')"
}
Response body:
{
"completed_in": 52,
"oid": 5
}
Example table:
JSON example:
a) PUT/custom_tables/query/update
Request body:
{
"query": "update territory set name = 'Europe 1' where name = 'Europe'"
}
Response body:
{
"affected_rows_count": 1,
"completed_in": 62
}
PUT /custom_tables/query/delete
Example table:
JSON example:
a) PUT /custom_tables/query/delete
{
"query": "delete from territory where name like '%Europe%'"
}
Response body:
{
"affected_rows_count": 2,
"completed_in": 56
}
POST /custom_tables/import/new_table
name,number_of_stores,location
Europe, 10, Southern Europe
USA, 25, West Coast
Africa, 5, West Africa
POST /custom_tables/import/new_table
Response body:
{
"columns": [
"OID",
"NAME",
"NUMBER_OF_STORES",
"LOCATION"
],
"import_report": "Finished importing custom table territory. Imported (3) rows.",
"name": "territory",
"system_id": "territory",
"uri": "http://localhost:8080/wpm/api/custom_tables/territory"
}
POST /custom_tables/{system_id}/import/new_rows
oid,name,number_of_stores,location
1, Europe 1, 12, Southern Europe
3, Africa, 5, West Africa
,Europe 2, 15, East Europe
,Australia, 12, Australia and New Zealand
POST /custom_tables/{system_id}/import/new_rows
Response body:
{
"columns": [
"OID",
"NAME",
"NUMBER_OF_STORES",
"LOCATION"
],
"import_report": "Finished updating custom table territory. Updated (5) rows.",
"name": "territory",
"system_id": "territory",
"uri": "http://localhost:8080/wpm/api/custom_tables/territory"
}
PUT /custom_tables/export/query_to_csv
JSON example:
PUT /custom_tables/export/query_to_csv
Request headers:
domain: default
Authorization: Basic bWFya29tOjkyckw2M0paRDZXUno2QTEwMDBx
Accept: application/octet-stream
Content-Type: application/json
Request body:
{
"query": "SELECT NAME,NUMBER_OF_STORES,LOCATION from myStores where CAST(NUMBER_OF_STORES AS INT) > 25",
"file_name": "big_market.csv
}
NAME,NUMBER_OF_STORES,LOCATION
USA,26,West Coast
Europe,42,Western Europe
Response headers:
GET /departments/{system_id}
JSON example:
a) GET /departments/accounting
Response body:
{
"company": {
"name": "My Company Inc.",
"system_id": "my_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/accounting "
},
"gate_keeper": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Accountant",
"system_id": "accountant"
}
},
"name": "Accounting",
"system_id": "accounting",
"uri": "http://localhost:8080/wpm/api/departments/accounting"
}
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Department does not exist."
]
}
POST /departments
JSON example:
a) POST /departments
Request body:
{
"company_system_id": "my_company_inc",
"gate_keeper_system_id": "jsmith",
"name": "Accounting",
"system_id": "accounting"
}
{
"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"Department name is required."
]
}
JSON example:
PUT /departments
Request body:
{
"company_system_id": "my_company_inc",
"gate_keeper_system_id": "tsmith",
"name": "Accounting Dep",
"system_id": "accounting"
}
Response body:
{
"company": {
"name": "My Company Inc.",
"system_id": "my_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/my_company_inc"
},
"gate_keeper": {
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
DELETE /departments/{system_id}
GET /departments
JSON example:
GET /departments?name=accounting&page=1&page_size=5
{
"completed_in": 89,
"departments": [
{
"company": {
"name": "My Company Inc.",
"system_id": "my_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/my_company_inc"
},
"gate_keeper": {
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith2",
"system_id": "jsmith2",
"uri": "http://localhost:8080/wpm/api/users/jsmith2",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"name": "Accounting",
"system_id": "accounting",
"uri": "http://localhost:8080/wpm/api/departments/accounting"
},
{
"company": {
"name": "Other Company, Inc.",
"system_id": "other_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/other_company_inc"
},
"name": "Other Company Accounting",
"system_id": "other_company_accounting",
"uri": "http://localhost:8080/wpm/api/departments/other_company_accounting"
}
],
"page": 1,
"page_size": 5,
"total": 2
}
GET /messages/{system_id}
JSON example:
a) GET /messages/157
Response body:
{
"body": "Hello Jonh, We can start the implementation phase on this project. Regards, Tom.",
"date": "10/07/2013 10:52:36",
"from_address": "[email protected]",
"subject": "Next project phase",
"system_id": "157",
"uri": "http://localhost:8080/wpm/api/messages/157"
}
b) GET /messages/123121436547848
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Message does not exist."
]
}
GET /messages/user/{system_id}/unread
JSON example:
a) GET /messages/user/jsmith/unread
Response body:
{
"completed_in": 55,
"messages": [
{
"date": "10/07/2013 10:04:28",
"from_address": "[email protected]",
"subject": "Next project phase",
"system_id": "157",
"uri": "http://localhost:8080/wpm/api/messages/157"
},
{
"date": "11/07/2013 11:15:45",
"from_address": "[email protected]",
"subject": "Available resources for project",
"system_id": "158",
"uri": "http://localhost:8080/wpm/api/messages/158"
}
],
"page": 1,
"page_size": 5,
"total": 2
}
1. GET /messages/user/{system_id}/unread_and_mark_as_read
JSON example:
a) GET /messages/user/jsmith/unread_and_mark_as_read
Response body:
{
"completed_in": 55,
"messages": [
{
"date": "10/07/2013 10:04:28",
"from_address": "[email protected]",
"subject": "Next project phase",
"system_id": "157",
"uri": "http://localhost:8080/wpm/api/messages/157"
},
{
"date": "11/07/2013 11:15:45",
"from_address": "[email protected]",
"subject": "Available resources for project",
"system_id": "158",
"uri": "http://localhost:8080/wpm/api/messages/158"
}
],
"page": 1,
"page_size": 5,
"total": 2
}
GET /messages/user/{system_id}/total_unread
JSON example:
a) GET /messages/user/jsmith/total_unread
Response body:
{
"total": 2
}
GET /projects/{system_id}
JSON example:
a) GET /projects/abc
Response body:
b) GET /projects/some_non_existing_project
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Project does not exist."
]
}
POST /projects
JSON example:
a) POST /projects
Request body:
{
"description": "This is a project for grouping cases regarding sales.",
"is_default": false,
"name": "Sales project",
"custom_fields": [
{
"system_id": "due_date",
"value": "10/15/14"
}
],
"permissions": [
{
"system_id": "sales"
}
{
"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"Project name is required."
]
}
PUT /projects
JSON example:
PUT /projects
{
"description": "This is a project for grouping cases regarding sales. - UPDATED DESCRIPTION.",
"is_default": false,
"name": "Sales project",
"custom_fields": [
{
"system_id": "due_date",
"value": "11/17/14"
}
],
"permissions": [
{
"system_id": "sales"
}
],
"project_roles": [
{
"system_id": "project_leader",
"user_system_id": "jsmith"
}
],
"system_id": "sp"
}
Response body:
{
"custom_fields": [
{
"name": "Due Date",
"system_id": "due_date",
"type_name": "Date",
"type_system_id": 3,
"value": "11/17/14",
"value_formatted": "17/11/14"
}
],
"description": "This is a project for grouping cases regarding sales. - UPDATED DESCRIPTION.",
"is_default": false,
"name": "Sales project",
"permissions": [
{
"name": "Sales",
"system_id": "sales"
}
],
"project_roles": [
{
"name": "Project Leader",
"system_id": "project_leader",
"user_system_id": "jsmith"
}
],
"system_id": "sp",
"uri": "http://localhost:8080/wpm/api/projects/sp"
}
GET /projects
JSON example:
Response body:
{
"completed_in": 118,
"page": 1,
"page_size": 10,
"projects": [
{
"description": "This is a project for grouping cases regarding sales.",
"is_default": false,
"name": "Sales project",
"permissions": [
{
"name": "Sales",
"system_id": "sales"
}
],
"project_roles": [
{
"name": "Project Leader",
"system_id": "project_leader",
"user_system_id": "jsmith"
}
],
"system_id": "sp",
"uri": "http://localhost:8080/wpm/api/projects/sp"
}
],
"total": 1
}
JSON example:
GET /projects/sp/custom_fields/due_date
Response body:
{
"name": "Due Date",
"system_id": "due_date",
"type_name": "Date",
"type_system_id": 3,
"value": "10/15/14",
"value_formatted": "15/10/14"
}
JSON example:
POST /projects/sp/custom_fields
Request body:
{
"system_id": "due_date",
"value": "10/25/14"
}
JSON example:
PUT /projects/sp/custom_fields
Request body:
{
"system_id": "due_date",
"value": "12/26/15"
}
GET / permission_groups
JSON example:
GET /permission_groups?name=sales&page=1
Response body:
{
"page": 1,
"page_size": 10,
"total": 1,
"completed_in": 29,
"permissions": [
{
"name": "sales",
"system_id":”sales",
"description": "sales description "
}
JSON example:
JSON example:
a) GET /permission_groups/partners Response body: { 2 "name": "partners", 3 "system_id": "partners", 4 "description": "partners description " 5 }
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [ "Permission Group does not exist."
]
}
GET / permission_groups/{permission_group_system_id}/users
JSON example:
a) GET /permission_groups/partners/users
Response body:
{
"page": 1,
"page_size": 10,
"total": 1,
"completed_in": 53,
"users": [
{
"login_name": "customer",
"first_name": "Carlo",
"last_name": "Customer",
"user_type": {
"name": "Customer",
"system_id": "customer"
},
"system_id": "customer",
"uri": "http://localhost:8080/wpm/api/users/customer"
}
]
}
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [ "Permission Group does not exist."
]
}
PUT /permission_groups/{system_id}/users
JSON example:
a) PUT /permission_groups/permGroup1/users
Request body:
Response Body
{
"name": “permGroup1”
"system_id": “permGroup1”
"description": "description of this permission"
}
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [ "Permission permGroup1 not updated. Please add valid
system Ids for users”
]
}
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [ "Permission group does not exist.”
]
}
Example:
PUT: permission_groups/permGroup1/users/user1
Example:
PUT: permission_groups/permGroup1/departments/department1
Example:
PUT: permission_groups/permGroup1/users_types/userType1
Note: UserBean’s system_id attribute has the same value as login_name. We use system_id to
find the user. If there is a need to update user’s login name via REST call then system_id has
the value of old login name (in order to find the user) and login_name field has the value of new
loginname.
GET /users/{system_id}
JSON example:
a) GET /users/jsmith
Response body:
{
"active": true,
"administrator": true,
"custom_fields": [
{
"name": "Yahoo ID",
"system_id": "yahoo_id",
"type_name": "Text",
"type_system_id": 1,
"value": "someYahooId123",
"value_formatted": "someYahooId123"
}
],
"department": { "name":
"Sales", "system_id":
"sales",
"uri": "http://localhost:8080/wpm/api/departments/sales"
},
b) GET /users/some_non_existing_user
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"User does not exist."
]
}
POST /users
JSON example:
a) POST /users
Request body:
{
"active": true,
"administrator": true,
"custom_fields": [
{
"system_id": "yahoo_id",
"value": "someYahooId123"
Response body:
{
"active": true,
"administrator": true,
"custom_fields": [
{
"name": "Yahoo ID",
"system_id": "yahoo_id",
"type_name": "Text",
"type_system_id": 1,
"value": "someYahooId123",
"value_formatted": "someYahooId123"
}
],
"department": { "name":
"Sales", "system_id":
"sales",
"uri": "http://localhost:8080/wpm/api/departments/sales"
},
"email": "[email protected]",
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing",
"uri": "http://localhost:8080/wpm/api/userTypes/sales_and_marketing"
}
}
{
"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"User login name is required.",
"User department is required.",
"User user type is required.",
"User last name is required.",
"User first name is required.",
"User email is required."
]
}
JSON example:
PUT /users
Request body:
{
"active": true,
"administrator": false,
"custom_fields": [
{
"system_id": "yahoo_id",
"value": "someYahooId456"
}
],
"department_system_id": "sales",
"email": "[email protected]",
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"password": "somePassword123123",
"user_type_system_id": "sales_and_marketing"
}
{
"active": true,
"administrator": false,
"custom_fields": [
{
"name": "Yahoo ID",
"system_id": "yahoo_id",
"type_name": "Text",
"type_system_id": 1,
"value": "someYahooId456",
"value_formatted": "someYahooId456"
}
],
"department": { "name":
"Sales", "system_id":
"sales",
"uri": "http://localhost:8080/wpm/api/departments/sales"
},
"email": "[email protected]",
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing",
"uri": "http://localhost:8080/wpm/api/userTypes/sales_and_marketing"
}
}
DELETE /users/{system_id}
page (Number)
page_size (Number)
mask (String)
name (String)
first_name (String)
last_name (String)
department (String) (department name)
user_type (String) (user type name)
email (String)
login_name (String)
system_id (String)
JSON example:
GET /users?first_name=john&user_type=sales&department=sales&last_name=smith&page=1&page_size=5
{
"completed_in": 122,
"page": 1,
"page_size": 5,
"total": 1,
"users": [
{
"active": true,
"administrator": true,
"custom_fields": [
{
POST /users/create_bulk
Request body:
[{
"active": true,
"administrator": true,
"custom_fields": [{
"system_id": "yahoo_id",
"value": "someYahooId123"
}],
"department_system_id": "sales",
"email": "[email protected]",
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"password": "somePassword567",
"user_type_system_id": "sales_and_marketing"
},
{
"active": true,
"administrator": true,
"custom_fields": [{
"system_id": "yahoo_id",
"value": "someYahooId123"
}],
"department_system_id": "sales",
"email": "[email protected]",
"first_name": "John",
"last_name": "Smith",
"login_name": "jsmith",
"password": "somePassword567",
"user_type_system_id": "sales_and_marketing"
}]
Response body:
{
"errors": [
{
"error_code": "USER_EXCEPTION",
"error_messages": [
"User name already defined.",
"Email name already defined."
],
"failed_index": 2
}
],
"processed_entities": [
{
"login_name": "jsmithm",
"password": "somePassword567",
"first_name": "John",
"last_name": "Smith",
"email": "[email protected]",
"department": {
"name": "Sales",
"system_id": "sales",
"uri": "http://localhost:8080/wpm/api/departments/sales"
},
"administrator": true,
"active": true,
"system_id": "jsmithm",
"uri": "http://localhost:8080/wpm/api/users/jsmithm"
}
]
"errors": [
{
"error_code": "USER_EXCEPTION",
"error_messages": [
"User name is required."
"email is required."
],
"failed_index": 1
}
]
}
PUT /users/update_bulk
Response body:
{
"errors": [
{
"error_code": "USER_EXCEPTION",
"error_messages": [
"User with this system_id: jsmithg doesnt exist.",
"Email name already defined."
],
"failed_index": 2
}
],
"processed_entities": [
{
"login_name": "jsmith",
"first_name": "Ivan",
"last_name": "Smith",
"email": "[email protected]",
"department": {
"name": "Sales",
"system_id": "sales",
"uri": "http://localhost:8080/wpm/api/departments/sales"
},
"administrator": false,
"active": true,
"system_id": "jsmith",
"uri": "http://localhost:8080/wpm/api/users/jsmith"
}
]
}
Typically, for user sync between Commissions – Workflow the following methods are used:
The create_bulk is used just for user creation, just new users (users whose loginName doesn’t exist in the
system) are being processed/created. If request body contains loginName of users that already existed in
the system – those users are skipped and are not processed in this API call.
system_id's of users that already exist should be used in the second method "update_bulk". In this method
only users that already exist in the system are being processed/updated. If the request body contains
system_id's of the users that don't exist, those users will be skipped and are not processed within this API
call.
A common disadvantage of the above-mentioned methods is that before using the API, you must be aware
of the IDs that are used for creation/modification. To address this problem and to leverage the behavior of
both the methods, the "upsert_bulk" method can be used. This method is a combination of create_bulk
and update_bulk, with some modifications.
Note:
• loginName – is used for logging in to the Workflow application.
• system_id – is used to find the user. It is a unique ID for the user in the system.
In most cases, userBean's system_id attribute has the same value as login_name, but there are some
© 2021 SAP, Inc. All Rights Reserved.
exceptions.
Note: If there is a need to update user's login name via REST call, then provide the system_id (in order
to find the user) and the 'new_system_id' field which has the value of new login name (so loginName
and systemId will be changed with the new value from 'new_system_id').
Request body:
[
{
"active": true,
"administrator": true,
"email": "[email protected]",
"first_name": "nesto",
"last_name": "nesto",
"system_id": "newUser",
"password": "somePassword567"
Request body
"active": true,
"administrator": true,
"email": "[email protected]",
"first_name": "nesto",
"last_name": "nesto",
"system_id": "newUser",
"password": "somePassword567"
Response:
Updates user by its system_id: newUser
Providing that login_name remains the same as created => [ login_name: newUser ]
"active": true,
"administrator": true,
"email": "[email protected]",
"first_name": "nesto",
"last_name": "nesto",
"system_id": "newUser",
"new_system_id": "updateSystemId",
© 2021 SAP, Inc. All Rights Reserved.
"password": "somePassword567"
}
Response:
System_id is updated by new field: “new_system_id”.
Existing user with system_id: newUser is updated with new value from “new_system_id”: updateSystemId. Login
name is updated as well.
Request:
"active": true,
"administrator": true,
"email": "[email protected]",
"first_name": "john",
"last_name": "smith",
"system_id": "",
"password": "somePassword567"
}
Response:
"errors": [
"error_code": "USER_EXCEPTION",
"error_messages": [
"System_id is required."
],
"failed_index": 1
},
Request:
"active": true,
"administrator": true,
"email": "[email protected]",
"first_name": "john",
"last_name": "smith",
"system_id": "newUser1",
"password": "somePassword567"
},
"active": true,
"administrator": true,
"email": "[email protected]",
"first_name": "upd",
"last_name": "upd",
"system_id": "newUser1",
"password": "somePassword567"
Response:
First defined will be created and for second will get the message”: "User with this system_id: newUser1 cannot be
created since is already added to the queue."
"error_messages": [
],
"failed_index": 2
],
"processed_entities": [
"login_name": "newUser1",
"password": "somePassword567",
"first_name": "john",
"last_name": "smith",
"email": "[email protected]",
"administrator": true,
"active": true,
"system_id": "newuser1",
"uri": "http://localhost:8082/wpm/api/users/newuser1"
Try to create new user by providing existing loginName (can be checked by calling GET users api method:
/wpm/api/users/{loginName}
Example:
Request:
"active": true,
"administrator": true,
"email": "[email protected]",
"first_name": "john",
"last_name": "smith",
"system_id": "test",
"password": "somePassword567"
},
Response:
"errors": [
"error_code": "USER_EXCEPTION",
"error_messages": [
],
"failed_index": 1
],
Request:
"active": true,
"administrator": true,
"email": "[email protected]",
"first_name": "john",
"last_name": "smith",
"system_id": "createMe",
"new_system_id":"createme2",
"password": "somePassword567"
"errors": [],
"processed_entities": [
"login_name": "createMe",
"password": "somePassword567",
"first_name": "john",
"last_name": "smith",
"email": "[email protected]",
"administrator": true,
"active": true,
"system_id": "createme",
"uri": "http://localhost:8082/wpm/api/users/createme"
Request:
[
"active": true,
"administrator": true,
"email": "[email protected]",
"system_id": "hola",
"password": "123"
Response:
"errors": [
"error_code": "USER_EXCEPTION",
"error_messages": [
],
"failed_index": 1
],
"processed_entities": []
JSON example:
GET /users/jsmith/custom_fields/yahoo_id
Response body:
{
"name": "Yahoo ID",
"system_id": "yahoo_id",
"type_name": "Text",
"type_system_id": 1,
"value":
"someYahooId123",
} "value_formatted":
JSON example:
POST /users/jsmith/custom_fields
Request body:
{
"system_id": "yahoo_id",
"value": "someYahooId123"
}
JSON example:
PUT /users/jsmith/custom_fields
Request body:
{
"system_id": "yahoo_id",
"value": "someOtherId456"
}
GET /user_types/{system_id}
JSON example:
a) GET /user_types/jsmith
Response body:
{
"name": "Business Analyst",
"system_id": "business_analyst",
"uri": "http://localhost:8080/wpm/api/userTypes/business_analyst"
}
b) GET /user_types/some_non_existing_user_type
{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"User type does not exist."
]
}
JSON example:
a) POST /user_types
Request body:
{
"name": "Business Analyst",
"system_id": "business_analyst"
}
Response body:
{
"name": "Business Analyst",
"system_id": "business_analyst",
"uri": "http://localhost:8080/wpm/api/user_types/business_analyst"
}
{
"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"UserType name is required”
]
}
JSON example:
{
"name": "Business Analyst User Type",
"system_id": "business_analyst"
}
Response body:
{
"name": "Business Analyst User Type",
"system_id": "business_analyst",
"uri": "http://localhost:8080/wpm/api/user_types/business_analyst"
}
JSON example:
GET /user_types?name=business&page=1&page_size=5
{
"completed_in": 87,
"page": 1,
"page_size": 10,
"total": 1,
"user_types": [
{
"name": "Business Analyst",
"system_id": "business_analyst",
"uri": "http://localhost:8080/wpm/api/user_types/business_analyst"
}
]
}
This appendix show the list of countries with their system ids:
Country System ID
Albania albania
Algeria algeria
Andorra andorra
Angola angola
Anguilla anguilla
Argentina argentina
Armenia armenia
Aruba aruba
Australia australia
Austria austria
Azerbaijan azerbaijan
Bahamas bahamas
Bangladesh bangladesh
Barbados barbados
Belarus belarus
Belgium belgium
Benin benin
Bermuda bermuda
Bhutan bhutan
Bolivia bolivia
Botswana botswana
Bouvet Island bouvet_island
Brazil brazil
Brunei brunei
Bulgaria bulgaria
Burkina Faso burkina_faso
Burundi burundi
Cambodia cambodia
Cameroon cameroon
Canada canada
Cayman Islands cayman_islands
Central African Republic central_african_republic
Chad chad
This appendix show the list of states with their system ids:
State System ID
Alabama AL
Alaska AK
Alberta AB
Arizona AZ
Arkansas AR
Armed Forces Americas AA
Armed Forces Other AE
Armed Forces Pacific AP
British Columbia BC
California CA
Colorado CO
Connecticut CT
Delaware DE
District of Columbia DC
Florida FL
Georgia GA
Hawaii HI
Idaho ID
Illinois IL
Indiana IN
Iowa IA
Kansas KS
Kentucky KY
Louisiana LA
Maine ME
Manitoba MB
Maryland MD
Massachusetts MA
Michigan MI
Mississippi MS
Minnesota MN
Missouri MO
Montana MT
This appendix show the list of Custom Field Types which can be created via Workflow REST API:
This appendix shows the list of error codes that can be returned via ErrorBean: