Reject Work Item

Describes the API specifications for rejecting work items.

Request

URI: /approvals/module_{moduleID}/{workItemID}/action/reject?for_user={username}&reasonId={RejectionReasonID}&comments={UserComments}

HTTP Method: POST

Permissions: For the for_user parameter to work, the user initiating the request must be assigned a nonadministrator role whose internal_ref is set to INTEGRATION. Contact your SAP Fieldglass representative or open a customer support ticket to set up the permissions.

Request Headers

Header

Required

Example Value

Data Type

Description

authorization

Yes

bearer [access token]

String

Security credentials for a login session.

content-type

Yes

application/x-www-form-urlencoded

String

The media type of the resource.

Request Parameters

Parameter

Required

Data Type

Description

Parameter Type

moduleID

Yes

String

Numeric module reference ID of the work item being rejected.

Path

workItemID

Yes

String

Specific object ID of the work item being rejected.

Path

for_user={username}

No

String

The unique username of the user being impersonated. If not included, the response only returns the work items that need approval for the person who submitted the request.

Query string

reasonId={RejectionReasonID}

Yes

String

Globally unique ID of the rejection reason.

Query string

comments={UserComments}

No

String

User-entered comments.

Query string

Request Example

POST https://company.com/api/v1/approvals/module_40/z16052021440472596879916/action/reject?reasonId=nandita_agarwal&comments=Missing%20job%20qualification
authorization: Bearer WDXlKj3TTOn3rpg9GHnZpbKmvj1=
x-ApplicationKey: 5c91f4fdb0c6ee9992ff476f89bf6cf25e589350
content-type: application/x-www-form-urlencoded

Response

Refer to the Common Headers and Responses.