0% found this document useful (0 votes)
3 views310 pages

WorkFlow API Documentation11

The Workflow RESTful Service API allows third-party applications to interact with Workflow objects using standard HTTP methods like GET, POST, PUT, and DELETE, requiring user authentication via Basic or JWT methods. The documentation details the structure of entity beans, authentication mechanisms, and various API endpoints for managing accounts, cases, contacts, and more. It also includes examples of request and response formats, error codes, and guidelines for using the API effectively.

Uploaded by

aymenmihoub1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views310 pages

WorkFlow API Documentation11

The Workflow RESTful Service API allows third-party applications to interact with Workflow objects using standard HTTP methods like GET, POST, PUT, and DELETE, requiring user authentication via Basic or JWT methods. The documentation details the structure of entity beans, authentication mechanisms, and various API endpoints for managing accounts, cases, contacts, and more. It also includes examples of request and response formats, error codes, and guidelines for using the API effectively.

Uploaded by

aymenmihoub1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 310

Workflow RESTful API

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.

HTTP methods are used in this way:

1) GET – retrieve an entity


2) POST – create a new entity
3) PUT – update an entity
4) DELETE – delete an entity

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.

The Authorization header is constructed as follows:


1. Username and WS Token are combined together using semicolon into a
string "username:WsToken".
2. The resulting string is then encoded using Base64 encoding.
3. The authorization method and a space "Basic " is then put before the
encoded string.

Example: For user with login name “jsmith” and WSToken “0mr3ot99LYMvit77J9sf”
Authorization header will look like this:

Authorization: Basic anNtaXRoOjBtcjNvdDk5TFlNdml0NzdKOXNm

Java code example for creating Authorization header looks like this:

String userName = "jsmith";


String wsToken = "0mr3ot99LYMvit77J9sf";
String nameToken = userName + ":" + wsToken;
byte[] encodedBytes = Base64.encodeBase64(nameToken.getBytes());
String encoded = new String(encodedBytes); // anNtaXRoOjBtcjNvdDk5TFlNdml0NzdKOXNm
String headerValue = "Basic " + encoded;
String header = "Authorization: " + headerValue;
System.out.println(header); // Authorization: Basic anNtaXRoOjBtcjNvdDk5TFlNdml0NzdKOXNm

C# code is very similar and would look like this:

byte [] bytesToEncode = Encoding.UTF8.GetBytes("jsmith:0mr3ot99LYMvit77J9sf");


String encodedText = Convert.ToBase64String(bytesToEncode); // anNtaXRoOjBtcjNvdDk5TFlNdml0NzdKOXNm

2) domain header
Domain header will tell Workflow to which domain does the API call refer to. Onexample,
domain header might look like this:
domain: Workflow_api_test
If user performing API call cannot be identified 403 Forbidden status will be returned.

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.

For applications that want to use JWT with Workflow:

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):

• generate private/public key pair

• add a private key on the Commissions 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

• kid : key id (will be used in the future for key rotation)

Payload

• sub - subject (required, this is userid (systemId) which public key is used for validation
of JWT signature)

• aud - Workflow URL (required, validated against root Workflow URL)

• iss - Commissions URL (not validated)

• exp -JWT expiration timestamp in seconds (validated)

• iat - JWT creation timestamp in seconds (validated)

JWT token is generated using the following formula:

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.

Uploading Public Key for the User in Workflow

Workflow provides an automated way to utilize a service account and upload the public key
for the user.

HTTP Method PUT


Path /users/{system_id}/

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

Required headers Content-Type, domain, authorization (basic auth)


Returned headers Content-Type
Request Input
Accepts application/json
Expected request body File with size less than 20MB uploaded as form field with
name “uploaded_file”
Response - Output
Return MIME Type application/json
HTTP Status Code OK - Public key successfully set to user
400 Bad request - file not sent; file is empty; file is invalid;
public key is invalid
Body UserBean - success
ErrorBean – failure

key: uploaded_file, value: file with the public key

Note: Public key needs to be in PEM format.

Example:

-----BEGIN PUBLIC KEY-----


MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAzK+XCgs2iujEH+Xhhtxq
GJPQVVG1qOeT9YXxaRzafa5BysuHY1e6SRoIVOJo0Yu38F6tEPfyGDT0v35v5ZxO
keh5paPOILg1W6SRbbN4KMyNNariOGfMq7MwRKa+ELFLkYeOTXZz9F3d4nFOJb5j
usdlVwTn+jPCtQGvvsD4QxIJ3Yzagj5tZQr7QlrgzNbZTFyidmtAUNfsPHKhHGn6
18gAQ43T+FtVIGL9Q1mZy3ofNGq4LrZLTPdvupfcfZZ4e7RKZIGS4XuYe2PhmK4v
DUclwaL2orzMrE2P1wHe01CjAVT6Zg49RTrGO4rndPaizpCg2OYG2O787GMACHrh
Rujf0o5mOwTVvHix71hdTNoDZVOsU6Qw7BxrjqKYPOctwJacVsJhVqzhjI/qFevX
eKqPR1MQK7ua1JrY5EKr5cIbqIRoXxQRItvcRJNGAhamFNiHjXZqMY9c3GDK4pwB
9fRc0Mk7m3TFQFWEqkCSYznkcmaAhT0fU8UjMAZ30vu5KjXgH6zKqVFLgJbk0Oco
NnWQIqfsaAGGmKR1uGxy9LioruFctqRd0NiMG82xnotPF0UASxHMuhMkr9eOCCHP
01fTXRCmy7x8grrdUZPVjE5S3WU1Hryvlnj5mYDYlN9Ua/GAlWQouEZ8Dvt3mgQ6
CGslwrJpXyW0uaLLUwIsrRcCAwEAAQ==
-----END PUBLIC KEY-----
Entity Beans

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.

Complete and Simple Bean


Each entity has it’s complete and simple bean representation. Complete entity Bean is returned when
that same entity is requested and simple Bean representation is used when the entity exists as a child
entity of some other entity Bean.
On example, Contact Bean has “account” attribute and when Contact is returned it contains all
information about contact and simplified account field representation.

Example of complete AccountBean

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.

Contact is requested via GET /contacts/jsmith_someaddress_com. Contact contains simple


representation of AccountBean which only has three attribures (name, syste_id and uri).

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"
}

Setting Entity’s Child Beans


When an Entity is requested via GET method Workflow API returns complete entity with its child
entities as simple beans. When a new Entity is created via POST method or updated via PUT method,
entity’s child bean is set by sending child’s system id which is set as parents attribute.
On example, contact has “account” attribute which is used do display data about account when
certain contact is requested. On the other hand, when contact is created/updated we use
contact’s attribute “account_system_id” to set the account to contact.
The other example is CaseBean which uses “owner_system_id”, “contact_system_id”,
“project_system_id” and other similar Bean attributes to set case owner, contact, project etc.
Example for setting account while creating a new contact:

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:

- total: number of entities that satisfy search criteria


- page_size: number of entities which are going to returned in the search result.
Maximum number of entities returned in one search request can be up to 100. If
“page_size” attribute is not set than “page_size” is set to default value of 10 entities.
- page: It represents page number which is going to be returned in the result bean. It is
used for pagination in combination with page_size.

On example, if case search GET /cases?assignee=John&page=1&page_size=10 finds more than 50 cases,


attritubes page=1 and page_size=10 will tell Workflow API to return first ten cases. If there is a need for
next 10 cases, second page (page=2) would be requested and the request would look like this: GET
/cases?assignee=John&page=2&page_size=10.

JSON example of department search:

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"
},

© 2023 SAP, Inc. All Rights Reserved.


"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
}

Limiting attributes returned in search


Search response contains a list of complete Bean objects. If there is a need to return a
limited number of attributes then these attribute names are supposed to be send as query
parameter with name “mask”. This parameter has the value of attribute names separated
by space and it will tell Workflow API which attributes should it include inside the response.

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:

GET /cases?assignee=jsmith tsmith&owner=tsmith&mask=case_key name assignees status&page=1&page_size=5

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": [
{

© 2023 SAP, Inc. All Rights Reserved.


"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-7",
"name": "Case 2",
"status": {
"name": "Described",
"system_id": "described"
}
}
],
"completed_in": 397,
"page": 1,
"page_size": 5,
"total": 2
}

Include additional fields in response

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.

© 2023 SAP, Inc. All Rights Reserved.


Use Cases:
User search which returns all user attributes as well as last login date and permission details would look like this:
GET /api/users/jsmith?extend=last_login_date permissions
Then application will return JSON with content:
Response body:

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]

© 2023 SAP, Inc. All Rights Reserved.


When admin calls api/users?mask=login_name first_name email last_login_date&extend=last_login_date or e.g.
api/users/jsmith?mask=login_name first_name email last_login_date&extend=last_login_date
Then application will return JSON with content:

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]

When admin calls api/users?mask=login_name first_name last_name email permissions&extend=permissions or


e.g. api/users/jsmith?mask=login_name first_name last_name email permissions&extend=permissions
Then application will return JSON with content:

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]

© 2023 SAP, Inc. All Rights Reserved.


When admin calls api/users or e.g. api/users/customer

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]

© 2023 SAP, Inc. All Rights Reserved.


Returning a list of log entries

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:

• filter logs by:

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

© 2023 SAP, Inc. All Rights Reserved.


o context_info

• 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)

The following is a log entry example:

GET https://qa.workflow.dev.sap/wpm/api/system_log

The date format used in &event_date_from=08/31/2023&event_date_to=09/01/2023 parameters is from the


user that is executing the request without single quotes.

Returning errors with messages

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.

This is an example of returned ErrorBean:

{
"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."
]
}

This example contains multiple error messages inside “error_messages” list:

© 2023 SAP, Inc. All Rights Reserved.


{
"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"CustomField label is required.",
"CustomField field type is required.",
"CustomField system id is required.",
"CustomField name is required."
]
}

Date and Date Time Bean attributes


Bean attributes which have Date and Date Time type, display their value based on the date/time
settings for the user who is preforming a Workflow REST API call. These settings for each user are
located on Workflow’s user side under Tools -> Settings -> Time and date Settings.

For example:

CaseBean has “created_on” attribute. User performing REST API call has the followingsettings:

- Time Zone: “Europe/Prague”


- Date Display Format: “31.03.08”
- “Time Display Format”: “23:02:12”
When some case is requested via GET /cases/Task-sp-2, “created on” attribute has the followingvalue:

"created_on": "09.10.13 14:36:44"

Number and Decimal Bean attributes


Returned format of Number and Decimal Bean attributes vary on user’s “number format” settings. User
format can be changed on Workflow’s user page under Tools -> Settings -> Information -> Number Format.
AccountBean has “employees” attribute with Number type (Integer) which is used for setting
the number of account’s employees. Attribute “employees” is always set in this format “12345”.
For displaying the value in user’s number format attribute “employees_formatted” is used.
AccountBean has “annual_revenue” attribute with BigDecimal type which is used for setting
the value of account’s revenue. Attribute “annual_revenue” is always set in this format
“1234.56”. For displaying the value in user’s number format attribute
“annual_revenue_formatted” is used.

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:

© 2023 SAP, Inc. All Rights Reserved.


{
"annual_revenue": 54321.35,
"annual_revenue_formatted": 54,321.35,
...
"employees": 10523,
"employees_formatted": 10,523,
...
}

Reading Custom Field values


This section explains the format of Custom Field values which Workflow API returns inside the
response. The following entities have custom fields: case, user, project, account and contact.

CustomFieldBean has two attributes which are used to show the value of custom field:

- value – shows the value in default system format.


- value_formatted – shows the value based on user’s setting.

Value and value_formatted vary based on Custom Field type:

a) Date and Date time custom fields:


Custom Fields which have Date or Date Time type, depend on user’s date/time settings. These
settings can be changed on Workflow’s user page under Tools -> Settings -> Time and Date
Settings. CustomFieldBean attributes look like this:

© 2023 SAP, Inc. All Rights Reserved.


- value - shows the value in default system format - MM/dd/yyyy HH:mm:ss (24h
notation)

- value_formatted - shows the value based on user’s date/time settings.

For example, user John Smith uses next date/time settings:

- Time Zone: “Europe/Prague”


- Date Display Format: “31.03.08”
- “Time Display Format”: “23:02:12”

© 2023 SAP, Inc. All Rights Reserved.


Request GET /cases/Task-sp-2/custom_fields/when_the_issue_resolved returns:

{
"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"
}

b) Number, Currency and Decimal custom fields:


These custom fields depend on user’s number format. User format can be changed on Workflow’s
user page under Tools -> Settings -> Information -> Number Format. CustomFieldBean attributes look like
this:
- value - shows the value in US format.
- value_formatted - shows the value based on user’s number format settings.

For example, user John Smith uses “1.234,56” number format settings.

Request GET /cases/Task-sp-2/custom_fields/price returns:

{
"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.

- value - shows Predefined Value labels separaded by semicolon.


- value_formatted - shows Predefined Value labels separaded by semicolon (the same as
value).

© 2023 SAP, Inc. All Rights Reserved.


For example, “Checkbox” custom field with name “Available colors” has six predefined vauels:

Label SystemID
Blue bl
Red rd
Green grn
Yellow ylw
White wht
Black blk

Case Task-sp-2 has blue, green and white colors selected.

Request GET /cases/Task-sp-2/custom_fields/available_colors returns:

{
"name": "Available colors",
"system_id": "available_colors",
"type_name": "Checkbox",
"type_system_id": 8,
"value": "Blue; Green; White",
"value_formatted": "Blue; Green; White"
}

d) Project Autocomplete, User Autocomplete and Department Autocomplete custom


fields
CustomFieldBean’s attribute "autocomplete_value" is used for returning the value of selected
item combined with item’s system_id in form: “system_id:value”. For example:
"autocomplete_value": "sp:Sales Project".

Request GET /cases/Task-sp-2/custom_fields/project_auto returns:

{
"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"
}

© 2023 SAP, Inc. All Rights Reserved.


Setting Custom Field values
Custom Field value is set through CustomFieldBean. These Custom Field Types are supported for
setting values by Workflow API:
Text Number Radio Button Date Project Autocomplete
Large Text Decimal Pick List Date and Time Department Autocomplete
Rich Text Editor Number Autocomplete User Autocomplete
Email Currenc -----------------------
URL y Checkbox
Percent Multiple Choice Pick Up List
Multiple Autocomplete

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"
}

© 2023 SAP, Inc. All Rights Reserved.


Custom Field formats

This table shows the formats of certain Custom Fields values by Field Type expected by Workflow
API:

Custom Field Type Expected value format(s)


Date 02/25/13
2013-02-25
Feb 25, 2013
Date and Time 04/28/13 14:45:16
04/28/2013 14:45:16
Number 123456789
Decimal 1234567.9578
Currency 10999.99
Percent 65.6
Email [email protected]
Autocomplete
One (and only one) predefined value’s system id:
Radio Button
green_color
Pick List
Checkbox One or more predefined value’s system ids
Multiple Autocomplete separated by comma (and a space - optional):
Multiple Choice Pick Up List option_1, option_2, option_3
or
option_1,option_2,option_3
Project Autocomplete System id of one selected item:
Department Autocomplete sales_project
User Autocomplete accounting
jsmith

Example request for setting value of Date Custom Field

a) Sending invalid value: POST /cases/Task-sp-2/custom_fields


Request body:

{
"system_id": "day_went_live",
"value": "02.25.13"
}

© 2023 SAP, Inc. All Rights Reserved.


Response body:

{
"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)."
]
}

b) Sending valid value:


POST /cases/Task-sp-2/custom_fields Request body:
{
"system_id": "day_went_live",
"value": "02/25/13"
}

Response body (CaseBean):

{
...
"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"
}

© 2023 SAP, Inc. All Rights Reserved.


Example request for setting value of Checkbox Custom Field

“Available colors” custom field has 6 predefined values:

Label SystemID
Blue bl
Red rd
Green grn
Yellow ylw
White wht
Black blk

a) Sending invalid value: POST /cases/Task-sp-2/custom_fields


Request body:

{
"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."
]
}

b) Sending valid value:


POST /cases/Task-sp-2/custom_fields Request body:
{
"system_id": "available_colors",
"value": "bl, wht, ylw"
}

© 2021 SAP, Inc. All Rights Reserved.


Response body (CaseBean):

{
...
"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"
}

Example request for setting value of Radio Button Custom Field

“Product Group” custom field has 3 predefined values:

Label SystemID
Group 1 group_1
Group 2 group_2
Group 3 group_3

a) Sending invalid value:


POST /cases/Task-sp-2/custom_fields Request body:
{
"system_id": "product_group",
"value": "group_1, group_2"
}

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."
]
}

© 2022 SAP, Inc. All Rights Reserved.


b) Sending valid value:
POST /cases/Task-sp-2/custom_fields Request body:
{
"system_id": "product_group",
"value": "group_2"
}

Response body (CaseBean):

{
...
"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"
}

Example request for setting value of Project Autocomplete Custom Field

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"
}

© 2022 SAP, Inc. All Rights Reserved.


Response body:

{
"error_code": "CUSTOM_FIELD_VALUE_DOES_NOT_EXIST",
"error_messages": [
"'some_non_existing_system_id' is not valid value for Custom Field project auto."
]
}

b) Sending valid value:


POST /cases/Task-sp-2/custom_fields Request body:
{
"system_id": "project_auto",
"value": "sp"
}

Response body (CaseBean):

{
...
"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"
}

© 2022 SAP, Inc. All Rights Reserved.


Length options

Custom Field values which are set through CustomFieldBean must meet specific requirements.

c) Minimum and maximum number of characters


- Custom Field Types: Number, Decimal Number, Percent, Text, Large Text, and URL have
minimum and maximum allowed characters options. These options can be set under
“Advanced Settings” on Custom Field’s “Advanced” tab (“Minimum” and “Maximum”). (For
fields of Text, Large Text and URL Custom Field Type, “maximum option” is called “Length”.)
- Text Custom Field Type has default maximum of 256 characters.
- Rich Text Editor Custom Field Type has maximum number of characters (“Length”
option) and does not have “minimum” option.

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."
]
}

- More than 15 characters: POST /cases/Task-sp-2/custom_fields

© 2022 SAP, Inc. All Rights Reserved.


Request body:

{
"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."
]
}

d) Minimum and Maximum number of selected Predefined Values


Custom Fields Types: Checkbox and Multiple Choice Pick Up List have “Minimum” and
“Maximum” options for setting minimum and maximum number of items which can be selected.
These options can be set under “Advanced Settings” on Custom Field’s “Advanced” tab.
For example, we have a Custom Field “Participate In Event” with type Checkbox with three
predefined values.

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"
}

© 2022 SAP, Inc. All Rights Reserved.


Response body:

{
"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."
]
}

b) Not choosing any event: POST /cases/Task-sp-2/custom_fields


Request body:

{
"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"
}

Response body (CaseBean):

{
...
"case_key": "Task-sp-2",
...
"custom_fields": [
{
"name": "Participate In Event",
"system_id": "participate_in_event",
"type_name": "Checkbox",

© 2022 SAP, Inc. All Rights Reserved.


"type_system_id": 8,
"value": "Event 2; Event 3",
"value_formatted": "Event 2; Event 3"
},
...
],
...
"system_id": "Task-sp-2",
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-2"
}

Entity Beans listing


This is the list of all available Entity Beans. “Required” column marks the fields which must be set
when the entity is being created. “Present in Simple Bean” column marks fields which are
returned in simple bean representation.

AccountBean

Fields Field Type Required Present in Simple


Bean
name String + +
system_id String + +
uri URI +
description String
location String
phone String
web_site String
fax String
annual_revenue BigDecimal
annual_revenue_formatted String
employees Number
employees_formatted String
billing_address AddressBean
shipping_address AddressBean
custom_fields List<CustomFieldBean>

AddressBean

Fields Field Type Required Present in Simple


Bean
street String +
city String +
country CountryBean +
country_system_id String +
state StateBean +
state_system_id String +
zip String +

© 2022 SAP, Inc. All Rights Reserved.


address2 String +
address3 String +

CountryBean

Fields Field Type Required Present in Simple


Bean
name String +
system_id String +

StateBean

Fields Field Type Required Present in Simple


Bean
name String +
system_id String +

CustomFieldBean

Fields Field Type Required Present in Simple


Bean
name String + +
type_name String + +
type_system_id Number +
system_id String + +
label String +
value String
value_formatted String
autocomplete_value * String
predefined_values List<PredefinedValueBean>
uri URI +
* Used for User Autocomplete, Project Autocomplete and Department Autocompletefields

PredefinedValueBean

Fields Field Type Required Present in Simple


Bean
label String + +
system_id String + +
position Number + +
preselected Boolean +
disabled Boolean +

© 2022 SAP, Inc. All Rights Reserved.


ContactBean

Fields Field Type Required Present in Simple


Bean
first_name String + +
middle_name String +
last_name String +
name String
system_id String + +
account AccountBean
account_system_id String
phone String
email String + +
job_title String
address AddressBean
address_system_id String
department String
fax String
cell_phone String
home_phone String
active Boolean
custom_fields List<CustomFieldBean>
uri URI +

ProjectBean

Fields Field Type Required Present in Simple


Bean
name String + +
system_id * String + +
description String +
is_default Boolean +
custom_fields List<CustomFieldBean>
project_roles List<ProjectRoleBean>
permissions List<PermissionBean>
uri URI +
* Attribute “system_id” is the same as project’s unique key (shortcut).

© 2022 SAP, Inc. All Rights Reserved.


ProjectRoleBean

Fields Field Type Required Present in Simple


Bean
name String +
system_id String + +
user_system_id String + +

PermissionBean

Fields Field Type Required Present in Simple


Bean
name String +
system_id String + +
description String +

UserBean

Fields Field Type Required Present in Simple


Bean
login_name String + +
system_id (the same as String +
login_name)
password String +
first_name String +
middle_name String
last_name String +
email String +
department DepartmentBean
department_system_id String +
user_type UserTypeBean +
user_type_system_id String +
administrator Boolean
active Boolean
business_callendar String
federation_id String
custom_fields List<CustomFieldBean>
uri URI +

© 2021 SAP, Inc. All Rights Reserved.


DepartmentBean

Fields Field Type Required Present in Simple


Bean
name String + +
system_id String +
gate_keeper UserBean +
gate_keeper_system_id String +
company CompanyBean
company_system_id String
uri URI +

UserTypeBean

Fields Field Type Required Present in Simple


Bean
name String + +
system_id String +
uri URI +

CompanyBean

Fields Field Type Required Present in Simple


Bean
name String + +
system_id String + +
company_code String
address_1 String
address_2 String
city String
state String
country String
zip String
project ProjectBean
project_system_id String
business_calendar_system_id String
uri URI +

© 2021 SAP, Inc. All Rights Reserved.


CaseTypeBean

Fields Field Type Required Present in Simple


Bean
name String +
system_id String +
unique_key String +

StatusBean

Fields Field Type Required Present in Simple


Bean
name String +
system_id String +

ActionBean

Fields Field Type Required Present in Simple


Bean
name String +
type String +
start_status StatusBean +
end_status StatusBean +

MessageBean

Fields Field Type Required Present in Simple


Bean
subject String +
from_address String +
body String
date String +
system_id String +
uri URI +

© 2021 SAP, Inc. All Rights Reserved.


CustomTableBean

Fields Field Type Required Present in Simple


Bean
name String +
system_id String +
columns List<String>
rows List<CustomTableRowBean>
import_report String
uri URI +

CustomTableRowBean

Fields Field Type Required Present in Simple


Bean
oid String +
cells List<CustomTableCellBean> +

CustomTableCellBean

Fields Field Type Required Present in Simple


Bean
name String +
value String +

TotalBean

Fields Field Type Required Present in Simple


Bean
total Number +

QueryBean

Fields Field Type Required Present in Simple


Bean
query String + +
file_name String

© 2021 SAP, Inc. All Rights Reserved.


QueryResultBean

Fields Field Type Required Present in Simple


Bean
page Number +
page_size Number +
total Number +
completed_in long +
custom_table CustomTableBean +
affected_rows_count Number +
oid Number +

CaseBean

Fields Field Type Required Present in Simple


Bean
name String +
case_key String +
system_id String +
description String
closed Boolean
created_on String
updated_on String
status_changed_on String
closed_on String
case_type CaseTypeBean
case_type_system_id String
status StatusBean
status_system_id String
priority PriorityBean
priority_system_id String
project ProjectBean
project_system_id String
account AccountBean
account_system_id String
contact ContactBean
contact_system_id String
creator UserBean
creator_system_id String
updater UserBean
updater_system_id String
owner UserBean
owner_system_id String
referral UserBean

© 2021 SAP, Inc. All Rights Reserved.


referral_system_id String
team_member UserBean
team_member_system_id String
assignees List<UserBean>
custom_fields List<CustomFieldBean>
related_to_cases List<CaseBean>
related_from_cases List<CaseBean>
uri URI +

AttachmentBean

Fields Field Type Required Present in Simple


Bean
name String +
download_link String +
system_id String +
internal Boolean +
company CompanyBean +
uploader UserBean +

CommentBean

Fields Field Type Required Present in Simple


Bean
comment String +
system_id String +
parent_system_id String +
author UserBean +
author_system_id String +
updater UserBean +
updater_system_id String +
internal Boolean +
company CompanyBean +
created_on String +
updated_on String +

ActionParamsBean

Fields Field Type Required Present in Simple


Bean
name String +
description String +
priority_system_id String +
status_system_id String +

© 2021 SAP, Inc. All Rights Reserved.


case_type_system_id String +
project_system_id String +
account_system_id String +
contact_system_id String +
owner_system_id String +
referral_system_id String +
assignees List<UserBean> +
custom_fields List<CustomFieldBean> +
comment String +
comment_is_internal Boolean +

ResultBean

Fields Field Type


page Number
page_size Number
total Number
completed_in long
users List<UserBean>
cases List<CaseBean>
contacts List<ContactBean>
accounts List<AccountBean>
departments List<DepartmentBean>
user_types List<UserTypeBean>
case_types List<CaseTypeBean>
permissions List<PermissionBean>
custom_fields List<CustomFieldBean>
projects List<ProjectBean>
companies List<CompanyBean>
priorities List<PriorityBean>
messages List<MessageBean>
custom_tables List<CustomTableBean>
custom_table CustomTableBean

ErrorBean

Fields Field Type


error_code String
error_messages List<String>

© 2021 SAP, Inc. All Rights Reserved.


HTTP response codes

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.

For the complete list of HTTP status codes visit http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.

HTTP status code Description


200 OK Workflow API call successfully completed.
201 Created Entity is successfully created.
204 No content Workflow API call successfully completed.
No content is returned inside response body.
304 Not Modified Operation is not completed.
Entity is not modified.
400 Bad Request Operation is not completed.
Parameters sent to Workflow API are invalid or
missing which caused API call to fail.
403 Forbidden Operation is not completed.
User performing API call is not authorized. User
is trying to perform an action for which he
has no permission.
404 Not Found Requested URI does not match any existing
Workflow API path.
Entity is not found.
405 Method Not Allowed The HTTP method is not supported by Workflow
API for the requester URI.
406 Not Acceptable Accept header sent to Workflow API is not
supported (Requester wants the data to be
returned in the form which is not supported by
Workflow API).
415 Unsupported Media Type Request body and Content-Type header contains
content type which is not supported (Requester
is sending the content that Workflow API is not
able to receive).
500 Internal Server Error Unpredicted system error occured during
Workflow API call.

© 2021 SAP, Inc. All Rights Reserved.


APIs Listing

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.

Prefix “/api/” is added before each path. For example:

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.

© 2021 SAP, Inc. All Rights Reserved.


Account
Resource: Account Main path: /accounts

HTTP PATH DESCRIPTION


METHOD
1. GET /accounts/{system_id} Returns the account with specified system id.
2. POST /accounts Creates an account based on received AccountBean.
3. PUT /accounts Updates the account based on received
AccountBean.
4. DELETE /accounts/{system_id} Deletes the account with specified system id.
5. GET /accounts Search accounts based on set query parameters.
Returns a list of accounts which satisfy search
criteria.
Custom Fields
6. GET /accounts/{system_id}/custom_fields/{custom_field_system_id} Returns specified custom field with its value which is
set for specified account.
7. POST /accounts/{system_id}/custom_fields Sets custom field value to specified account based on
received CustomFieldBean.
8. PUT /accounts/{system_id}/custom_fields Updates custom field value in specified account
based on received CustomFieldBean.
9. DELETE /accounts/{system_id}/custom_fields/{custom_field_system_id} Deletes the value of specified custom field for
specified account.

© 2021 SAP, Inc. All Rights Reserved.


Case
Resource: Case Main path: /cases

HTTP PATH DESCRIPTION


METHOD
1. GET /cases/{system_id} Returns the case with specified system id.

2. POST /cases Creates a case based on received CaseBean.

3. POST /cases/user/{user_system_id} Creates a case based on received CaseBean. Case’s


creator is user with system id “user_system_id”.

4. PUT /cases Updates the case based on received CaseBean.

5. PUT /cases/user/{user_system_id} Updates the case based on received CaseBean.


Case’s updater is user with system id
“user_system_id”.

6. DELETE /cases/{system_id} Deletes the case with specified 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).

8. GET /cases Search cases based on set query parameters. Returns


a list of cases which satisfy search criteria.

9. PUT /cases/{system_id}/close Closes the case with specified system id.

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

© 2021 SAP, Inc. All Rights Reserved.


11 GET /cases?closed=true Retrieves all closed cases.

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.

13. PUT /cases/update_bulk Update 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.

© 2021 SAP, Inc. All Rights Reserved.


15. GET /cases/smart_list/{system_id} Returns cases which belong to the smart list with
specified system id.

System Case Lists


16. G ET /cases/system_list/creator Returns a list of cases in which user performingthe
REST call is the creator.
17. G ET /cases/system_list/creator/{user_system_id} Returns a list of cases in which user with specified
system id is the creator.
18. G ET /cases/system_list/assignee Returns a list of cases in which user performingthe
REST call is the assignee.
19. G ET /cases/system_list/assignee/{user_system_id} Returns a list of cases in which user with specified
system id is the assignee.
20. G ET /cases/system_list/owner Returns a list of cases in which user performingthe
REST call is the owner.
21. G ET /cases/system_list/owner/{user_system_id} Returns a list of cases in which user with specified
system id is the owner.
22. G ET /cases/system_list/referral Returns a list of cases in which user performingthe
REST call is the referral.
23. G ET /cases/system_list/referral/{user_system_id} Returns a list of cases in which user with specified
system id is the referral.
24. G ET /cases/system_list/team_member Returns a list of cases in which user performingthe
REST call is the team member.
25. G ET /cases/system_list/team_member/{user_system_id} Returns a list of cases in which user with specified
system id is the team member.
26. G ET /cases/system_list/follower Returns a list of cases in which user performingthe
REST call is the follower.
27. G ET /cases/system_list/follower/{user_system_id} Returns a list of cases in which user with specified
system id is the follower.
Related Cases
28. G ET /cases/{system_id}/related_cases Returns a list of related cases for case withspecified
system id.
29. G ET /cases/{system_id}/related_cases/inverse Returns a list of all cases from which case with
specified system id is related.

© 2021 SAP, Inc. All Rights Reserved.


30. PUT /cases/{system_id}/related_cases/{related_system_id} Creates a relation between two existing cases. To
case with system id "system_id" it sets related case
with system id "related_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.

© 2021 SAP, Inc. All Rights Reserved.


42. POST /cases/{system_id}/comments 1. Creates a comment based on received
CommentBean in case with specified system
id.
2. Creates a reply to comment with system id
“parent_system_id” if “parent_system_id” is
sent via CommentBean.
43. PUT /cases/{system_id}/comments/{comment_system_id} Updates a comment based on received
CommentBean in case with specified system id.
44. DELETE /cases/{system_id}/comments/{comment_system_id} Deletes a comment with specified comment system
id in case with specified system id.
Actions
45. GET /cases/{system_id}/actions Returns all actions which user who is performing a
REST call can execute in specified case.
46. GET /cases/{system_id}/actions/{user_system_id} Returns all actions which specified user can execute
in specified case.
47. PUT /cases/{system_id}/actions/{action_system_id} Executes specified action in specified case. (Attach
file action has its own method.)
48. PUT /cases/{system_id}/actions/{action_system_id}/{user_system_id} Executes specified action in specified case as
specified user. (Attach file action has its own
method.)
49. POST /cases/{system_id}/actions/{action_system_id} Executes specified Attach File action in specified
case.
50. POST /cases/{system_id}/actions/{action_system_id}/{user_system_id} Executes specified Attach File action in specified case
as specified user.

© 2021 SAP, Inc. All Rights Reserved.


Case Type
Resource: Case Type Main path: /case_types

Methods:

HTTP PATH DESCRIPTION


METHOD
1. GET /case_types/{system_id} Returns the case type with specified system id.
2. GET /case_types Search case types based on set query parameters.
Returns a list of case types which satisfy search
criteria.
3. GET /case_types/{system_id}/statuses Returns statuses associated with specified case type.
4. GET /case_types/{system_id}/statuses/{status_system_id}/actions Returns actions in specified status for specified case
type.

© 2021 SAP, Inc. All Rights Reserved.


Company
Resource: Company Main path: /companies

HTTP PATH DESCRIPTION


METHOD
1. GET /companies/{system_id} Returns the company with specified system id.
2. POST /companies Creates a company based on received CompanyBean.
3. PUT /companies Updates the company based on received
CompanyBean.
4. DELETE /companies/{system_id} Deletes the company with specified system id.
5. GET /companies Search companies based on set query parameters.
Returns a list of companies which satisfy search
criteria.

© 2021 SAP, Inc. All Rights Reserved.


Contact
Resource: Contact Main path: /contact

HTTP PATH DESCRIPTION


METHOD
1. GET /contacts/{system_id} Returns the contact with specified system id.
2. POST /contacts Creates a contact based on received ContactBean.
3. PUT /contacts Updates the contact based on received ContactBean.
4. DELETE /contacts/{system_id} Deletes the contact with specified system id.
5. GET /contacts Search contacts based on set query parameters.
Returns a list of contacts which satisfy search
criteria.
Custom Fields
6. GET /contacts/{system_id}/custom_fields/{custom_field_system_id} Returns specified custom field with its value which is
set for specified contact.
7. POST /contacts/{system_id}/custom_fields Sets custom field value to specified contact based on
received CustomFieldBean.
8. PUT /contacts/{system_id}/custom_fields Updates custom field value in specified contact
based on received CustomFieldBean.
9. DELETE /contacts/{system_id}/custom_fields/{custom_field_system_id} Deletes the value of specified custom field for
specified contact.

© 2021 SAP, Inc. All Rights Reserved.


Custom Field
Resource: Custom Field Main path: /custom_fields

HTTP PATH DESCRIPTION


METHOD
1. GET /custom_fields/{system_id} Returns the custom field with specified system id.
2. POST /custom_fields Creates a custom field based on received
CustomFieldBean.
3. PUT /custom_fields Updates the custom field based on received
CustomFieldBean.
4. DELETE /custom_fields/{system_id} Deletes the custom field with specified system id.
5. GET /custom_fields Search custom fields based on set queryparameters.
Returns a list of custom fields which satisfy search
criteria.

© 2021 SAP, Inc. All Rights Reserved.


Custom Table
Resource: Custom Table Main path: /custom_tables

HTTP PATH DESCRIPTION


METHOD
1. GET /custom_tables/{system_id} Returns the custom table with specified system id.
2. POST /custom_tables Creates a custom table based on received
CustomTableBean.
3. DELETE /custom_tables/{system_id} Deletes the custom table with specified system id.
4. GET /custom_tables Search custom tables based on set query parameters.
Returns a list of custom tables which satisfy search
criteria.
5. POST /custom_tables/{system_id}/column/{column_name} Adds a column with specified name into specified
custom table.
6. GET /custom_tables/{system_id}/rows Returns rows from specified custom table.
7. GET /custom_tables/{system_id}/rows/{oid} Returns row with specified oid (object id) from
specified custom table.
8. POST /custom_tables/{system_id}/rows Adds one row in specified custom table based on
received row in CustomTableBean.
9. PUT /custom_tables/{system_id}/rows Updates the row in specified custom table based on
received row in CustomTableBean.
10. DELETE /custom_tables/{system_id}/rows/{oid} Deletes the row with specified oid in specified
custom table.
Executing queries
11. PUT /custom_tables/query/select Executes select query sent via QueryBean and
returns rows from custom table.
12. POST /custom_tables/query/insert Inserts data into custom table based on sent queryin
QueryBean.
13. PUT /custom_tables/query/update Updates data in custom table based on sent query in
QueryBean.

© 2021 SAP, Inc. All Rights Reserved.


14. PUT /custom_tables/query/delete Deletes data in custom table based on sent query in
QueryBean.
Import
15. POST /custom_tables/import/new_table Creates a new custom table with rows from uploaded
csv file.
16. POST /custom_tables/{system_id}/import/new_rows Updates rows in specified custom table from
uploaded csv file.
Export
17. PUT /custom_tables/export/query_to_csv Exports rows from custom table to CSV file basedon
received SELECT query in QueryBean.

Department
Resource: Department Main path: /departments

HTTP PATH DESCRIPTION


METHOD
1. GET /departments/{system_id} Returns the department with specified system id.
2. POST /departments Creates a department based on received
DepartmentBean.
3. PUT /departments Updates the department based on received
DepartmentBean.
4. DELETE /departments/{system_id} Deletes the department with specified system id.
5. GET /departments Search departments based on set query parameters.
Returns a list of departments which satisfy search
criteria.

© 2021 SAP, Inc. All Rights Reserved.


Message
Resource: Message Main path: /messages

HTTP PATH DESCRIPTION


METHOD
1. GET /messages/{system_id} Returns message with specified system id.
2. DELETE /messages/{system_id} Deletes the message with specified system id.
3. GET /messages/user/{system_id}/unread Search unread messages for specified user basedon
set query parameters. Returns a list of unread
messages which satisfy search criteria.
4. GET /messages/user/{system_id}/unread_and_mark_as_read Search unread messages for specified user basedon
set query parameters. Returns a list of unread
messages which satisfy search criteria and marks
returned messages as read.
5. GET /messages/user/{system_id}/total_unread Returns the number of unread messages for
specified user.

© 2021 SAP, Inc. All Rights Reserved.


Project
Resource: Project Main path: /projects

HTTP PATH DESCRIPTION


METHOD
1. GET /projects/{system_id} Returns the project with specified system id.
2. POST /projects Creates a project based on received ProjectBean.
3. PUT /projects Updates the project based on received ProjectBean.
4. DELETE /projects/{system_id} Deletes the project with specified system id.
5. GET /projects Search projects based on set query parameters.
Returns a list of projects which satisfy search criteria.
Custom Fields
6. GET /projects/{system_id}/custom_fields/{custom_field_system_id} Returns specified custom field with its value which is
set for specified project.
7. POST /projects/{system_id}/custom_fields Sets custom field value to specified project based on
received CustomFieldBean.
8. PUT /projects/{system_id}/custom_fields Updates custom field value in specified project based
on received CustomFieldBean.
9. DELETE /projects/{system_id}/custom_fields/{custom_field_system_id} Deletes the value of specified custom field for
specified project.

© 2022 SAP, Inc. All Rights Reserved.


Permission groups

Resource: PermissionGroup Main path: /permission_groups

HTTP PATH DESCRIPTION


METH
OD

1. GET /permission_groups Search permission groups based on set query


parameters.
Returns a list of permissions which satisfy
search criteria.
2. GET /permission_groups/{system_id} Returns the permission group with specified
system id.
3. GET /permission_groups/{system_id}/users Returns users that belong to permission
group with specified system id.
4. PUT /permission_groups/{system_id}/users Updates the user value in specified
permission group based on received user
system ID’s.
5. PUT /permission_groups/{system_id}/users/{user_system_id} Removes the user value in specified
permission group based on received user
system ID.
5. PUT /permission_groups/{system_id}/departments/{departm Removes the department value in specified
ent_system_id} permission group based on received
department system ID.
5. PUT /permission_groups/{system_id}/user_types/{user_type Removes the user type value in specified
_system_id} permission group based on received user
type system ID.

© 2022 SAP, Inc. All Rights Reserved.


User
Resource: User Main path: /users

HTTP PATH DESCRIPTION


METHOD
1. GET /users/{system_id} Returns the user with specified system id.
2. POST /users Creates a user based on received UserBean.
3. PUT /users Updates the user based on received UserBean.
4. DELETE /users/{system_id} Deletes the user with specified system id.
5. GET /users Search users based on set query parameters. Returns
a list of users which satisfy search criteria.
Bulk Users
6. POST /users/create_bulk Creates a list of users based on received list of
UserBean objects.
7. PUT /users/update_bulk Updates a list of users based on received list of
UserBean objects.
8. PUT /users/upsert_bulk Creates or updates the user based on received list of
UserBean objects.

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.

© 2022 SAP, Inc. All Rights Reserved.


User Type
Resource: User Type Main path: /user_types

HTTP PATH DESCRIPTION


METHOD
1. GET /user_types/{system_id} Returns the user type with specified system id.
2. POST /user_types Creates a user type based on received UserTypeBean.
3. PUT /user_types Updates the user type based on received
UserTypeBean.
4. DELETE /user_types/{system_id} Deletes the user type with specified system id.
5. GET /user_types Search user types based on set queryparameters.
Returns a list of user types which satisfy search
criteria.

© 2022 SAP, Inc. All Rights Reserved.


Detailed Workflow API

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}

HTTP Method GET


Path /accounts/{system_id}
Description Returns the account with specified system id.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Account found.
404 Not Found – Account not found.
Body AccountBean - success.
ErrorBean - failure.

JSON example:

a) GET /accounts/some_company_account

© 2021 SAP, Inc. All Rights Reserved.


Response body:

{
"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"
}

© 2021 SAP, Inc. All Rights Reserved.


b) GET /accounts/some_non_existing_account

{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Account does not exist."
]
}

POST /accounts

HTTP Method POST


Path /accounts
Description Creates an account based on received AccountBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body AccountBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – Account successfully created.
400 Bad Request – Required fields are missing or other constraint
error.
Body AccountBean - success.
ErrorBean - failure.

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"
},
{

© 2021 SAP, Inc. All Rights Reserved.


"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,
"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 456"
},
"system_id": "some_company_account",
"web_site": "www.webcominc.com"
}

b) If account name which is required is not sent:

{
"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"Account name is required."
]
}

PUT /accounts

HTTP Method PUT


Path /accounts
Description Updates the account based on received AccountBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body AccountBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Account successfully updated.
400 Bad Request – Required fields are missing or other constraint
error.
404 Not Found – Account not found.
Body AccountBean - success.
ErrorBean - failure.

© 2021 SAP, Inc. All Rights Reserved.


Note: AccountBean’s “system_id” field must be set. JSON example:
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"
}

© 2021 SAP, Inc. All Rights Reserved.


DELETE /accounts/{system_id}

HTTP Method DELETE


Path /accounts/{system_id}
Description Deletes the account with specified system id.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Account successfully deleted.
304 Not Modified – If account could not be deleted.
404 Not Found – Account not found.
Body ErrorBean - failure.

Example request: DELETE/accounts/some_company_account

GET /accounts

HTTP Method GET


Path /accounts
Description Search accounts based on set query parameters. Returns a list of
accounts which satisfy search criteria.

Available search attributes:


page (Number)
page_size (Number)
name (String)
system_id (String)
decription (String)
fax (String)
location (String)
website (String)

These search attributes are set as query parameters:


/accounts?name=electronics&page=1&page_size=5
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A

© 2021 SAP, Inc. All Rights Reserved.


Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with a list of AccountBeans.

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:

GET /accounts?name=account&location=San Francisco&page=1&page_size=10

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",

© 2021 SAP, Inc. All Rights Reserved.


"country": { "name":
"USA",
"system_id": "usa"
},
"state": {
"name": "California",
"system_id": "CA"
},
"street": "First Street 123",
"zip": "12345"
},
"system_id": "account_a",
"uri": "http://localhost:8080/wpm/api/accounts/account_a",
"web_site": "www.accounta.com"
},
{
"annual_revenue": 987654.35,
"annual_revenue_formatted": "987,654.35",
"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": [

],
"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
}

© 2021 SAP, Inc. All Rights Reserved.


GET /accounts/{system_id}/custom_fields/{custom_field_system_id}

HTTP Method GET


Path /accounts/{system_id}/custom_fields/{custom_field_system_id}
Description Returns specified custom field with its value which is set for specified
account.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Custom Field found.
404 Not Found – Account or Custom Field not found.
Body CustomFieldBean - success.
ErrorBean - failure.

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"
}

© 2021 SAP, Inc. All Rights Reserved.


POST /accounts/{system_id}/custom_fields

HTTP Method POST


Path /accounts/{system_id}/custom_fields
Description Sets custom field value to specified account based on received
CustomFieldBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body CustomFieldBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – Custom Field value set successfully.
400 Bad Request – Custom Field value is not in the right format.
404 Not Found – Account or Custom Field not found
Body AccountBean - success.
ErrorBean - failure.

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": [

© 2021 SAP, Inc. All Rights Reserved.


{
"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",
"shipping_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"
},
"system_id": "account_a",
"uri": "http://localhost:8080/wpm/api/accounts/account_a",
"web_site": "www.accounta.com"
}

PUT /accounts/{system_id}/custom_fields

HTTP Method PUT


Path /accounts/{system_id}/custom_fields
Description Updates custom field value in specified account based on received
CustomFieldBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body CustomFieldBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 200 OK – Custom Field value set successfully.
400 Bad Request – Custom Field value is not in the right format.

© 2021 SAP, Inc. All Rights Reserved.


404 Not Found – Account or Custom Field not found
Body AccountBean - success.
ErrorBean - failure.

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",

© 2021 SAP, Inc. All Rights Reserved.


"shipping_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"
},
"system_id": "account_a",
"uri": "http://localhost:8080/wpm/api/accounts/account_a",
"web_site": "www.accounta.com"
}

DELETE /accounts/{system_id}/custom_fields/{custom_field_system_id}

HTTP Method DELETE


Path /accounts/{system_id}/custom_fields/{custom_field_system_id}
Description Deletes the value of specified custom field for specified account.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Custom field value successfully deleted.
404 Not Found – Account or Custom Field not found.
Body ErrorBean - failure.

Example request: DELETE/accounts/account_a/custom_fields/day_went_live

© 2021 SAP, Inc. All Rights Reserved.


Case
Resource: Case Main path: /cases

GET /cases/{system_id}

HTTP Method GET


Path /cases/{system_id}
Description Returns the case with specified system id.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case found.
404 Not Found – Case not found.
Body CaseBean - success.
ErrorBean - failure.

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",

© 2021 SAP, Inc. All Rights Reserved.


"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": "15",
"value_formatted": "15"
}
],
"description": "This case is created via REST API.",
"name": "REST API - Case 3",
"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-3",
"updated_on": "09/10/13 14:50:49",
"updater": {
"first_name": "John",
"last_name": "Smith",

© 2021 SAP, Inc. All Rights Reserved.


"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"
}

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.

HTTP Method POST


Path /cases
Description Creates a case based on received CaseBean.

Case creator - user who is performing REST API call.


Case updater - user who is performing REST API call.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body CaseBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – Case successfully created.
404 Not Found – Any child entity (account, contact, creator rtc.) with
sent system_id not found.
Body CaseBean - success.
ErrorBean - failure.

© 2021 SAP, Inc. All Rights Reserved.


JSON example:

a) POST /cases

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 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:

70 Workflow API © 2021 SAP, Inc. All Rights Reserved.


{
"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-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": "15",
"value_formatted": "15"
}
],
"description": "This case is created via REST API.",
"name": "REST API - Case 3",
"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-3",
"updated_on": "09/10/13 14:50:49",
"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"
}

b) If owner with sent system_id does not exist:

{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Owner does not exist."
]
}

POST /cases/user/{user_system_id}

HTTP Method POST


Path /cases/user/{user_system_id}
Description Creates a case based on received CaseBean. Case’s creator is user with
system id “user_system_id”.

Case creator - user with system id “user_system_id”.


Case updater - user with system id “user_system_id”.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body CaseBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – Case successfully created.
404 Not Found – User or any child entity with sent system_id not
found.
Body CaseBean - success.
ErrorBean - failure.

JSON example:

POST /cases/user/tsmith

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

HTTP Method PUT


Path /cases
Description Updates the case based on received CaseBean.

Case updater - user who is performing REST API call.

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}

HTTP Method PUT


Path /cases/user/{user_system_id}
Description Updates the case based on received CaseBean. Case’s updater is user
with system id “user_system_id”.

Case updater - user with system id “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"
}

© 2022 SAP, Inc. All Rights Reserved.


DELETE /cases/{system_id}

HTTP Method DELETE


Path /cases/{system_id}
Description Deletes the case with specified system id.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case successfully deleted.
304 Not Modified – If case could not be deleted.
404 Not Found – Case not found.
Body ErrorBean - failure.

Example request: DELETE /cases/Task-sp-1

DELETE /cases/{system_id}/delete_with_related

HTTP Method DELETE


Path /cases/{system_id}/delete_with_related
Description 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).
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case successfully deleted.
304 Not Modified – If case could not be deleted.
404 Not Found – Case not found.
Body ErrorBean - failure.

Example request: DELETE /cases/Task-sp-1


GET /cases

HTTP Method GET


Path /cases
Description Search cases based on set query parameters. Returns a list of cases
which satisfy search criteria.

Available search attributes:


page (Number)
page_size (Number)
name (String)
decription (String)
case_key (String)
created_by (String) 1
updated_by (String) 2
assignee (String) 3
owner (String) 4
referral (String) 5
team_member (String) 6
status (String) 7
project (String) 8
priority (String) 9
case_type (String) 10
system_id (String)
mask (String) 11

1, 2, 3, 4, 5 and 6 – user system ids sepatated with space:


/cases?updated_by=jsmith tsmith&assignee=jsmith
tsmith&owner=jsmith&team_member=jsmith

7, 8, 9 and 10 – entity system ids separated by space:


/cases?project=sp impl dev&case_type=Task Bug

11 – list of fields separated by space which are going to be returned in case


object:
/cases?project=sp&mask=name case_key status

These search attributes are set as query parameters:


/cases?name=implement&updated_by=john&page=1&page_size=5
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with a list of CaseBeans.

JSON example:

There are three cases:

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

GET /cases?assignee=jsmith tsmith&owner=tsmith&mask=name case_key project&page=1&page_size=5

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

HTTP Method PUT


Path /cases/{system_id}/close
Description Closes the case with specified 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 closed.
304 Not Modified – Case not closed.
404 Not Found – Case not found.
Body CaseBean - success.
ErrorBean - failure.

Request example:

PUT /cases/Task-sp-3/close

PUT /cases/{system_id}/close_with_related

HTTP Method PUT


Path /cases/{system_id}/close_with_related
Description 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).
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 closed.
304 Not Modified – Case not closed.
404 Not Found – Case not found.
Body CaseBean - success.
ErrorBean - failure.
POST /cases/create_bulk

HTTP Method POST


Path /cases/create_bulk
Description Creates a list of cases based on received list of caseBean objects.

Case creator - user who is performing REST API call.


Case updater - user who is performing REST API call.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body List of CaseBean objects
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – Cases successfully created.
404 Not Found – Any child entity (account, contact, creator etc.)
with sent system_id not found.
Body processed_entities - success.
errors – failure.

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"
}

90 Workflow API © 2021 SAP, Inc. All Rights Reserved.


b) If case type, owner, project, status, priority, account, contact with sent system_id does not
exist:

"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
}
]

Errors - List of messages with error details


Failed_index - Index of case with bad request.

© 2020 SAP, Inc. All Rights Reserved.


PUT /cases/update_bulk

HTTP Method PUT


Path /cases/update_bulk
Description Updates a list of cases based on received list of caseBean objects.

Case updater - user who is performing REST API call.

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

User performing REST call is jsmith.

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"
}],

© 2020 SAP, Inc. All Rights Reserved.


"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"
}]
},
{
"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"
}]
}]

© 2020 SAP, Inc. All Rights Reserved.


Response body:

{
"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"
},

© 2020 SAP, Inc. All Rights Reserved.


"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 UPDATED",
"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 UPDATED",
"case_key": "Task-sp-1",
"system_id": "task-sp-1",
"uri": "http://localhost:8080/wpm/api/cases/task-sp-1"
}
],
"related_from_cases": [
{
"name": "REST API - Case 2 UPDATED",
"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-21",
"system_id": "task-sp-21",
"uri": "http://localhost:8080/wpm/api/cases/task-sp-21"
},
{
"name": "REST API - Case 1",
"case_key": "Task-sp-24",
"system_id": "task-sp-24",
"uri": "http://localhost:8080/wpm/api/cases/task-sp-24"
},
{
"name": "REST API - Case 2",
"case_key": "Task-sp-3",
"system_id": "task-sp-3",
"uri": "http://localhost:8080/wpm/api/cases/task-sp-3"
},
{
"name": "REST API - Case 1 UPDATED",
"case_key": "Task-sp-1",
"system_id": "task-sp-1",
"uri": "http://localhost:8080/wpm/api/cases/task-sp-1"
},

© 2020 SAP, Inc. All Rights Reserved.


{
"name": "REST API - Case 1",
"case_key": "Task-sp-22",
"system_id": "task-sp-22",
"uri": "http://localhost:8080/wpm/api/cases/task-sp-22"
},
{
"name": "REST API - Case 1",
"case_key": "Task-sp-23",
"system_id": "task-sp-23",
"uri": "http://localhost:8080/wpm/api/cases/task-sp-23"
}
],
"uri": "http://localhost:8080/wpm/api/cases/task-sp-1",
"case_url": "http://localhost:8080/wpm/mt/junit/projects/sp/task-1"
}
]
}

© 2020 SAP, Inc. All Rights Reserved.


GET /cases/list/{system_id}

HTTP Method GET


Path /cases/list/{system_id}
Description Returns cases which belong to the list with specified system id.

Available search attributes:


page (Number)
page_size (Number)

These search attributes are set as query parameters:


/cases/list/list_of_tasks?page=1&page_size=10
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case list found.
404 Not Found – Case not found.
Body ResultBean with a list of CaseBeans - success.
ErrorBean - failure.

JSON example:

a) List with system_id “list_of_tasks” contains 2 cases:

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": {

© 2020 SAP, Inc. All Rights Reserved.


name": "Sales and Marketing", "system_id":
"sales_and_marketing"
}
}
],
"case_key": "Task-sp-3",
"case_type": {
"name": "Bug",
"system_id": "bug",
"unique_key": "bug"
},
"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":
"durationw "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"

© 2020 SAP, Inc. All Rights Reserved.


},
"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"
},
{
"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": "Bug",
"system_id": "bug",
"unique_key": "bug"
},
"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",

© 2020 SAP, Inc. All Rights Reserved.


"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"
}
],
"completed_in": 0,
"page": 1,
"page_size": 10,
"total": 2
}

b) GET /cases/list/some_non_existing_list

{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Case list does not exist."
]
}

© 2020 SAP, Inc. All Rights Reserved.


GET /cases/smart_list/{system_id}

HTTP Method GET


Path /cases/smart_list/{system_id}
Description Returns cases which belong to the smart list with specified system id.
In other words, returns cases which satisfy search criteria saved by
smart list.

Available search attributes:


page (Number)
page_size (Number)

These search attributes are set as query parameters:


/cases/smart_list/toms_smart_list?page=1&page_size=10
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Smart list found.
404 Not Found – Smart list not found.
Body ResultBean with a list of CaseBeans - success.
ErrorBean - failure.

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"
}

© 2020 SAP, Inc. All Rights Reserved.


}
],
"case_key": "Task-sp-3",
"case_type": {
"name": "Bug",
"system_id": "bug",
"unique_key": "bug"
},
"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",

© 2020 SAP, Inc. All Rights Reserved.


"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-3"
},
{
"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": "Bug",
"system_id": "bug",
"unique_key": "bug"
},
"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",

© 2020 SAP, Inc. All Rights Reserved.


"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"
}
],
"completed_in": 0,
"page": 1,
"page_size": 10,
"total": 2
}

b) GET /cases/smart_list/some_non_existing_smart_list

{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Smart list does not exist."
]
}

© 2020 SAP, Inc. All Rights Reserved.


GET /cases/system_list/creator

HTTP Method GET


Path /cases/system_list/creator
Description Returns a list of cases in which user performing the REST call is the
creator.

Available search attributes:


page (Number)
page_size (Number)

These search attributes are set as query parameters:


/cases/system_list/creator?page=1&page_size=10
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with a list of CaseBeans - success.

JSON example:

John Smith created one case.

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",

© 2020 SAP, Inc. All Rights Reserved.


"unique_key": "task"
},
"closed": false,
"created_on": "10/10/13 14:41:18",
"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": "Refresh List",
"system_id": "refresh_list",
"type_name": "Checkbox",
"type_system_id": 8
}
],
"description": "",
"name": "Test Case 1",
"priority": {
"name": "Low",
"system_id": "Trivial"
},
"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-8",
"updated_on": "10/10/13 14:42:07",
"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-8"
}
],
"completed_in": 0,
"page": 1,
"page_size": 10,
"total": 1
}

© 2020 SAP, Inc. All Rights Reserved.


GET /cases/system_list/creator/{user_system_id}

HTTP Method GET


Path /cases/smart_list/creator/{user_system_id}
Description Returns a list of cases in which user with specified system id is the
creator.

Available search attributes:


page (Number)
page_size (Number)

These search attributes are set as query parameters:


/cases/smart_list/creator/tsmith?page=1&page_size=10
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – User found.
404 Not Found – User not found.
Body ResultBean with a list of CaseBeans - success.
ErrorBean - failure.

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"
}
}
],

© 2020 SAP, Inc. All Rights Reserved.


"case_key": "Task-sp-5",
"case_type": {
"name": "Bug",
"system_id": "bug",
"unique_key": "bug"
},
"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",

© 2020 SAP, Inc. All Rights Reserved.


"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"
}
],
"completed_in": 0,
"page": 1,
"page_size": 10,
"total": 1
}

GET /cases/system_list/assignee

HTTP Method GET


Path /cases/system_list/assignee
Description Returns a list of cases in which user performing the REST call is the
assignee.

Available search attributes:


page (Number)
page_size (Number)

These search attributes are set as query parameters:


/cases/system_list/assignee?page=1&page_size=10
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with a list of CaseBeans - success.

Request example:

GET /cases/system_list/assignee?page=1&page_size=10

Response body has the same format as in GET /cases/system_list/creator.

100 Workflow API © 2021 SAP, Inc. All Rights Reserved.


GET /cases/system_list/assignee/{user_system_id}

HTTP Method GET


Path /cases/smart_list/assignee/{user_system_id}
Description Returns a list of cases in which user with specified system id is the
assignee.

Available search attributes:


page (Number)
page_size (Number)

These search attributes are set as query parameters:


/cases/smart_list/assignee/tsmith?page=1&page_size=10
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – User found.
404 Not Found – User not found.
Body ResultBean with a list of CaseBeans - success.
ErrorBean - failure.

Request example:

GET /cases/system_list/assignee/tsmith?page=1&page_size=10

Response body has the same format as in GET/cases/system_list/creator/{user_system_id}.


GET /cases/system_list/owner

HTTP Method GET


Path /cases/system_list/owner
Description Returns a list of cases in which user performing the REST call is the
owner.

Available search attributes:


page (Number)
page_size (Number)

These search attributes are set as query parameters:


/cases/system_list/owner?page=1&page_size=10
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with a list of CaseBeans - success.

Request example:

GET /cases/system_list/owner?page=1&page_size=10

Response body has the same format as in GET /cases/system_list/creator.

1. GET /cases/system_list/owner/{user_system_id}

HTTP Method GET


Path /cases/smart_list/owner/{user_system_id}
Description Returns a list of cases in which user with specified system id is the
owner.

Available search attributes:


page (Number)
page_size (Number)

These search attributes are set as query parameters:


/cases/smart_list/owner/tsmith?page=1&page_size=10
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – User found.
404 Not Found – User not found.
Body ResultBean with a list of CaseBeans - success.
ErrorBean - failure.

Request example:

GET /cases/system_list/owner/tsmith?page=1&page_size=10

Response body has the same format as in GET/cases/system_list/creator/{user_system_id}.

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.

Available search attributes:


page (Number)
page_size (Number)

These search attributes are set as query parameters:


/cases/system_list/team_member?page=1&page_size=10
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with a list of CaseBeans - success.

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}

HTTP Method GET


Path /cases/smart_list/team_member/{user_system_id}
Description Returns a list of cases in which user with specified system id is the
team member.

Available search attributes:


page (Number)
page_size (Number)

These search attributes are set as query parameters:


/cases/smart_list/team_member/tsmith?page=1&page_size=10
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – User found.
404 Not Found – User not found.
Body ResultBean with a list of CaseBeans - success.
ErrorBean - failure.

Request example:

GET /cases/system_list/team_member/tsmith?page=1&page_size=10

Response body has the same format as in GET/cases/system_list/creator/{user_system_id}.

GET /cases/system_list/referral

HTTP Method GET


Path /cases/system_list/referral
Description Returns a list of cases in which user performing the REST call is the
referral.

Available search attributes:


page (Number)
page_size (Number)

These search attributes are set as query parameters:


/cases/system_list/referral?page=1&page_size=10
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with a list of CaseBeans - success.
Request example:

GET /cases/system_list/referral?page=1&page_size=10

Response body has the same format as in GET /cases/system_list/creator.

GET /cases/system_list/referral/{user_system_id}

HTTP Method GET


Path /cases/smart_list/referral/{user_system_id}
Description Returns a list of cases in which user with specified system id is the
referral.

Available search attributes:


page (Number)
page_size (Number)

These search attributes are set as query parameters:


/cases/smart_list/referral/tsmith?page=1&page_size=10
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – User found.
404 Not Found – User not found.
Body ResultBean with a list of CaseBeans - success.
ErrorBean - failure.

Request example:

GET /cases/system_list/referral/tsmith?page=1&page_size=10

Response body has the same format as in GET/cases/system_list/creator/{user_system_id}.


GET /cases/system_list/follower

HTTP Method GET


Path /cases/system_list/follower
Description Returns a list of cases in which user performing the REST call is the
follower.

Available search attributes:


page (Number)
page_size (Number)

These search attributes are set as query parameters:


/cases/system_list/follower?page=1&page_size=10
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with a list of CaseBeans - success.

Request example:

GET /cases/system_list/follower?page=1&page_size=10

Response body has the same format as in GET /cases/system_list/creator.


GET /cases/system_list/follower/{user_system_id}

HTTP Method GET


Path /cases/smart_list/follower/{user_system_id}
Description Returns a list of cases in which user with specified system id is the
follower.

Available search attributes:


page (Number)
page_size (Number)

These search attributes are set as query parameters:


/cases/smart_list/follower/tsmith?page=1&page_size=10
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – User found.
404 Not Found – User not found.
Body ResultBean with a list of CaseBeans - success.
ErrorBean - failure.

Request example:

GET /cases/system_list/follower/tsmith?page=1&page_size=10

Response body has the same format as in GET/cases/system_list/creator/{user_system_id}.


GET /cases/{system_id}/related_cases

HTTP Method GET


Path /cases/{system_id}/related_cases
Description Returns a list of related cases for case with specified system id.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request – Input
Accepts application/json
Expected request body N/A
Response – Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case found.
404 Not Found – Case not found.
Body A list of CaseBeans - success.
ErrorBean - failure.

JSON example:

Case Task-sp-3 has two related cases.

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

HTTP Method GET


Path /cases/{system_id}/related_cases/inverse
Description Returns a list of all cases from which case with specified system id is
related.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request – Input
Accepts application/json
Expected request body N/A
Response – Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case found.
404 Not Found – Case not found.
Body A list of CaseBeans - success.
ErrorBean - failure.

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"
}
]

110 Workflow API © 2021 SAP, Inc. All Rights Reserved.


PUT /cases/{system_id}/related_cases/{related_system_id}

HTTP Method PUT


Path /cases/{system_id}/related_cases/{related_system_id}
Description Creates a relation between two existing cases. To case with system id
"system_id" it sets related case with system id "related_system_id".
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request – Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Cases successfully related.
400 Bad Request – Relation already exists.
404 Not Found – Cases not found.
Body ErrorBean - failure.

Request example:

PUT /cases/Task-sp-3/related_cases/Task-sp-7

DELETE /cases/{system_id}/related_cases/{related_system_id}

HTTP Method DELETE


Path /cases/{system_id}/related_cases/{related_system_id}
Description Deletes the relation between case with system id "system_id" and its
related case with system id "related_system_id".
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Relation between cases successfully deleted.
400 Bad Request – Cases are not related.
404 Not Found – Cases not found.
Body ErrorBean - failure.

Request example: DELETE/cases/Task-sp-3/related_cases/Task-sp-7

© 2021 SAP, Inc. All Rights Reserved.


GET /cases/{system_id}/custom_fields/{custom_field_system_id}

HTTP Method GET


Path /cases/{system_id}/custom_fields/{custom_field_system_id}
Description Returns specified custom field with its value which is set for specified
case.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Custom Field found.
404 Not Found – Case or Custom Field not found.
Body CustomFieldBean - success.
ErrorBean - failure.

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"
}

© 2021 SAP, Inc. All Rights Reserved.


POST /cases/{system_id}/custom_fields

HTTP Method POST


Path /cases/{system_id}/custom_fields
Description Sets custom field value in specified case based on received
CustomFieldBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body CustomFieldBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – Custom Field value set successfully.
400 Bad Request – Custom Field value is not in the right format.
404 Not Found – Case or Custom Field not found
Body CaseBean - success.
ErrorBean - failure.

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",

© 2021 SAP, Inc. All Rights Reserved.


"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": "12/26/15",
"value_formatted": "26/12/15"
},
{
"name": "Effort Left",
"system_id": "effort_left",
"type_name": "Number",
"type_system_id": 2,
"value": "3",
"value_formatted": "3"
},
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "10",
"value_formatted": "10"
}
],
"description": "This case is created via REST API.",
"name": "REST API - Case 1",
"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": {

© 2021 SAP, Inc. All Rights Reserved.


"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-1",
"updated_on": "10/10/13 16:17:09",
"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-1"
}

PUT /cases/{system_id}/custom_fields

HTTP Method PUT


Path /cases/{system_id}/custom_fields
Description Updates custom field value in specified case based on received
CustomFieldBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body CustomFieldBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 200 OK – Custom Field value set successfully.
400 Bad Request – Custom Field value is not in the right format.
404 Not Found – Case or Custom Field not found
Body CaseBean - success.
ErrorBean - failure.

JSON example:

PUT /cases/Task-sp-1/custom_fields

115 Workflow API © 2021 SAP, Inc. All Rights Reserved.


Request body:

{
"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"
},

© 2021 SAP, Inc. All Rights Reserved.


{
"name": "Effort Left",
"system_id": "effort_left",
"type_name": "Number",
"type_system_id": 2,
"value": "3",
"value_formatted": "3"
},
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "10",
"value_formatted": "10"
}
],
"description": "This case is created via REST API.",
"name": "REST API - Case 1",
"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-1",
"updated_on": "10/10/13 16:21:10",
"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-1"
}

© 2021 SAP, Inc. All Rights Reserved.


DELETE /cases/{system_id}/custom_fields/{custom_field_system_id}

HTTP Method DELETE


Path /cases/{system_id}/custom_fields/{custom_field_system_id}
Description Deletes the value of specified custom field in specified case.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Custom field value successfully deleted.
404 Not Found – Case or Custom Field not found.
Body ErrorBean - failure.

Request example: DELETE /cases/Task-sp-1/custom_fields/due_date

GET /cases/{system_id}/attachments

HTTP Method GET


Path /cases/{system_id}/attachments
Description Returns a list of attachments from specified case which user who is
performing a REST call has permission to see.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case found.
404 Not Found – Case not found.
Body List of AttachmentBean objects - success.
ErrorBean - failure.

© 2021 SAP, Inc. All Rights Reserved.


JSON example:

There are four attachments in case Task-sp-1:

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.",

© 2021 SAP, Inc. All Rights Reserved.


"system_id": "my_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/my_company_inc"
},
"download_link": "http://localhost:8080/wpm/downloadDocument.do?attachId=29157&tenantName=default",
"internal": true,
"name": "a3-internal-jsmith.txt",
"system_id": "29157",
"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"
}
}
}
]

b) Jane is performing REST call:

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.",

© 2021 SAP, Inc. All Rights Reserved.


"system_id": "other_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/other_company_inc"
},
"download_link": "http://localhost:8080/wpm/downloadDocument.do?attachId=29151&tenantName=default",
"internal": true,
"name": "a4-internal-jane.txt",
"system_id": "29151",
"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"
}
}
}
]

GET /cases/{system_id}/attachments/{attachment_system_id}

HTTP Method GET


Path /cases/{system_id}/attachments/{attachment_system_id}
Description Returns (downloads) attached file with specified attachment system id
from case with specified system id.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/octet-stream
Expected request body N/A
Response - Output
Return MIME Type application/octet-stream
HTTP Status Code 200 OK – Case found.
400 Bad Request – Case does not contain specified attachment.
403 Forbidden – Attachment is not visible for requester.
404 Not Found – Case or Attachment not found.
Body List of AttachmentBean objects - success.
ErrorBean - failure.

JSON example:

a) Jonh is performing REST call and he want to download attachment “a1-public-jsmith.txt”


with system_id 29151.

GET cases/Task-sp-1/attachments/29151

© 2021 SAP, Inc. All Rights Reserved.


Response body:

This is a public attachment uploaded by Jonh Smith from My Company Inc.

Response headers:

Content-Disposition: attachment; filename="a1-public-jsmith.txt"


Content-Type: application/octet-stream

b) Jonh is performing REST call and he want to download attachment “a4-internal-jane.txt”


with system_id 29155.

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

© 2021 SAP, Inc. All Rights Reserved.


Response body:

{
"error_code": "PERMISSION_DENIED",
"error_messages": [
"You do not have permission to download this attachment."
]
}

POST /cases/{system_id}/attachments

HTTP Method POST


Path /cases/{system_id}/attachments
Description Uploads attachment to specified case.

Request must have the following header:


Content-Type: multipart/form-data; boundary= …
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body 1. Attachment visibility (true/false) sent as form field with name
“internal”.
2. File with size lesoctets than 20MB uploaded as form field with
name “uploaded_file”.
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 OK – File successfully uploaded.
400 Bad Request – File not sent; file larger than 20MB
404 Not Found – Case not found.
Body AttachmentBean - success.
ErrorBean - failure.

Example HTML form:


<html>
<head>
</head>
<body>
<form action="http://localhost:8080/wpm/api/cases/Task-sp-1/attachments"
enctype="multipart/form-data" method="post">
File: <input type="file" name="uploaded_file">
Visibility:
<input type="radio" value="false" name="internal">Public
<input type="radio" value="true" name="internal">Internal
<input type="submit" value="Attach File" />
</form>
</body>
</html>

© 2021 SAP, Inc. All Rights Reserved.


a) Jonh Smith is uploading public attachment:

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"
}
}
}

b) John Smith is uploading internal attachment

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",

© 2021 SAP, Inc. All Rights Reserved.


"user_type": {
"name": "Partner",
"system_id": "partner"
}
}
}

DELETE /cases/{system_id}/attachments/{attachment_system_id}

HTTP Method DELETE


Path /cases/{system_id}/attachments/{attachment_system_id}
Description Deletes the attachment with specified attachment system idfrom
specified case.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Attachment successfully deleted.
400 Bad Request – Case does not contain specified attachment.
403 Forbidden – Requester does not have permission to delete the
attachment.
404 Not Found – Case or attachment not found.
Body ErrorBean - failure.

JSON example:

a) John wants to delete public attachment “a2-public-jane.txt” with system_id 29158.

DELETE /cases/Task-sp-1/attachments/29158

b) John wants to delete internal attachment “a4-internal-jane.txt” with system_id 29151.

DELETE /cases/Task-sp-1/attachments/29151

{
"error_code": "PERMISSION_DENIED",
"error_messages": [
"You do not have permission to delete this attachment."
]
}

© 2021 SAP, Inc. All Rights Reserved.


GET /cases/{system_id}/comments

HTTP Method GET


Path /cases/{system_id}/comments
Description Returns a list of comments from specified case which user who is
performing a REST call has permission to see.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case found.
404 Not Found – Case not found.
Body List of CommentBean objects - success.
ErrorBean - failure.

JSON example:

There are five comments in case Task-sp-2:

1. Public comment by John Smith comment: Public - John


visibility: public
author: John Smith
author’s company: My Company Inc.
system_id: 158868
2. Internal comment by Jonh Smith. comment: Internal - John
visibility: internal
author: John Smith
author’s company: My Company Inc.
system_id: 158869
3. Public comment by Jane Smith comment: Public - Jane
visibility: public
author: Jane Smith
author’s company: Other Company Inc.
system_id: 158871
4. Internal comment by Jane Smith comment: Internal - Jane
visibility: internal
author: Jane Smith
author’s company: Other Company Inc.
system_id: 158872
5. Public comment by John - Reply to Jane's comment: Public - John - Reply to Jane's public
public comment. comment.
visibility: public

© 2021 SAP, Inc. All Rights Reserved.


author: John Smith
author’s company: My Company Inc. system_id: 158875
parent_system_id: 158871

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,

© 2021 SAP, Inc. All Rights Reserved.


"system_id": "158871"
},
{
"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",
"created_on": "11/02/14 12:26:03",
"company": {
"name": "My Company Inc.",
"system_id": "my_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/my_company_inc"
},
"internal": true,
"system_id": "158869"
},
{
"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) Jane is performing REST call:

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,

© 2021 SAP, Inc. All Rights Reserved.


"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": "Internal - Jane",
"created_on": "11/02/14 12:31:14",
"company": {
"name": "Other Company Inc.",
"system_id": "other_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/other_company_inc"
},
"internal": true,
"system_id": "158872"
},
{
"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"
},
{
"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,

© 2021 SAP, Inc. All Rights Reserved.


"system_id": "158868"
}
]

GET /cases/{system_id}/comments/{comment_system_id}

HTTP Method GET


Path /cases/{system_id}/comments/{comment_system_id}
Description Returns a comment with specified comment system id from specified
case.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case and comment found.
400 Bad Request – Case does not contain requested comment.
403 Forbidden - User does not have permission to read specified
comment.
404 Not Found – Case or comment not found.
Body CommentBean - success.
ErrorBean - failure.

JSON example:

a) Jonh is requesting his public comment.

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"
}

b) John is requesting Jane’s internal comment.

130 Workflow API © 2021 SAP, Inc. All Rights Reserved.


GET /cases/Task-sp-1/comments/158872

Reponse body:

{
"error_code": "PERMISSION_DENIED",
"error_messages": [
"You do not have permission to read this comment."
]
}

POST /cases/{system_id}/comments

HTTP Method POST


Path /cases/{system_id}/comments
Description 1. Creates a comment based on received CommentBean in case
with specified system id.
2. Creates a reply to comment with system id
“parent_system_id” if “parent_system_id” is sent via
CommentBean.

In both cases, if author_system_id is left out, user performing REST


API call will be set as comment author.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body CommentBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 OK – Comment successfully added.
403 Forbidden – User does not have permission to reply to specified
comment with system id “parent_system_id”.
404 Not Found – Case not found.
Body CommentBean - success.
ErrorBean - failure.

JSON example:

a) Public comment by John Smith

POST /cases/Task-sp-2/comments

© 2021 SAP, Inc. All Rights Reserved.


Request body:

{
"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",

© 2021 SAP, Inc. All Rights Reserved.


"created_on": "11/02/14 12:26:03",
"company": {
"name": "My Company Inc.",
"system_id": "my_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/my_company_inc"
},
"internal": true,
"system_id": "158869"
}

c) Public comment by Jane Smith

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"
}

d) Internal comment by Jane Smith.

POST /cases/Task-sp-2/comments

Request body:

{
"comment": "Internal - Jane",
"internal": "true"
}

Reponse body:

© 2021 SAP, Inc. All Rights Reserved.


"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": "Internal - Jane",
"created_on": "11/02/14 12:31:14",
"company": {
"name": "Other Company Inc.",
"system_id": "other_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/other_company_inc"
},
"internal": true,
"system_id": "158872"
}

e) Jonh is replying to public comment by Jane with system_id 158871.

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"
}

f) John is replying to internal comment by Jane with system_id 158872.

POST /cases/Task-sp-2/comments

© 2021 SAP, Inc. All Rights Reserved.


{
"comment": "Internal - John - Reply to Jane's internal comment.",
"internal": "false",
"parent_system_id": "158872"
}

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}

HTTP Method PUT


Path /cases/{system_id}/comments/{comment_system_id}
Description Updates a comment based on received CommentBean in case with
specified system id.

Note: Comment visibility cannot be changed.


Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body CommentBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Comment successfully updated.
403 Forbidden – User does not have permission to edit specified
comment.
400 Bad Request – Case does not contain specified comment.
404 Not Found – Case or Comment not found.
Body CommentBean - success.
ErrorBean - failure.

JSON example:

a) John wants to update his public comment with system id 158868.

PUT /cases/Task-sp-2/comments/158868

© 2021 SAP, Inc. All Rights Reserved.


{
"comment": "Public - John - UPDATED"
}

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"
}
}
}

b) John wants to update Jane’s internal comment with system id 158872.

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."
]
}

© 2021 SAP, Inc. All Rights Reserved.


DELETE /cases/{system_id}/comments/{comment_system_id}

HTTP Method DELETE


Path /cases/{system_id}/comments/{comment_system_id}
Description Deletes a comment with specified comment system id in case with
specified system id.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Comment successfully deleted.
400 Bad Request – Case does not contain specified comment.
403 Forbidden – Requester does not have permission to delete the
comment.
404 Not Found – Case or comment not found.
Body ErrorBean - failure.

JSON example:

a) John wants to delete public his public comment with system_id 158868.

DELETE /cases/Task-sp-1/comments/158868

b) John wants to delete Jane’s internal comment with system_id 158872.

DELETE /cases/Task-sp-1/comments/158872

{
"error_code": "PERMISSION_DENIED",
"error_messages": [
"You do not have permission to delete this comment."
]
}

© 2021 SAP, Inc. All Rights Reserved.


GET /cases/{system_id}/actions

HTTP Method GET


Path /cases/{system_id}/actions
Description Returns all actions which user who is performing REST call can execute
in specified case.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case found.
404 Not Found – Case not found.
Body List of ActionBean objects - success.
ErrorBean - failure.

JSON example:

Jonh is performing a REST call requesting a list of actions he can execute.

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"
},
{

© 2021 SAP, Inc. All Rights Reserved.


"name": "Change Workflow",
"system_id": "1513",
"type": "Change Workflow"
},
{
"name": "Change Project",
"system_id": "1629",
"type": "Change Project"
},
{
"name": "Close",
"system_id": "390",
"type": "Close"
},
{
"name": "Delete Attachment",
"system_id": "4840", "type":
"Delete Attachment"
},
{
"name": "Delete Case",
"system_id": "1648",
"type": "Delete Case"
},
{
"name": "Delete Comment",
"system_id": "5089",
"type": "Delete Comment"
},
{
"name": "Edit Case",
"system_id": "1142",
"type": "Edit Case"
},
{
"name": "Print Document",
"system_id": "3827",
"type": "Print Document"
},
{
"name": "Send Message",
"system_id": "1414",
"type": "Send Message"
},
{
"name": "Share Case",
"system_id": "3621",
"type": "Share Case"
},
{
"name": "View Case",
"system_id": "1916",
"type": "View Case"
}
]

© 2021 SAP, Inc. All Rights Reserved.


GET /cases/{system_id}/actions/{user_system_id}

HTTP Method GET


Path /cases/{system_id}/actions/{user_system_id}
Description Returns all actions which specified user can execute in specified case.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case found.
404 Not Found – Case or user not found.
Body List of ActionBean objects - success.
ErrorBean - failure.

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",

© 2021 SAP, Inc. All Rights Reserved.


"type": "Delete Attachment"
},
{
"name": "Delete Comment",
"system_id": "5089",
"type": "Delete Comment"
},
{
"name": "Edit Case",
"system_id": "1142",
"type": "Edit Case"
},
{
"name": "Print Document",
"system_id": "3827",
"type": "Print Document"
},
{
"name": "Send Message",
"system_id": "1414",
"type": "Send Message"
},
{
"name": "Share Case",
"system_id": "3621",
"type": "Share Case"
},
{
"name": "View Case",
"system_id": "1916",
"type": "View Case"
}
]

© 2021 SAP, Inc. All Rights Reserved.


PUT /cases/{system_id}/actions/{action_system_id}

HTTP Method PUT


Path /cases/{system_id}/actions/{action_system_id}
Description Executes specified action in specified case.
Case is updated based on received ActionParamsBean.

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

(Attach file action has its own method.)


Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body ActionParamsBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Action successfully executed (except delete case action).
204 No Content – Delete case action executed successfully.
400 Bad Request – Required custom fields are not sent.
403 Forbidden – User does not have permission to to execute action.
404 Not Found – Case or Action not found; child entity with system_id
sent via ActionParamsBean does not exist.
Body CaseBean – success (except delete).
empty – When delete case action is exeuted successfully.
ErrorBean - failure.

© 2021 SAP, Inc. All Rights Reserved.


JSON example:

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",

© 2021 SAP, Inc. All Rights Reserved.


"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",
"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": "2",
"value_formatted": "2"
},
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "15",
"value_formatted": "15"
}
],
"description": "This case is created via RESTful web services.",
"name": "Task 2 - Created via REST",
"owner": {
"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"
}
},
"priority": {
"name": "High",

© 2021 SAP, Inc. All Rights Reserved.


"system_id": "Critical"
},
"project": {
"description": "",
"is_default": false,
"name": "Sales Project",
"system_id": "sp",
"uri": "http://localhost:8080/wpm/api/projects/sp"
},
"referral": {
"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"
}
},
"status": {
"name": "Described",
"system_id": "described"
},
"status_changed_on": "10/15/2013 15:35:19",
"system_id": "Task-sp-2",
"updated_on": "10/15/2013 15:59:53",
"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"
}
},
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-2"
}

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"
}
]
}

© 2021 SAP, Inc. All Rights Reserved.


b) Internal comment

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

Note: Case goes into action’s end 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

© 2021 SAP, Inc. All Rights Reserved.


Request body:

{
"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": [
{

© 2021 SAP, Inc. All Rights Reserved.


"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": "jsmith_someaddress_com",
"uri": "http://localhost:8080/wpm/api/contacts/jsmith_someaddress_com"
},
"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": "2",
"value_formatted": "2"
},
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "15",
"value_formatted": "15"
}
],
"description": "Updating description via Edit action",
"name": "Task 2 updated via Edit action",

© 2021 SAP, Inc. All Rights Reserved.


"owner": {
"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"
}
},
"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"
},
"referral": {
"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"
}
},
"status": {
"name": "Described",
"system_id": "described"
},
"system_id": "Task-sp-2",
"updated_on": "14/10/13 14:07:15",
"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"
}
},
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-2"
}

© 2021 SAP, Inc. All Rights Reserved.


6) Delete Case

Note: Request body must contain empty JSON.

PUT /cases/Task-sp-2/actions/my_delete_action

Request body:

{}

Response:

Response body: empty


Status: 204 No Content

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"
}
]
}

© 2021 SAP, Inc. All Rights Reserved.


8) Copy Case

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": {

© 2021 SAP, Inc. All Rights Reserved.


"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": "5",
"value_formatted": "5"
},
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "15",
"value_formatted": "15"
}
],
"description": "Updating description via Edit action",
"name": "Task 2 updated via Edit action",
"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-10",
"updated_on": "15/10/13 14:27:54",
"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"
}
},
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-10"
}

© 2021 SAP, Inc. All Rights Reserved.


9) Change Case Type

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",

© 2021 SAP, Inc. All Rights Reserved.


"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": "10",
"value_formatted": "10"
},
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "15",
"value_formatted": "15"
}
],
"description": "Updating description via Edit action",
"name": "Task 2 updated via Edit action",
"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": "Bug-sp-1",
"updated_on": "15/10/13 14:42:29",
"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"
}
},
"uri": "http://localhost:8080/wpm/api/cases/Bug-sp-1"
}

© 2021 SAP, Inc. All Rights Reserved.


10) Change Project

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",

© 2021 SAP, Inc. All Rights Reserved.


"user_type": {
"name": "Partner",
"system_id": "partner"
}
},
"custom_fields": [
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "15",
"value_formatted": "15"
},
{
"name": "Effort Left",
"system_id": "effort_left",
"type_name": "Number",
"type_system_id": 2,
"value": "1",
"value_formatted": "1"
}
],
"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": "Partner",
"system_id": "partner"
}
},
"priority": {
"name": "Medium",
"system_id": "Non-Critical"
},
"project": {
"description": "",
"is_default": false,
"name": "Another Project",
"system_id": "ap",
"uri": "http://localhost:8080/wpm/api/projects/ap"
},
"status": {
"name": "Described",
"system_id": "described"
},
"system_id": "Task-ap-1",
"updated_on": "15/10/13 15:06:14",
"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"
}
},
"uri": "http://localhost:8080/wpm/api/cases/Task-ap-1"
}

© 2021 SAP, Inc. All Rights Reserved.


11) Approve

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": {

© 2021 SAP, Inc. All Rights Reserved.


"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": "0",
"value_formatted": "0"
},
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "15",
"value_formatted": "15"
}
],
"description": "Updating description via Edit action",
"name": "Task 2 updated via Edit action",
"owner": {
"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"
}
},
"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"
},
"referral": {
"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"
}
},
"status": {
"name": "Task Complete",
"system_id": "task_complete"
},
"status_changed_on": "15/10/13 15:33:15",
"system_id": "Task-sp-2",

© 2021 SAP, Inc. All Rights Reserved.


"updated_on": "15/10/13 15:33:15",
"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"
}
},
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-2"
}

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",

© 2021 SAP, Inc. All Rights Reserved.


"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": "5",
"value_formatted": "5"
},
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "15",
"value_formatted": "15"
}
],
"description": "Updating description via Edit action",
"name": "Task 2 updated via Edit action",
"owner": {
"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"
}
},
"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"
},
"referral": {
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",

160 Workflow API © 2021 SAP, Inc. All Rights Reserved.


"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {
"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"status": {
"name": "Described",
"system_id": "described"
},
"status_changed_on": "15/10/13 15:35:19",
"system_id": "Task-sp-2",
"updated_on": "15/10/13 15:35:19",
"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"
}
},
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-2"
}

13) Scripting Action

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:

currentCase.setName("new name set by executing scripting action via REST");

PUT /cases/Task-sp-2/actions/my_scripting_action

Request body

{
"custom_fields": [
{
"system_id": "effort_left",
"value": "4"
},
{
"system_id": "duration",
"value": "15"
}
]
}

© 2021 SAP, Inc. All Rights Reserved.


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": {
"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"
}

© 2021 SAP, Inc. All Rights Reserved.


],
"description": "Updating description via Edit action",
"name": "new name set by executing scripting action via REST",
"owner": {
"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"
}
},
"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"
},
"referral": {
"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"
}
},
"status": {
"name": "Described",
"system_id": "described"
},
"status_changed_on": "15/10/13 15:35:19",
"system_id": "Task-sp-2",
"updated_on": "15/10/13 15:42:06",
"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"
}
},
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-2"
}

© 2021 SAP, Inc. All Rights Reserved.


PUT /cases/{system_id}/actions/{action_system_id}/{user_system_id}

HTTP Method PUT


Path /cases/{system_id}/actions/{action_system_id}/{user_system_id}
Description Executes specified action in specified case as specified user. (Attach
file action has its own method.)
Case is updated based on received ActionParamsBean.

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

(Attach file action has its own method.)


Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body ActionParamsBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Action successfully executed (except delete case action).
204 No Content – Delete case action executed successfully.
400 Bad Request – Required custom fields are not sent.
403 Forbidden – User does not have permission to to execute action.
404 Not Found – Case, Action or User not found; child entity with
system_id sent via ActionParamsBean does not exist.
Body CaseBean – success (except delete).
empty – When delete case action is exeuted successfully.
ErrorBean - failure.

© 2021 SAP, Inc. All Rights Reserved.


JSON example:

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",

© 2021 SAP, Inc. All Rights Reserved.


"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",
"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": "6",
"value_formatted": "6"
},
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "15",
"value_formatted": "15"
}
],
"description": "This case is created via REST API.",
"name": "Task 2 – created via REST API",
"owner": {
"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"
}
},
"priority": {
"name": "High",
"system_id": "Critical"
},

© 2021 SAP, Inc. All Rights Reserved.


"project": {
"description": "",
"is_default": false,
"name": "Sales Project",
"system_id": "sp",
"uri": "http://localhost:8080/wpm/api/projects/sp"
},
"referral": {
"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"
}
},
"status": {
"name": "Described",
"system_id": "described"
},
"status_changed_on": "10/15/2013 15:35:19",
"system_id": "Task-sp-2",
"updated_on": "10/15/2013 16:32:34",
"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-2"
}

© 2021 SAP, Inc. All Rights Reserved.


2. POST /cases/{system_id}/actions/{action_system_id}

HTTP Method POST


Path /cases/{system_id}/actions/{action_system_id}
Description Executes specified Attach File action in specified case.

Request must have the following header:


Content-Type: multipart/form-data; boundary= …
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body 1. File with size less than 20MB uploaded as form field with
name “uploaded_file”.
2. Attachment visibility sent as form field with name “internal”.
Values true/false.
3. Comment sent as form field with name “comment”.
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Action successfully executed.
403 Forbidden – User does not have permission to to execute action.
400 Bad Request – File not sent; file larger than 20MB;
404 Not Found – Case or Action not found.
Body CaseBean – success.
ErrorBean - failure.

Example HTML form:

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

© 2021 SAP, Inc. All Rights Reserved.


Request example:

John Smith is uploading attachment using Attach File Action.

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",

© 2021 SAP, Inc. All Rights Reserved.


"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": "6",
"value_formatted": "6"
},
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "15",
"value_formatted": "15"
}
],
"description": "Updating description via Edit action",
"name": "new name set by executing scripting action via REST",
"owner": {
"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"
}
},
"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"
},
"referral": {
"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"
}
},
"status": {
"name": "Described",
"system_id": "described"
},
"status_changed_on": "10/15/2013 15:35:19",

© 2021 SAP, Inc. All Rights Reserved.


"system_id": "Task-sp-2",
"updated_on": "10/16/2013 11:40:46",
"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"
}
},
"uri": "http://localhost:8080/wpm/api/cases/Task-sp-2"
}

3. POST /cases/{system_id}/actions/{action_system_id}/{user_system_id}

HTTP Method POST


Path /cases/{system_id}/actions/{action_system_id}/{user_system_id}
Description Executes specified Attach File action in specified case as specified
user.

Request must have the following header:


Content-Type: multipart/form-data; boundary= …
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body 1. File with size less than 20MB uploaded as form field with
name “uploaded_file”.
2. Attachment visibility sent as form field with name “internal”.
Values true/false.
3. Comment sent as form field with name “comment”.
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Action successfully executed.
403 Forbidden – User does not have permission to to execute action.
400 Bad Request – File not sent; file larger than 20MB;
404 Not Found – Case, Action or user not found.
Body CaseBean – success.
ErrorBean - failure.

Example HTML form:

<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

© 2021 SAP, Inc. All Rights Reserved.


<br />
Comment: <input type="text" name="comment">
<br />
<INPUT type="submit" value="Upload"> <INPUT type="reset">
</form>
</body>
</html>

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,

© 2021 SAP, Inc. All Rights Reserved.


"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",
"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": "6",
"value_formatted": "6"
},
{
"name": "Duration",
"system_id": "duration",
"type_name": "Number",
"type_system_id": 2,
"value": "15",
"value_formatted": "15"
}
],
"description": "Updating description via Edit action",
"name": "new name set by executing scripting action via REST",
"owner": {
"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"
}
},
"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"
},
"referral": {
"first_name": "Tom",
"last_name": "Smith",
"login_name": "tsmith",
"system_id": "tsmith",
"uri": "http://localhost:8080/wpm/api/users/tsmith",
"user_type": {

© 2021 SAP, Inc. All Rights Reserved.


"name": "Sales and Marketing",
"system_id": "sales_and_marketing"
}
},
"status": {
"name": "Described",
"system_id": "described"
},
"status_changed_on": "10/15/2013 15:35:19",
"system_id": "Task-sp-2",
"updated_on": "10/16/2013 11:40:46",
"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-2"
}

© 2021 SAP, Inc. All Rights Reserved.


Case Type
Resource: Case Types Main path: /case_types

GET /case_types/{system_id}

HTTP Method GET


Path /case_types/{system_id}
Description Returns the case type with specified system id.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case Type found.
404 Not Found – Case Type not found.
Body CaseTypeBean - success.
ErrorBean - failure.

JSON example:

a) GET /case_types/task

Response body:

{
"name": "Task",
"system_id": "task",
"unique_key": "task"
}

© 2021 SAP, Inc. All Rights Reserved.


GET /case_types

HTTP Method GET


Path /case_types
Description Search case types based on set query parameters. Returns a list of case types
which satisfy search criteria.

Available search attributes:


page (Number) page_size (Number) name (String) system_id (String) mask (String)

These search attributes are set as query parameters:


/case_types?name=task&page=1&page_size=5

Required headers Authorization, domain, Accept


Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with list of CaseTypeBeans.

JSON example: Response body:


GET /case_types?name=task&page=1&page_size=5

{
"case_types": [
{
"name": "Task",
"system_id": "task",
"unique_key": "task"
}
],
"completed_in": 35,
"page": 1,
"page_size": 10,
"total": 1
}

© 2021 SAP, Inc. All Rights Reserved.


GET /case_types/{system_id}/statuses

HTTP Method GET


Path /case_types/{system_id}/statuses
Description Returns statuses associated with specified case type.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case Type found.
404 Not Found – Case Type not found.
Body List of StatusBeans - success.
ErrorBean - failure.

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"
}
]

© 2021 SAP, Inc. All Rights Reserved.


GET /case_types/{system_id}/statuses/{status_system_id}/actions

HTTP Method GET


Path /case_types/{system_id}/statuses/{status_system_id}/actions
Description Returns actions in specified status for specified case type.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Case Type found.
404 Not Found – Case Type or Status not found.
Body List of ActionBeans - success.
ErrorBean - failure.

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"
}
]

© 2021 SAP, Inc. All Rights Reserved.


Company
Resource: Company Main path: /companies

GET /companies/{system_id}

HTTP Method GET


Path /companies/{system_id}
Description Returns the company with specified system id.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Company found.
404 Not Found – Company not found.
Body CompanyBean - success.
ErrorBean - failure.

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"
}

© 2021 SAP, Inc. All Rights Reserved.


b) GET /companies/some_non_existing_company

{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Company does not exist."
]
}

POST /companies

HTTP Method POST


Path /companies
Description Creates a company based on received CompanyBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body CompanyBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – Company successfully created.
400 Bad Request – Required fields are missing or other constraint
error.
Body CompanyBean - success.
ErrorBean - failure.

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"
}

© 2021 SAP, Inc. All Rights Reserved.


"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"Company name is required."
]
}

PUT /companies

HTTP Method PUT


Path /companies
Description Updates the company based on received CompanyBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body CompanyBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Company successfully updated.
400 Bad Request – Required fields are missing or other constraint
error.
404 Not Found – Company not found.
Body CompanyBean - success.
ErrorBean - failure.

JSON example:

Note: CompanyBean‘s “system_id” field must be set.

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"
}

© 2021 SAP, Inc. All Rights Reserved.


Response body:

{
"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}

HTTP Method DELETE


Path /companies/{system_id}
Description Deletes the company with specified system id.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Company successfully deleted.
304 Not Modified – If company could not be deleted.
404 Not Found – Company not found.
Body ErrorBean - failure.

Request example: DELETE /companies/my_company_inc

© 2021 SAP, Inc. All Rights Reserved.


GET /companies

HTTP Method GET


Path /companies
Description Search companies based on set query parameters. Returns a list of companies
which satisfy search criteria.

Available search attributes:


page (Number) page_size (Number) name (String) system_id (String) mask (String)

These search attributes are set as query parameters:


/companies?name=inc&page=1&page_size=5

Required headers Authorization, domain, Accept


Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with list of CompanyBeans.

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"
},
{

© 2021 SAP, Inc. All Rights Reserved.


"address_1": "Fake Street 567",
"address_2": "",
"city": "New York",
"country": "USA",
"name": "Other company Inc.",
"state": "New York",
"system_id": "other_company_inc",
"uri": "http://localhost:8080/wpm/api/companies/other_company_inc",
"zip": "45678"
},

],
"completed_in": 68,
"page": 1,
"page_size": 5,
"total": 1
}

© 2021 SAP, Inc. All Rights Reserved.


Contact
Resource: Contact Main path: /contacts

GET /contacts/{system_id}

HTTP Method GET


Path /contacts/{system_id}
Description Returns the contact with specified system id.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Contact found.
404 Not Found – Contact not found.
Body ContactBean - success.
ErrorBean - failure.

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",

© 2021 SAP, Inc. All Rights Reserved.


"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"
}

b) GET /contacts/some_non_existing_contact

{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Contact does not exist."
]
}

POST /contacts

HTTP Method POST


Path /contacts
Description Creates a contact based on received ContactBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body ContactBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – Contact successfully created.
400 Bad Request – Required fields are missing or other constraint
error.
Body ContactBean - success.
ErrorBean - failure.

© 2021 SAP, Inc. All Rights Reserved.


JSON example:

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"
}

b) If contact name which is required is not sent:

{
"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"Contact name is required."
]
}

© 2021 SAP, Inc. All Rights Reserved.


PUT /contacts

HTTP Method PUT


Path /contacts
Description Updates the contact based on received ContactBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body ContactBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Contact successfully updated.
400 Bad Request – Required fields are missing or other constraint
error.
404 Not Found – Contact not found.
Body ContactBean - success.
ErrorBean - failure.

JSON example:

Note: ContactBean’s “system_id” field must be set.

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"
}

© 2021 SAP, Inc. All Rights Reserved.


Response body:

{
"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}

HTTP Method DELETE


Path /contacts/{system_id}
Description Deletes the contact with specified system id.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Contact successfully deleted.
304 Not Modified – If contact could not be deleted.
404 Not Found – Contact not found.
Body ErrorBean - failure.

Request example: DELETE /contacts/jsmith_someaddress_com

© 2021 SAP, Inc. All Rights Reserved.


GET /contacts

HTTP Method GET


Path /contacts
Description Search contacts based on set query parameters. Returns a list of
contacts which satisfy search criteria.

Available search attributes:


page (Number)
page_size (Number)
system_id (String)
name (String)
first_name (String)
last_name (String)
email (String)
account (String) (account’s name)
mask (String)

These search attributes are set as query parameters:


/contacts?first_name=john&page=1&page_size=5
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with a list of ContactBeans.

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",

190 Workflow API © 2021 SAP, Inc. All Rights Reserved.


"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": "Cell Phone",
"system_id": "cell_phone",
"type_name": "Text",
"type_system_id": 1,
"value": "555-555-789",
"value_formatted": "555-555-789"
}
],
"department": "",
"email": "[email protected]",
"fax": "555-555-741",
"first_name": "John",
"home_phone": "555-555-789",
"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"
}
],
"page": 1,
"page_size": 5,
"total": 1
}

GET /contacts/{system_id}/custom_fields/{custom_field_system_id}

HTTP Method GET


Path /contacts/{system_id}/custom_fields/{custom_field_system_id}
Description Returns specified custom field with its value which is set for specified
contact.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A

© 2021 SAP, Inc. All Rights Reserved.


Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Custom Field found.
404 Not Found – Contact or Custom Field not found.
Body CustomFieldBean - success.
ErrorBean - failure.

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

HTTP Method POST


Path /contacts/{system_id}/custom_fields
Description Sets custom field value to specified contact based on received
CustomFieldBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body CustomFieldBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – CustomField value set successfully.
400 Bad Request – Custom Field value is not in the right format.
404 Not Found – Contact or Custom Field not found
Body ContactBean - success.
ErrorBean - failure.

JSON example:

POST /contacts/jsmith_someaddress_com/custom_fields

© 2021 SAP, Inc. All Rights Reserved.


Request body:

{
"system_id": "contact_role",
"value": "consultant"
}

PUT /contacts/{system_id}/custom_fields

HTTP Method PUT


Path /contacts/{system_id}/custom_fields
Description Updates custom field value in specified contact based on received
CustomFieldBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body CustomFieldBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 200 OK – CustomField value set successfully.
400 Bad Request – Custom Field value is not in the right format.
404 Not Found – Contact or Custom Field not found
Body ContactBean - success.
ErrorBean - failure.

JSON example:

PUT /contact/jsmith_someaddress_com/custom_fields

Request body:

{
"system_id": "contact_role",
"value": "business_analyst"
}

© 2021 SAP, Inc. All Rights Reserved.


DELETE /contacts/{system_id}/custom_fields/{custom_field_system_id}

HTTP Method DELETE


Path /contacts/{system_id}/custom_fields/{custom_field_system_id}
Description Deletes the value of specified custom field for specified contact.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Custom field value successfully deleted.
404 Not Found – Contact or Custom Field not found.
Body ErrorBean - failure.

Request example:

DELETE /contacts/jsmith_someaddress_com/custom_fields/contact_role

© 2021 SAP, Inc. All Rights Reserved.


Custom Field
Resource: Custom Field Main path: /custom_fields

GET /custom_fields/{system_id}

HTTP Method GET


Path /custom_fields/{system_id}
Description Returns the custom field with specified system id.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Custom Field found.
404 Not Found – Custom Field not found.
Body CustomFieldBean - success.
ErrorBean - failure.

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"
}
],

© 2021 SAP, Inc. All Rights Reserved.


"system_id": "product_category",
"type_name": "Checkbox",
"type_system_id": 8,
"uri": "http://localhost:8080/wpm/api/custom_fields/product_category"
}

b) GET /custom_fields/some_non_existing_custom_field

{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Custom field does not exist."
]
}

POST /custom_fields

HTTP Method POST


Path /custom_fields
Description Creates a custom field based on received CustomFieldBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body CustomFieldBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – Custom Field successfully created.
400 Bad Request – Required fields are missing or other constraint
error.
Body CustomFieldBean - success.
ErrorBean - failure.

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"
},

© 2021 SAP, Inc. All Rights Reserved.


{
"disabled": false,
"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": 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"
}

b) If custom field’s fields which are required are not sent:

{
"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"CustomField label is required.",
"CustomField field type is required.",
"CustomField system id is required.",
"CustomField name is required."
]
}

© 2021 SAP, Inc. All Rights Reserved.


PUT /custom_fields

HTTP Method PUT


Path /custom_fields
Description Updates the custom field based on received CustomFieldBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body CustomFieldBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Custom Field successfully updated.
400 Bad Request – Required fields are missing or other constraint
error.
404 Not Found – Custom Field not found.
Body CustomFieldBean - success.
ErrorBean - failure.

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"
}
]

© 2021 SAP, Inc. All Rights Reserved.


}

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}

HTTP Method DELETE


Path /custom_fields/{system_id}
Description Deletes the custom field with specified system id.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Custom Field successfully deleted.
304 Not Modified – If Custom Field could not be deleted.
404 Not Found – Custom Field not found.
Body ErrorBean - failure.

Request example: DELETE /custom_fields/product_category

© 2021 SAP, Inc. All Rights Reserved.


GET /custom_fields

HTTP Method GET


Path /custom_fields
Description Search custom fields based on set query parameters. Returns a list of
custom fields which satisfy search criteria.

Available search attributes:


page (Number)
page_size (Number)
system_id (String)
name (String)
mask (String)

These search attributes are set as query parameters:


/custom_fields?name=product&page=1&page_size=5
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with a list of CustomFieldBeans.

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"

200 Workflow API © 2021 SAP, Inc. All Rights Reserved.


},
{
"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"
}
],
"page": 1,
"page_size": 5,
"total": 1
}

© 2021 SAP, Inc. All Rights Reserved.


Custom Table
Resource: Custom Table Main path: /custom_tables

GET /custom_tables/{system_id}

HTTP Method GET


Path /custom_tables/{system_id}
Description Returns the custom table with specified system id.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Custom Table found.
404 Not Found – Custom Table not found.
Body CustomTableBean- success.
ErrorBean - failure.

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."
]
}

© 2021 SAP, Inc. All Rights Reserved.


POST /custom_tables

HTTP Method POST


Path /custom_tables
Description Creates a custom table based on received CustomTableBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body CustomTableBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – Custom Table successfully created.
400 Bad Request – Required fields are missing or other constraint
error.
Body CustomTableBean - success.
ErrorBean - failure.

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"
}

© 2021 SAP, Inc. All Rights Reserved.


b) If custom table name which is required is not sent:

{
"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"CustomTable name is required."
]
}

DELETE /custom_tables/{system_id}

HTTP Method DELETE


Path /custom_tables/{system_id}
Description Deletes the custom table with specified system id.
Required headers Authorization, domain, Accept
Returned headers Status code
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Custom Table successfully deleted.
400 Bad Request – If Custom Table could not be deleted.
404 Not Found – Custom Table not found.
Body ErrorBean - failure.

Request example: DELETE /custom_tables/territory

© 2021 SAP, Inc. All Rights Reserved.


GET /custom_tables

HTTP Method GET


Path /custom_tables
Description Search custom tables based on set query parameters. Returns a list of custom tables
which satisfy search criteria.

Available search attributes:


page (Number) page_size (Number) name (String) system_id (String) mask (String)

These search attributes are set as query parameters:


/custom_tables?name=territory&page=1&page_size=5

Required headers Authorization, domain, Accept


Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with list of CustomTableBeans.

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
}

© 2021 SAP, Inc. All Rights Reserved.


POST /custom_tables/{system_id}/column/{column_name}

HTTP Method POST


Path /custom_tables/{system_id}/column/{column_name}
Description Adds a column with specified name into specified custom table.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Column successfully added.
400 Bad Request – Column not added.
404 Not Found – Custom Table not found.
Body CustomTableBean - success.
ErrorBean - failure.

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"
}

© 2021 SAP, Inc. All Rights Reserved.


GET /custom_tables/{system_id}/rows

HTTP Method GET


Path /custom_tables/{system_id}/rows
Description Returns rows from specified custom table.

Available search attributes:


page (Number)
page_size (Number)

These search attributes are set as query parameters:


/custom_tables/territory/rows? page=1&page_size=5
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Custom Table found.
400 Bad Request - Getting rows failed - Error in operations with
custom table.
404 Not Found – Custom Table not found.
Body ResultBean with CustomTableBean object which contains rows -
success.
ErrorBean - failure.

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"

© 2021 SAP, Inc. All Rights Reserved.


},
{
"name": "LOCATION",
"value": "USA"
}
],
"oid": "1"
},
{
"cells": [
{
"name": "OID",
"value": "2"
},
{
"name": "NAME",
"value": "Europe 1"
},
{
"name": "NUMBER_OF_STORES",
"value": "20"
},
{
"name": "LOCATION",
"value": "Western Europe"
}
],
"oid": "2"
}
]
},
"page": 1,
"page_size": 5,
"total": 2
}

GET /custom_tables/{system_id}/rows/{oid}

HTTP Method GET


Path /custom_tables/{system_id}/rows/{oid}
Description Returns row with specified oid (object id) from specified custom table.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Row found.
400 Bad Request – Getting row failed - Error in operations with
custom table.
404 Not Found – Custom Table or Row not found.
Body ResultBean with CustomTableBean object which contains rows -
success.
ErrorBean - failure.

© 2021 SAP, Inc. All Rights Reserved.


a) GET /custom_tables/territory/rows/2

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

HTTP Method POST


Path /custom_tables/{system_id}/rows
Description Adds one row in specified custom table based on received row in
CustomTableBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body CustomTableBean with one row.
Response - Output
Return MIME Type application/json
HTTP Status Code 201 OK – Row successfully added.
400 Bad Request – Creating row failed - Error in operations with
custom table.
404 Not Found – Custom Table not found.
Body CustomFieldBean with added row. Other rows are left out.
ErrorBean - failure.

© 2021 SAP, Inc. All Rights Reserved.


POST /custom_tables/territory/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"
}
]
}

210 Workflow API © 2021 SAP, Inc. All Rights Reserved.


PUT /custom_tables/{system_id}/rows

HTTP Method PUT


Path /custom_tables/{system_id}/rows
Description Updates the row in specified custom table based on received row in
CustomTableBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body CustomTableBean with one row.
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Row successfully updated.
400 Bad Request – Updating row failed - Error in operations with
custom table.
404 Not Found – Custom Table or row not found.
Body CustomFieldBean with updated row. Other rows are left out.
ErrorBean - failure.

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"
}
]
}
]
}

© 2021 SAP, Inc. All Rights Reserved.


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"
}
]
}

DELETE /custom_tables/{system_id}/rows/{oid}

HTTP Method DELETE


Path /custom_tables/{system_id}/rows/{oid}
Description Deletes the row with specified oid in specified custom table.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Row successfully deleted.
400 Bad Request – Deleting row failed - Error in operations with
custom table.
404 Not Found – Custom Table or row not found.
Body ErrorBean - failure.

Request example: DELETE /custom_tables/territory/rows/3

© 2021 SAP, Inc. All Rights Reserved.


PUT /custom_tables/query/select

HTTP Method PUT


Path /custom_tables/query/select
Description Executes select query sent via QueryBean and returns rows from
custom table. Number of returned results can be limited using page
(Number) and page_size (Number) search attributes.

These search attributes are set as query parameters:


/custom_tables/query/select?page=1&page_size=5

Illegal query words: CREATE, ALTER, DROP, TRUNCATE, COMMENT,


RENAME, INSERT, UPDATE, DELETE, MERGE, GRANT, REVOKE, OFFSET,
LIMIT.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body QueryBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Select query successfully executed.
400 Bad Request – Select query not executed.
Body QueryResultBean - success.
ErrorBean - failure.

Example table:

OID NAME NUMBER_OF_STORES LOCATION


1 Africa 25 Africa
2 Europe 42 Western Europe
3 USA 26 West coast
4 Asia 9 Asia

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"
}

© 2021 SAP, Inc. All Rights Reserved.


Response body:

{
"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

HTTP Method POST


Path /custom_tables/query/insert
Description Inserts data into custom table based on sent query in QueryBean.

Illegal query words: CREATE, ALTER, DROP, TRUNCATE, COMMENT,


RENAME, UPDATE, DELETE, MERGE, GRANT, REVOKE, OFFSET, LIMIT.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body QueryBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Insert query successfully executed.
400 Bad Request – Insert query not executed.
Body QueryResultBean with row OID - success.
ErrorBean - failure.

© 2021 SAP, Inc. All Rights Reserved.


Example table:

OID NAME NUMBER_OF_STORES LOCATION


1 Africa 25 Africa
2 Europe 42 Western Europe
3 USA 26 West coast
4 Asia 9 Asia

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
}

Table after inserting row:

OID NAME NUMBER_OF_STORES LOCATION


1 Africa 25 Africa
2 Europe 42 Western Europe
3 USA 26 West coast
4 Asia 9 Asia
5 Europe 2 15 South Europe

© 2021 SAP, Inc. All Rights Reserved.


PUT /custom_tables/query/update

HTTP Method PUT


Path /custom_tables/query/update
Description Updates data in custom table based on sent query in QueryBean.

Illegal query words: CREATE, ALTER, DROP, TRUNCATE, COMMENT,


RENAME, INSERT, DELETE, MERGE, GRANT, REVOKE, OFFSET, LIMIT.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body QueryBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Update query successfully executed.
400 Bad Request – Update query not executed.
Body QueryResultBean - success.
ErrorBean - failure.

Example table:

OID NAME NUMBER_OF_STORES LOCATION


1 Africa 25 Africa
2 Europe 42 Western Europe
3 USA 26 West coast
4 Asia 9 Asia
5 Europe 2 15 South Europe

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
}

© 2021 SAP, Inc. All Rights Reserved.


Table after updating row:

OID NAME NUMBER_OF_STORES LOCATION


1 Africa 25 Africa
2 Europe 1 42 Western Europe
3 USA 26 West coast
4 Asia 9 Asia
5 Europe 2 15 South Europe

PUT /custom_tables/query/delete

HTTP Method PUT


Path /custom_tables/query/delete
Description Updates data in custom table based on sent query in QueryBean.

Illegal query words: CREATE, ALTER, DROP, TRUNCATE, COMMENT,


RENAME, INSERT, UPDATE, MERGE, GRANT, REVOKE, OFFSET, LIMIT.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body QueryBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Delete query successfully executed.
400 Bad Request – Delete query not executed.
Body QueryResultBean - success.
ErrorBean - failure.

Example table:

OID NAME NUMBER_OF_STORES LOCATION


1 Africa 25 Africa
2 Europe 1 42 Western Europe
3 USA 26 West coast
4 Asia 9 Asia
5 Europe 2 15 South Europe

JSON example:

a) PUT /custom_tables/query/delete

© 2021 SAP, Inc. All Rights Reserved.


Request body:

{
"query": "delete from territory where name like '%Europe%'"
}

Response body:

{
"affected_rows_count": 2,
"completed_in": 56
}

Table after deleting row:

OID NAME NUMBER_OF_STORES LOCATION


1 Africa 25 Africa
3 USA 26 West coast
4 Asia 9 Asia

POST /custom_tables/import/new_table

HTTP Method POST


Path /custom_tables/import/new_table
Description Creates a new custom table with rows from uploaded csv file.

Request must have the following header:


Content-Type: multipart/form-data; boundary= …
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request – Input
Accepts application/json
Expected request body 1. Table name sent as form field with name “table_name”.
2. csv file with size less than 20MB uploaded as form field with
name “uploaded_file”.
Response - Output
Return MIME Type application/json
HTTP Status Code 201 OK – New table successfully imported.
400 Bad Request – File or table name not sent; file larger than 20MB;
table already exists; file is not csv file import failed.
Body CustomTableBean with import report (without rows) - success
ErrorBean - failure.

© 2021 SAP, Inc. All Rights Reserved.


Example csv file content:

name,number_of_stores,location
Europe, 10, Southern Europe
USA, 25, West Coast
Africa, 5, West Africa

Example HTML form:


<html>
<head>
</head>
<body>
<form action="http://localhost:8080/wpm/api/custom_tables/import/new_table"
enctype="multipart/form-data" method="post">
Table Name: <input type="text" name="table_name" />
File: <input type="file" name="uploaded_file">
<input type="submit" value="Import Table" />
</form>
</body>
</html>

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"
}

© 2021 SAP, Inc. All Rights Reserved.


Created table:

OID NAME NUMBER_OF_STORES LOCATION


1 Europe 10 Southern Europe
2 USA 25 West Coast
3 Africa 5 West Africa

POST /custom_tables/{system_id}/import/new_rows

HTTP Method POST


Path /custom_tables/{system_id}/import/new_rows
Description Inserts new rows in specified custom table from uploaded csv file and
updates existing rows. Rows which are left out from the file are not
updated.

Existing rows must have OID value:


1, Europe 1, 12, Southern Europe

New rows have empty OID value followed by comma separator:


,Europe 2, 15, East Europe

Request must have the following header:


Content-Type: multipart/form-data; boundary= …
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request – Input
Accepts application/json
Expected request body 1. Table name sent as form field with name “table_name”.
2. csv file with size less than 20MB uploaded as form field with
name “uploaded_file”.
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – New rows successfully inserted.
400 Bad Request – File or table name not sent; file larger than 20MB;
table already exists; file is not csv file import failed.
404 Not Found – Custom table not found.
Body CustomTableBean with import report (without rows) - success
ErrorBean - failure.

220 Workflow API © 2021 SAP, Inc. All Rights Reserved.


Example csv file content:

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

Example HTML form:


<html>
<head>
</head>
<body>
<form action="http://localhost:8080/wpm/api/custom_tables/territory/import/new_rows"
enctype="multipart/form-data" method="post">
File: <input type="file" name="uploaded_file">
<input type="submit" value="Import Table" />
</form>
</body>
</html>

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"
}

© 2021 SAP, Inc. All Rights Reserved.


Updated table:

OID NAME NUMBER_OF_STORES LOCATION


1 Europe 1 12 Southern Europe
2 USA 25 West Coast
3 Africa 5 West Africa
4 Europe 2 15 East Europe
5 Australia 12 Australia and New
Zealand

PUT /custom_tables/export/query_to_csv

HTTP Method PUT


Path /custom_tables/export/query_to_csv
Description Exports rows from custom table to CSV file based on received SELECT
query in QueryBean.

If file name is empty it will be set to “exportedRows.csv”.

Returned result can be limited with these parameters:


page (Number)
page_size(Number)

These parameters are set as query parameters:


/custom_tables/export/query_to_csv?page=1&page_size=2000

Maximum number of rows (maximum page_size) in exported file is


limited to 100000. If page_size parameter is not received, default
page size is 50000.

Illegal query words: CREATE, ALTER, DROP, TRUNCATE, COMMENT,


RENAME, INSERT, UPDATE, DELETE, MERGE, GRANT, REVOKE, OFFSET,
LIMIT.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/octet-stream
Expected request body QueryBean
Response - Output
Returned MIME Type application/vnd.ms-excel
HTTP Status Code 200 OK – CSV file returned successfully.
400 Bad Request – Query not provided; Query failed (Custom table
does not exist; Illegal query)
Body CSV file - success.
ErrorBean - failure.

© 2021 SAP, Inc. All Rights Reserved.


Example table myStores:

OID NAME NUMBER_OF_STORES LOCATION


1 Africa 25 Africa
2 Europe 42 Western Europe
3 USA 26 West Coast
4 Asia 9 Asia

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
}

Response body – csv file content:

NAME,NUMBER_OF_STORES,LOCATION
USA,26,West Coast
Europe,42,Western Europe

Response headers:

Content-Disposition: attachment; filename="big_market.csv"


Content-Type: application/vnd.ms-excel

© 2021 SAP, Inc. All Rights Reserved.


Department
Resource: Department Main path: /departments

GET /departments/{system_id}

HTTP Method GET


Path /departments/{system_id}
Description Returns the department with specified system id.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Department found.
404 Not Found – Department not found.
Body DepartmentBean - success.
ErrorBean - failure.

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"
}

© 2021 SAP, Inc. All Rights Reserved.


b) GET /departments/some_non_existing_department

{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Department does not exist."
]
}

POST /departments

HTTP Method POST


Path /departments
Description Creates a department based on received DepartmentBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body DepartmentBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – Department successfully created.
400 Bad Request – Required fields are missing or other constraint
error.
Body DepartmentBean - success.
ErrorBean - failure.

JSON example:

a) POST /departments

Request body:

{
"company_system_id": "my_company_inc",
"gate_keeper_system_id": "jsmith",
"name": "Accounting",
"system_id": "accounting"
}

b) If department name which is required is not sent:

{
"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"Department name is required."
]
}

© 2021 SAP, Inc. All Rights Reserved.


PUT /departments

HTTP Method PUT


Path /departments
Description Updates the department based on received DepartmentBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body DepartmentBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Department successfully updated.
400 Bad Request – Required fields are missing or other constraint
error.
404 Not Found – Department not found.
Body DepartmentBean - success.
ErrorBean - failure.

JSON example:

Note: DepartmentBean‘s “system_id” field must be set.

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",

© 2021 SAP, Inc. All Rights Reserved.


"system_id": "sales_and_marketing"
}
},
"name": "Accounting Dep",
"system_id": "accounting",
"uri": "http://localhost:8080/wpm/api/departments/accounting"
}

DELETE /departments/{system_id}

HTTP Method DELETE


Path /departments/{system_id}
Description Deletes the department with specified system id.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Department successfully deleted.
304 Not Modified – If department could not be deleted.
404 Not Found – Department not found.
Body ErrorBean - failure.

Request example: DELETE /departments/accounting

GET /departments

HTTP Method GET


Path /departments
Description Search departments based on set query parameters. Returns a list of departments
which satisfy search criteria.

Available search attributes:


page (Number) page_size (Number) name (String) system_id (String) mask (String)
These search attributes are set as query parameters:
/departments?name=accounting&page=1&page_size=5

Required headers Authorization, domain, Accept


Returned headers Content-Type
Request - Input

© 2021 SAP, Inc. All Rights Reserved.


Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with list of DepartmentBeans.

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
}

© 2021 SAP, Inc. All Rights Reserved.


Message
Resource: Message Main path: /messages

GET /messages/{system_id}

HTTP Method GET


Path /messages/{system_id}
Description Returns the message with specified system id.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Message found.
404 Not Found – Message not found.
Body MessageBean - success.
ErrorBean - failure.

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."
]
}

© 2021 SAP, Inc. All Rights Reserved.


DELETE /messages/{system_id}

HTTP Method DELETE


Path /messages/{system_id}
Description Deletes the message with specified system id.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Message successfully deleted.
304 Not Modified – If message could not be deleted.
404 Not Found – Message not found.
Body ErrorBean - failure.

Request example: DELETE /messages/157

GET /messages/user/{system_id}/unread

HTTP Method GET


Path /messages/user/{system_id}/unread
Description Search unread messages for specified user based on set query
parameters. Returns a list of unread messages which satisfy search
criteria.

Available search attributes:


page (Number)
page_size (Number)
subject (String)
body (String)
system_id (String)

These search attributes are set as query parameters:


/messages/user/jsmith/unread?subject=project&page=1&page_size=5
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json

© 2021 SAP, Inc. All Rights Reserved.


HTTP Status Code 200 OK – Success.
404 Not Found – User not found.
Body ResultBean with list of MessageBeans - success.
ErrorBean - failure.

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

HTTP Method GET


Path /messages/user/{system_id}/unread_and_mark_as_read
Description Search unread messages for specified user based on set query
parameters. Returns a list of unread messages which satisfy search
criteria and marks returned messages as read.

Available search attributes:


page (Number)
page_size (Number)
subject (String)
body (String)
system_id (String)

These search attributes are set as query parameters:


/messages/user/jsmith/unread_and_mark_as_read?subject=project&page=1&page_size=5
Required headers Authorization, domain, Accept
Returned headers Content-Type

© 2021 SAP, Inc. All Rights Reserved.


Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Success.
404 Not Found – User not found.
Body ResultBean with list of MessageBeans - success.
ErrorBean - failure.

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

HTTP Method GET


Path /messages/user/{system_id}/total_unread
Description Returns the number of unread messages for specified user.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Count returned.

© 2021 SAP, Inc. All Rights Reserved.


404 Not Found – User not found.
Body TotalBean - success.
ErrorBean - failure.

JSON example:

a) GET /messages/user/jsmith/total_unread

Response body:

{
"total": 2
}

© 2021 SAP, Inc. All Rights Reserved.


Project
Resource: Project Main path: /projects

GET /projects/{system_id}

HTTP Method GET


Path /projects/{system_id}
Description Returns the project with specified system id.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Project found.
404 Not Found – Project not found.
Body ProjectBean - success.
ErrorBean - failure.

JSON example:

a) GET /projects/abc

Response body:

© 2021 SAP, Inc. All Rights Reserved.


{
"custom_fields": [
{
"name": "Due Date",
"system_id": "due_date",
"type_name": "Date",
"type_system_id": 3,
"value": "10/15/14",
"value_formatted": "15/10/14"
}
],
"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"
}

© 2021 SAP, Inc. All Rights Reserved.


],
"system_id": "sp",
"uri": "http://localhost:8080/wpm/api/projects/sp"
}

b) GET /projects/some_non_existing_project

{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"Project does not exist."
]
}

POST /projects

HTTP Method POST


Path /projects
Description Creates a project based on received ProjectBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body ProjectBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – Project successfully created.
400 Bad Request – Required fields are missing or other constraint
error.
Body ProjectBean - success.
ErrorBean - failure.

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"
}

© 2021 SAP, Inc. All Rights Reserved.


],
"project_roles": [
{
"system_id": "project_leader",
"user_system_id": "jsmith"
}
],
"system_id": "sp"
}

b) If project name which is required is not sent:

{
"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"Project name is required."
]
}

PUT /projects

HTTP Method PUT


Path /projects
Description Updates the project based on received ProjectBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body ProjectBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Project successfully updated.
400 Bad Request – Required fields are missing or other constraint
error.
404 Not Found – Project not found.
Body ProjectBean - success.
ErrorBean - failure.

JSON example:

Note: ProjectBean’s “system_id” field must be set.

PUT /projects

© 2021 SAP, Inc. All Rights Reserved.


Request body:

{
"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"
}

© 2021 SAP, Inc. All Rights Reserved.


DELETE /projects/{system_id}

HTTP Method DELETE


Path /projects/{system_id}
Description Deletes the project with specified system id.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Project successfully deleted.
304 Not Modified – If project could not be deleted.
404 Not Found – Project not found.
Body ErrorBean - failure.

Request example: DELETE /projects/sp

GET /projects

HTTP Method GET


Path /projects
Description Search projects based on set query parameters. Returns a list of projects
which satisfy search criteria.

Available search attributes:


page (Number) page_size (Number) name (String) system_id (String) mask (String)
These search attributes are set as query parameters:
/projects?name=sales project&page=1&page_size=5

Required headers Authorization, domain, Accept


Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json

© 2021 SAP, Inc. All Rights Reserved.


HTTP Status Code 200 OK
Body ResultBean with list of ProjectBeans.

JSON example:

GET /projects?name=sales project&page=1&page_size=5

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
}

© 2021 SAP, Inc. All Rights Reserved.


GET /projects/{system_id}/custom_fields/{custom_field_system_id}

HTTP Method GET


Path /projects/{system_id}/custom_fields/{custom_field_system_id}
Description Returns specified custom field with its value which is set for specified
project.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Custom Field found.
404 Not Found – Project or Custom Field not found.
Body CustomFieldBean - success.
ErrorBean - failure.

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"
}

240 Workflow API © 2021 SAP, Inc. All Rights Reserved.


POST /projects/{system_id}/custom_fields

HTTP Method POST


Path /projects/{system_id}/custom_fields
Description Sets custom field value to specified project based on received
CustomFieldBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body CustomFieldBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – CustomField value set successfully.
400 Bad Request – Custom Field value is not in the right format.
404 Not Found – Project or Custom Field not found
Body ContactBean - success.
ErrorBean - failure.

JSON example:

POST /projects/sp/custom_fields

Request body:

{
"system_id": "due_date",
"value": "10/25/14"
}

© 2021 SAP, Inc. All Rights Reserved.


PUT /projects/{system_id}/custom_fields

HTTP Method PUT


Path /projects/{system_id}/custom_fields
Description Updates custom field value in specified project based on received
CustomFieldBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body CustomFieldBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 200 OK – CustomField value set successfully.
400 Bad Request – Custom Field value is not in the right format.
404 Not Found – Project or Custom Field not found
Body ContactBean - success.
ErrorBean - failure.

JSON example:

PUT /projects/sp/custom_fields

Request body:

{
"system_id": "due_date",
"value": "12/26/15"
}

© 2021 SAP, Inc. All Rights Reserved.


DELETE /projects/{system_id}/custom_fields/{custom_field_system_id}

HTTP Method DELETE


Path /projects/{system_id}/custom_fields/{custom_field_system_id}
Description Deletes the value of specified custom field for specified contact.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Custom field value successfully deleted.
404 Not Found – Project or Custom Field not found.
Body ErrorBean - failure.

Request example: DELETE/projects/sp/custom_fields/due_date

© 2021 SAP, Inc. All Rights Reserved.


Permission Groups
Resource: Permission Groups. Main path:/permission_groups

GET / permission_groups

HTTP Method GET


Path / permission_groups
Description Search permission groups based on set query parameters. Returns a list of
permission groups which satisfy search criteria.

Available search attributes:


page (Number) page_size (Number) name (String) system_id (String) mask (String)

These search attributes are set as query parameters:


/ permission_groups?name=sales&page=1&page_size=5

Required headers Authorization, domain, Accept


Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with list of PermissionGroups

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 "
}

© 2021 SAP, Inc. All Rights Reserved.


GET / permission_groups/{permission_group_system_id}

HTTP Method GET


Path / permission_groups/{permission_group_system_id}
Description Returns the permission group with specified system id.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Permission group found.
404 Not Found – Permission group not found.
Body ProjectBean - success.
ErrorBean - failure.

JSON example:

JSON example:
a) GET /permission_groups/partners Response body: { 2 "name": "partners", 3 "system_id": "partners", 4 "description": "partners description " 5 }

b) GET / permission_groups/{some non-existing permission}

{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [ "Permission Group does not exist."
]
}

GET / permission_groups/{permission_group_system_id}/users

HTTP Method GET

© 2021 SAP, Inc. All Rights Reserved.


Path / permission_groups/{permission_group_system_id}/users
Description Returns users that belong to permission group with specified system id.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Permission group found
404 Not Found – Permission group not found.
Body ProjectBean - success.
ErrorBean - failure.

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"
}
]
}

© 2021 SAP, Inc. All Rights Reserved.


b) GET / permission_groups/{some non-existing permission}/users

{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [ "Permission Group does not exist."
]
}

PUT /permission_groups/{system_id}/users

HTTP Method PUT


Path /permission_groups/{system_id}/users
Description Updates the user value in specified permission group based on received
user system ID’s.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body ProjectBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Permission group successfully updated.
400 Bad Request – Required fields are missing or other constraint
error.
404 Not Found – Permission group not found.
Body ProjectBean - success.
ErrorBean - failure.

JSON example:

a) PUT /permission_groups/permGroup1/users
Request body:

{"users": [“user1", "customer1"]}

Response Body

{
"name": “permGroup1”
"system_id": “permGroup1”
"description": "description of this permission"
}

© 2021 SAP, Inc. All Rights Reserved.


b) Add not valid ID for user
Request body:
{"users": [“user1", "non-existingID"]}

{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [ "Permission permGroup1 not updated. Please add valid
system Ids for users”
]
}

c) Add not valid ID for permission group:

PUT: /permission_groups/{not-existing-id-for-permission-group} /users

"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [ "Permission group does not exist.”
]
}

© 2021 SAP, Inc. All Rights Reserved.


Remove a User from a Permission Group
/permission_groups/{system_id}/users/{user_system_id}

HTTP Method PUT


Path /permission_groups/{system_id}/users/{user_system_id}
Description Removes the user with specified system id from specified permission
group.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – User successfully removed from permission group.
400 Bad request – User does not exist or does not belong to specified
permission group
404 Not Found – Permission Group not found.
Body ErrorBean - failure.

Example:
PUT: permission_groups/permGroup1/users/user1

Remove a Department from a Permission Group


/permission_groups/{system_id}/departments/{department_system_id}

HTTP Method PUT


Path /permission_groups/{system_id}/departments/{department_system_
id}
Description Removes the department with specified system id from specified
permission group.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK - Department successfully removed from permission group.
400 Bad request – Department does not exist or does not belong to
specified permission group.
404 Not Found – Permission Group not found.

© 2021 SAP, Inc. All Rights Reserved.


Body ErrorBean - failure.

Example:
PUT: permission_groups/permGroup1/departments/department1

Remove a User Type from a Permission Group


/permission_groups/{system_id}/user_types/{user_type_system_id}

HTTP Method PUT


Path /permission_groups/{system_id}/user_types/{user_type_system_id}
Description Removes the user type with specified system id from specified
permission group.

Required headers Authorization, domain, Accept


Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – User type successfully removed from permission group.
400 Bad request – User type does not exist or does not belong to
specified permission group.
404 Not Found – Permission Group not found.
Body ErrorBean - failure.

Example:
PUT: permission_groups/permGroup1/users_types/userType1

© 2021 SAP, Inc. All Rights Reserved.


User
Resource: User Main path: /users

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}

HTTP Method GET


Path /users/{system_id}
Description Returns the user with specified system id.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – User found.
404 Not Found – User not found.
Body UserBean - success.
ErrorBean - failure.

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"
},

© 2021 SAP, Inc. All Rights Reserved.


"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"
}
}

b) GET /users/some_non_existing_user

{
"error_code": "RESOURCE_NOT_FOUND",
"error_messages": [
"User does not exist."
]
}

POST /users

HTTP Method POST


Path /users
Description Creates a user based on received UserBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body UserBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – User successfully created.
400 Bad Request – Required fields are missing or other constraint
error.
Body UserBean - success.
ErrorBean - failure.

JSON example:

a) POST /users

Request body:

{
"active": true,
"administrator": true,
"custom_fields": [
{
"system_id": "yahoo_id",
"value": "someYahooId123"

© 2021 SAP, Inc. All Rights Reserved.


}
],
"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:

{
"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"
}
}

b) If fields which are required are not sent:

{
"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."
]
}

© 2021 SAP, Inc. All Rights Reserved.


PUT /users

HTTP Method PUT


Path /users
Description Updates the user based on received UserBean.

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 login name.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body UserBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – User successfully updated.
400 Bad Request – Required fields are missing or other constraint
error.
404 Not Found – User not found.
Body UserBean - success.
ErrorBean - failure.

JSON example:

Note: UserBean’s “system_id” field must be set.

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"
}

© 2021 SAP, Inc. All Rights Reserved.


Response body:

{
"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}

HTTP Method DELETE


Path /users/{system_id}
Description Deletes the user with specified system id.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – User successfully deleted.
304 Not Modified – If user could not be deleted.
404 Not Found – User not found.
Body ErrorBean - failure.

Request example: DELETE /users/jsmith

© 2021 SAP, Inc. All Rights Reserved.


GET /users

HTTP Method GET


Path /users
Description Search users based on set query parameters. Returns a list ofusers
which satisfy search criteria.

Available search attributes:

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)

These search attributes are set as query parameters:


/users?first_name=john&page=1&page_size=5
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with list of UserBeans.

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": [
{

© 2021 SAP, Inc. All Rights Reserved.


"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"
}
}
]
}

POST /users/create_bulk

HTTP Method POST


Path /users/create_bulk
Description Creates a list of users based on received list of UserBean objects
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body List of UserBean objects.
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – Users successfully created.
400 Bad Request – Required fields are missing or other constraint
error.
Body processed_entity - success.
errors – failure.

250 Workflow API © 2021 SAP, Inc. All Rights Reserved.


JSON example:
a) 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"
}
]

© 2021 SAP, Inc. All Rights Reserved.


b) If fields which are required are not sent:

"errors": [
{
"error_code": "USER_EXCEPTION",
"error_messages": [
"User name is required."
"email is required."
],
"failed_index": 1
}
]
}

Errors - List of messages with error details.


Failed_index - Index of user with bad request.

PUT /users/update_bulk

HTTP Method PUT


Path /users/update_bulk
Description Updates the user based on received list of UserBean objects

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 login name.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body List of UserBean objcets
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Users successfully updated.
400 Bad Request – Required fields are missing or other constraint
error.
404 Not Found – User not found.
Body processed_entity - success.
errors – failure.

© 2021 SAP, Inc. All Rights Reserved.


JSON example:
a) PUT /users/update_bulk
Request body:
[{
"active": true,
"administrator": false,
"custom_fields": [{
"system_id": "yahoo_id",
"value": "someYahooId456"
}],
"department_system_id": "sales",
"email": "[email protected]",
"first_name": Ivan",
"last_name": "Smith",
"login_name": "jsmith",
"password": "somePassword123123",
"user_type_system_id": "sales_and_marketing",
"system_id": "jsmith"
},
{
"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": "jsmithg",
"password": "somePassword123123",
"user_type_system_id": "sales_and_marketing",
"system_id": "jsmithg"
}]

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"
}
]
}

© 2021 SAP, Inc. All Rights Reserved.


PUT /users/upsert_bulk

HTTP Method PUT


Path /users/upsert_bulk
Description Creates or updates the user based on received list of UserBean objects.
Note:
• This API is a combination of two existing methods: PUT
/users/update_bulk and POST /users/create_bulk but has some
modifications.
Required headers Authorization, domain, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body List of UserBean objects
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Users successfully created or updated.
400 Bad Request – Required fields are missing or other constraint error.
404 Not Found – User not found.

Body processed_entity - success.


errors – failure.

Typically, for user sync between Commissions – Workflow the following methods are used:

▪ create_bulk for user creation


▪ update_bulk for users to be updated

As the name implies, these methods have singe responsibilities.

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.

Upsert Bulk Usage:


▪ This is a unique request: just ‘system_id’ is needed, loginName will be created based on system_id.
(This is different from the earlier method in create_bulk for which login name was a required field)
▪ By the provided ‘system_id’ in the request body, user will be created or updated.
▪ If ‘system_id’ already exists, user will be updated.
▪ If ‘system_id’ doesn’t exist, user will be created and login_name will be provided in the response of
API.
▪ For user creation, if password is contained in the body and if password is valid, that password will be
used. If password is not valid, error message will be returned, and user will not be created.
▪ If password is not provided, it will be generated by the system, and will be visible in the response in
the API call.
▪ Once generated, password is not allowed to change via API call – you must then use the options on
the UI instead.
▪ “department_system_id” and “user_type_system_id” are not required fields. If these fields are not
provided, the system will generate it automatically and set it to default.
▪ Login name can be updated through field ‘new_system_id’.

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').

Upsert_bulk User Cases

1. Create a New User

Request body:

[
{

"active": true,

"administrator": true,

"email": "[email protected]",

"first_name": "nesto",

"last_name": "nesto",

"system_id": "newUser",

"password": "somePassword567"

© 2021 SAP, Inc. All Rights Reserved.


Response:
Creates a new user with
system_id: newUser
generates login_name by its system_id => [ login_name: newUser ]

2. Update Existing User

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 ]

3. Update existing user system_id with new field: new_system_id

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

Expected Errors when using Bulk_Upsert:

1. system_id is not provided:

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

},

© 2021 SAP, Inc. All Rights Reserved.


2. Adding new users with same system_id values in a queue:

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

© 2021 SAP, Inc. All Rights Reserved.


errors": [

"error_messages": [

"User with this system_id: newUser1 cannot be created


since is already added to the queue."

],

"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"

3. Case where loginName and systemId are not the same:

Try to create new user by providing existing loginName (can be checked by calling GET users api method:
/wpm/api/users/{loginName}

Example:

© 2021 SAP, Inc. All Rights Reserved.


If user with loginName: ‘test’ exists:

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": [

"User name already defined."

],

"failed_index": 1

],

4. new_system_id is just defined for update, not valid for create

Request:

© 2021 SAP, Inc. All Rights Reserved.


[

"active": true,

"administrator": true,

"email": "[email protected]",

"first_name": "john",

"last_name": "smith",

"system_id": "createMe",

"new_system_id":"createme2",

"password": "somePassword567"

New value from new_system_id will be ignored.


Response:

"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"

© 2021 SAP, Inc. All Rights Reserved.


5. Password validation is added for user creation:

Request:
[

"active": true,

"administrator": true,

"email": "[email protected]",

"first_name": "neki user",

"last_name": "neko prezime",

"system_id": "hola",

"password": "123"

Response:

"errors": [

"error_code": "USER_EXCEPTION",

"error_messages": [

"Password must have more than 8 characters."

],

"failed_index": 1

],

"processed_entities": []

© 2021 SAP, Inc. All Rights Reserved.


GET /users/{system_id}/custom_fields/{custom_field_system_id}

HTTP Method GET


Path /users/{system_id}/custom_fields/{custom_field_system_id}
Description Returns specified custom field with its value which is set for specified
user.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Custom Field found.
404 Not Found – User or Custom Field not found.
Body CustomFieldBean - success.
ErrorBean - failure.

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":

© 2021 SAP, Inc. All Rights Reserved.


POST /users/{system_id}/custom_fields

HTTP Method POST


Path /projects/{system_id}/custom_fields
Description Sets custom field value to specified user based on received
CustomFieldBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body CustomFieldBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – CustomField value set successfully.
400 Bad Request – Custom Field value is not in the right format.
404 Not Found – User or Custom Field not found
Body ContactBean - success.
ErrorBean - failure.

JSON example:

POST /users/jsmith/custom_fields

Request body:

{
"system_id": "yahoo_id",
"value": "someYahooId123"
}

© 2021 SAP, Inc. All Rights Reserved.


PUT /users/{system_id}/custom_fields

HTTP Method PUT


Path /users/{system_id}/custom_fields
Description Updates custom field value for specified user based on received
CustomFieldBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body CustomFieldBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 200 OK – CustomField value set successfully.
400 Bad Request – Custom Field value is not in the right format.
404 Not Found – User or Custom Field not found
Body ContactBean - success.
ErrorBean - failure.

JSON example:

PUT /users/jsmith/custom_fields

Request body:

{
"system_id": "yahoo_id",
"value": "someOtherId456"
}

© 2021 SAP, Inc. All Rights Reserved.


DELETE /users/{system_id}/custom_fields/{custom_field_system_id}

HTTP Method DELETE


Path /users/{system_id}/custom_fields/{custom_field_system_id}
Description Deletes the value of specified custom field for specified user.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – Custom field value successfully deleted.
404 Not Found – User or Custom Field not found.
Body ErrorBean - failure.

Request example: DELETE /users/jsmith/custom_fields/yahoo_id

© 2021 SAP, Inc. All Rights Reserved.


User Type
Resource: User Type Main path: /user_types

GET /user_types/{system_id}

HTTP Method GET


Path /user_types/{system_id}
Description Returns the user type with specified system id.
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – User Type found.
404 Not Found – User Type not found.
Body UserTypeBean - success.
ErrorBean - failure.

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."
]
}

© 2021 SAP, Inc. All Rights Reserved.


POST /user_types

HTTP Method POST


Path /user_types
Description Creates a user type based on received UserTypeBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type, Location
Request - Input
Accepts application/json
Expected request body UserTypeBean
Response - Output
Returned MIME Type application/json
HTTP Status Code 201 Created – User type successfully created.
400 Bad Request – Required fields are missing or other constraint
error.
Body UserTypeBean - success.
ErrorBean - failure.

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"
}

b) If fields which are required are not sent:

{
"error_code": "CONSTRAINT_VIOLATIONS",
"error_messages": [
"UserType name is required”
]
}

© 2021 SAP, Inc. All Rights Reserved.


PUT /user_types

HTTP Method PUT


Path /user_types
Description Updates the user type based on received UserTypeBean.
Required headers Authorization, domain, Accept, Content-Type
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body UserTypeBean
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – User type successfully updated.
400 Bad Request – Required fields are missing or other constraint
error.
404 Not Found – User type not found.
Body UserTypeBean - success.
ErrorBean - failure.

JSON example:

Note: UserTypeBean’s “system_id” field must be set. PUT /user_types


Request body:

{
"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"
}

© 2021 SAP, Inc. All Rights Reserved.


DELETE /user_types/{system_id}

HTTP Method DELETE


Path /user_types/{system_id}
Description Deletes the user type with specified system id.
Required headers Authorization, domain, Accept
Returned headers
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK – User type successfully deleted.
304 Not Modified – If user type could not be deleted.
404 Not Found – User type not found.
Body ErrorBean - failure.

Request example: DELETE/user_types/business_analyst

© 2021 SAP, Inc. All Rights Reserved.


GET /user_types

HTTP Method GET


Path /user_types
Description Search user types based on set query parameters. Returns a list of
user types which satisfy search criteria.

Available search attributes:


page
page_size
mask
name
system_id

These search attributes are set as query parameters:


/user_types?name= business&page=1&page_size=5
Required headers Authorization, domain, Accept
Returned headers Content-Type
Request - Input
Accepts application/json
Expected request body N/A
Response - Output
Return MIME Type application/json
HTTP Status Code 200 OK
Body ResultBean with list of UserTypeBeans.

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"
}
]
}

© 2021 SAP, Inc. All Rights Reserved.


Appendix A – Countries

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

© 2021 SAP, Inc. All Rights Reserved.


Chile chile
China china
Cocos (Keeling) Islands cocos_keeling_islands
Colombia colombia
Comoros comoros
Congo congo
Costa Rica costa_rica
Cote d Ivoire cote_d_ivoire
Croatia croatia
Cuba cuba
Cyprus cyprus
Denmark denmark
Djibouti djibouti
Dominica dominica
East Timor east_timor
Ecuador ecuador
Egypt egypt
El Salvador el_salvador
Equitorial Guinea equitorial_guinea
Eritrea eritrea
Estonia estonia
Falkland Islands (Islas Malvinas) falkland_islands_islas_malvinas
Faroe Islands faroe_islands
Fiji fiji
France france
French Guyana french_guyana
French Southern and Antarctic Lands french_southern_and_antarctic_lands
Gabon gabon
Gambia gambia
Gaza Strip gaza_strip
Germany germany
Ghana ghana
Gibraltar gibraltar
Greece greece
Greenland greenland
Guadeloupe guadeloupe
Guam guam
Guatemala guatemala
Guinea guinea
Guyana guyana
Haiti haiti

© 2021 SAP, Inc. All Rights Reserved.


Holy See (Vatican City) holy_see_vatican_city
Honduras honduras
Hong Kong hong_kong
Hungary hungary
Iceland iceland
India india
Indonesia indonesia
Iran iran
Iraq iraq
Ireland ireland
Italy italy
Jamaica jamaica
Japan japan
Jordan jordan
Kenya kenya
Kiribati kiribati
Kuwait kuwait
Kyrgyzstan kyrgyzstan
Laos laos
Latvia latvia
Lebanon lebanon
Liberia liberia
Libya libya
Liechtenstein liechtenstein
Lithuania lithuania
Macau macau
Macedonia - FYR macedonia_fyr
Madagascar madagascar
Malawi malawi
Maldives maldives
Mali mali
Afghanistan afghanistan
American Samoa american_samoa
Antigua and Barbuda antigua_and_barbuda
Bahrain bahrain
Belize belize
Bosnia and Herzegovina bosnia_and_herzegovina
British Virgin Islands british_virgin_islands
Cape Verde cape_verde
Christmas Island christmas_island
Cook Islands cook_islands

© 2021 SAP, Inc. All Rights Reserved.


Czech Republic czech_republic
Dominican Republic dominican_republic
Ethiopia ethiopia
Finland finland
French Polynesia french_polynesia
Marshall Islands marshall_islands
Martinique martinique
Mauritania mauritania
Mayotte mayotte
Mexico mexico
Moldova moldova
Monaco monaco
Mongolia mongolia
Montenegro montenegro
Montserrat montserrat
Morocco morocco
Mozambique mozambique
Myanmar myanmar
Namibia namibia
Naura naura
Netherlands netherlands
New Caledonia new_caledonia
New Zealand new_zealand
Nicaragua nicaragua
Niger niger
Nigeria nigeria
Niue niue
Norfolk Island norfolk_island
Northern Mariana Islands northern_mariana_islands
Norway norway
Oman oman
Palau palau
Panama panama
Papua New Guinea papua_new_guinea
Peru peru
Philippines philippines
Pitcairn Islands pitcairn_islands
Poland poland
Puerto Rico puerto_rico
Qatar qatar
Reunion reunion

© 2021 SAP, Inc. All Rights Reserved.


Romania romania
Russia russia
Rwanda rwanda
Saint Lucia saint_lucia
Samoa samoa
San Marino san_marino
Sao Tome and Principe sao_tome_and_principe
Saudi Arabia saudi_arabia
Senegal senegal
Serbia serbia
Seychelles seychelles
Sierra Leone sierra_leone
Singapore singapore
Slovenia slovenia
Solomon Islands solomon_islands
Somalia somalia
South Georgia south_georgia
South Korea south_korea
Spain spain
Sri Lanka sri_lanka
St. Helena st_helena
Sudan sudan
Suriname suriname
Svalbard svalbard
Swaziland swaziland
Switzerland switzerland
Syria syria
Taiwan taiwan
Tajikistan tajikistan
Tanzania tanzania
Togo togo
Tokelau tokelau
Tonga tonga
Tunisia tunisia
Turkey turkey
Turkmenistan turkmenistan
Turks and Caicos Islands turks_and_caicos_islands
Tuvalu tuvalu
Uganda uganda
United Arab Emirates united_arab_emirates
United Kingdom united_kingdom

© 2021 SAP, Inc. All Rights Reserved.


USA usa
Uruguay uruguay
Uzbekistan uzbekistan
Vanuatu vanuatu
Venezuela venezuela
Vietnam vietnam
West Bank west_bank
Western Sahara western_sahara
Yemen yemen
Zambia zambia
Zimbabwe zimbabwe
Georgia georgia
Grenada grenada
Guinea-Bissau guinea_bissau
Heard Island and McDonald Islands heard_island_and_mcdonald_islands
Israel israel
Kazakhstan kazakhstan
Lesotho lesotho
Luxembourg luxembourg
Malaysia malaysia
Malta malta
Mauritius mauritius
Micronesia - Federated States of micronesia_federated_states_of
Nepal nepal
Netherlands Antilles netherlands_antilles
North Korea north_korea
Pakistan pakistan
Paraguay paraguay
Portugal portugal
Saint Kitts and Nevis saint_kitts_and_nevis
Saint Vincent and the Grenadines saint_vincent_and_the_grenadines
Slovakia slovakia
South Africa south_africa
St. Pierre and Miquelon st_pierre_and_miquelon
Sweden sweden
Thailand thailand
Trinidad and Tobago trinidad_and_tobago
Ukraine ukraine
United States Virgin Islands united_states_virgin_islands
Wallis and Futuna wallis_and_futuna

© 2021 SAP, Inc. All Rights Reserved.


Appendix B – States

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

© 2021 SAP, Inc. All Rights Reserved.


Nebraska NE
Nevada NV
New Brunswick NB
New Hampshire NH
New Jersey NJ
New Mexico NM
New York NY
Newfoundland NL
North Carolina NC
North Dakota ND
Northwest Territories NT Nova
Scotia NS
Ohio OH
Oklahoma OK
Ontario ON
Oregon OR
Pennsylvania PA
Prince Edward Island PE
Puerto Rico PR
Quebec QC
Rhode Island RI
Saskatchewan SK
South Carolina SC
South Dakota SD
Tennessee TN
Texas TX
Utah UT
Vermont VT
Virgin Islands VI
Virginia VA
Washington WA
West Virginia WV
Wisconsin WI
Wyoming WY
Yukon YT
Nunavut NU
Labrador NF

© 2021 SAP, Inc. All Rights Reserved.


Appendix C – Custom Field Types

This appendix show the list of Custom Field Types which can be created via Workflow REST API:

Custom Field Type System ID


Autocomplete 35
Checkbox 8
Constant 20
Currency 33
Date 3
Date and Time 16
Decimal Number 18
Email 11
Large Text 5
Multiple Autocomplete 36
Multiple Choice Pick Up List 9
Number 2
Percent 19
Pick List 6
Radio Button 7
Rich Text Editor 28
Text 1
Url 10

© 2021 SAP, Inc. All Rights Reserved.


Appendix D – Error Codes

This appendix shows the list of error codes that can be returned via ErrorBean:

Error Code Description


BAD_DATE_FORMAT Submitted date value is not in the right format.
BAD_DATE_TIME_FORMAT Submitted date time value is not in the right format.
CASES_ALREADY_RELATED Two cases are already related.
CASES_NOT_RELATED Two cases are not related.
CONSTRAINT_DELETE_VIOLATIONS Resource (entity) cannot be deleted because of
delete constraint.
CONSTRAINT_NOT_UNIQUE_VIOLATION Sent resource’s (entity’s) property must be unique.
CONSTRAINT_VIOLATIONS Specified action is trying to violate existing
constraints.
CUSTOM_FIELD_REQUIRED Custom Field which is required to be submitted on
action form is not sent.
USTOM_FIELD_VALUE_DOES_NOT_EXIST Non existing predefined value is submitted.
CUSTOM_FIELD_VALUE_NOT_VALID Custom Field value is not valid. (E.g. text value
‘thousand’ is sent for decimal field type.)
CUSTOM_TABLE_OPERATIONS_FAILED Custom table operation not completed. (adding a
new row, retrieving values etc.)
FILE_NOT_UPLOADED File upload was not successful.
FILE_TOO_LARGE Uploaded file is larger than it is allowed.
ILLEGAL_ACCESS User does not have a permission to perform the
specific call.
ILLEGAL_FILE_EXTENSION Uploaded file does not have required type.
ILLEGAL_QUERY Query contains illegal words.
IMPORT_FAILED Custom table import failed.
INVALID_ACTION_ARGUMENT Executing action failed.
INVALID_SYSTEM_ID Field with specified System ID does not exist.
LENGTH_GREATER_THAN_MAXIMUM Submitted Custom Field value is larger than
maximum value for that Custom Field.

LENGTH_LESS_THAN_MINUMUM Submitted Custom Field value is less than minimum


value for that Custom Field.

© 2021 SAP, Inc. All Rights Reserved.


PERMISSION_DENIED User does not have a permission to perform
requested action.
PROPERTY_NULL Bean’s property is not submitted or has null value.
QUERY_NOT_EXECUTED Query execution failed.
RESOURCE_ALREADY_EXISTS The same resource (entity) is already created.
RESOURCE_NOT_FOUND Requested resource (entity) does not exist.

You might also like