Get Work Items for Approval by Module

Describes the API specifications for retrieving all work items for approval by module.

Request

URI: /approvals/module_{moduleID}?for_user={username}

HTTP Method: GET

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 Parameters

Parameter

Required

Data Type

Description

Parameter Type

moduleID

Yes

String

Numeric module reference ID of the work item needing to be approved.

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

offset

No

String

The number of items to skip before starting to collect the result set. Used with limit.

Query string

limit

No

String

The maximum number of results to return. Used with offset. Together, they determine the start index and number of records to return. For example, to return 100 records starting with the 10th record, use the following:

/api/v1/approvals/module_{moduleID}?for_user={username}&limit=100&offset=10 

By default, the offset is set to 0. The limit is set to 100 or 350 depending on the module. Recommend the use of the limit and offset parameters when a query would result in a large number of records downloaded that would adversely impact performance.

Query string

Request Example

GET https://company.com/api/v1/approvals/module_40?for_user=nandita_agarwal
authorization: Bearer WDXlKj3TTOn3rpg9GHnZpbKmvj1=
x-ApplicationKey: 5c91f4fdb0c6ee9992ff476f89bf6cf25e589350
content-type: application/x-www-form-urlencoded

Response

Response Body

Parameter

Data Type

Description

Scope

ModuleID

String

Numeric module reference ID.

All

*ModuleName

String

Name of module, also type of object to be approved.

All

ID

String

Globally unique database-level identifier of object. The ID is used for the drill-down call. Not visible to end users.

All

Attributes

 

The attributes of the object.

Parameter

Data Type

Description

Scope

*ref

String

Object ID, visible to end users.

All

*uom

String

3-character currency code.

All

*name

String

Name of object as defined by user.

All

startDate

Date (mm/dd/yyyy)

Recorded start date of object to be approved. Logical value is module-dependent.

Module dependent

*amount

String

Amount to be approved.

All

refVersion

Numeric

Revision number of object to be approved.

All

iconType

String

Description of object type: worker, procurement, payment.

All

validObject

Boolean

Always returns “false”.

All

createDate

Date (mm/dd/yyyy)

The date the work item was created.

All

creatorName

String

Name of the user who created the work item.

All

uniqueName

String

The username of the user.

All

emailId

String

The email address of the user.

All

status

String

The status of the work item.

All

 

others

Various

Additional data captured for the object, beyond the core attributes. The fields returned vary by module and configuration. They are extension (extrinsic) elements that you can display based on your business requirements.

Module-dependent

Status

String

Ok if response is OK.

All

Details

String

All ok if response is OK.

All

Response Example

{
  "HEADER": {
    "AppVersion": "FieldglassAPIServer/1.0",
    "OSUAStr": "FieldglassAPIServer/1.0",
    "NumRecs": 1,
    "Status": "ok",
    "Details": "all ok"
  },
  "PAYLOAD": [
    {
      "ModuleID": "40",
      "ModuleName": "Job Posting",
      "ID": "z16042611572049751234567",
      "Attributes": {
        "ref": "ABCDJP00000001",
        "uom": "USD",
        "name": "API  developer",
        "startDate": "05/01/2016",
        "amount": "100,000.00",
        "refVersion": 0,
        "iconType": "procurement",
        "validObject": false,
        "createDate": "04/01/2016",
        "creatorName": "Agarwal, Nandita",
        "uniqueName": "nandita_agarwal",
        "emailId": "nagarwal@acme.com",
        "status": "Pending Approval"
      },
      "Status": "ok",
      "Details": "all ok"
    }
  ]