sap.fieldglass.approval
![](https://bcentral-packageicons.azureedge.net/images/ballerinax_sap.fieldglass.approval_1.0.0.png)
ballerinax/sap.fieldglass.approval Ballerina library
Overview
This is a generated connector for SAP Fieldglass Approval API API v1.0.0 OpenAPI specification.
The SAP Fieldglass Approval API allows clients to approve or reject SAP Fieldglass work items. Clients retrieve the work items pending an approval action from the authenticated user and return the workflow action to be performed (either approve or reject). The list and details provided by the SAP Fieldglass API give clients the ability to present work items for approval to their users with the level of detail needed to make an informed approval decision and the mechanism to return the approval or rejection decision.
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create and configure an OAuth2 client credentials by following this guide.
Clients![](/images/permalink.svg)
sap.fieldglass.approval: Client![](/images/permalink.svg)
This is a generated connector for SAP Fieldglass Approval API API v1.0.0 OpenAPI specification. The SAP Fieldglass Approval API allows clients to approve or reject SAP Fieldglass work items. Clients retrieve the work items pending an approval action from the authenticated user and return the workflow action to be performed (either approve or reject). The list and details provided by the SAP Fieldglass API give clients the ability to present work items for approval to their users with the level of detail needed to make an informed approval decision and the mechanism to return the approval or rejection decision.
Constructor![](/images/permalink.svg)
Gets invoked to initialize the connector
.
The connector initialization requires setting the API credentials.
Create and configure an OAuth2 client credentials by following this guide.
init (ClientConfig clientConfig, string serviceUrl)
- clientConfig ClientConfig - The configurations to be used when initializing the
connector
- serviceUrl string - URL of the target service
getItemListForApproval![](/images/permalink.svg)
function getItemListForApproval(string? authorization, string? xApplicationkey) returns Approvals|error
Get a list of items that require approval
Parameters
- authorization string? (default ()) - Only required for production access when using SAP Fieldglass.
- xApplicationkey string? (default ()) - The company-specific key provided by SAP Fieldglass for API access. Required for production access.
getItemListFroApprovalByModule![](/images/permalink.svg)
function getItemListFroApprovalByModule(string moduleId, string? authorization, string? xApplicationkey) returns Approvals|error
Get items that require approval for a module
Parameters
- moduleId string - The ID for the module (for example, 40 for Job Posting or 270 for Work Order). A full list can be found in the supporting documentation.
- authorization string? (default ()) - Only required for production access when using SAP Fieldglass.
- xApplicationkey string? (default ()) - The company-specific key provided by SAP Fieldglass for API access. Required for production access.
approveOrRejectItem![](/images/permalink.svg)
function approveOrRejectItem(string moduleId, string workItemId, string action, string? authorization, string? xApplicationkey, string? comments, string? reasonId) returns Approvals|error
Approve or reject an item
Parameters
- moduleId string - The ID for the module (for example, 40 for Job Posting or 270 for Work Order). A full list can be found in the supporting documentation.
- workItemId string - The ID of the work item. You can get this from the response received when getting the list of items that require approval.
- action string - The action to take on the work item. This can be either ''approve'' or ''reject''. If it is reject, the reasonId is required.
- authorization string? (default ()) - Only required for production access when using SAP Fieldglass.
- xApplicationkey string? (default ()) - The company-specific key provided by SAP Fieldglass for API access. Required for production access.
- comments string? (default ()) - Any comments about the action.
- reasonId string? (default ()) - The reasonId for the rejection. This is required when the action is 'reject'. You can get a list of rejection reasons available for the module from the response when getting rejection reasons.
getWorkItemDetail![](/images/permalink.svg)
function getWorkItemDetail(string moduleId, string workItemId, string? authorization, string? xApplicationkey) returns Approvals|error
Get details for work item
Parameters
- moduleId string - The ID for the module (for example, 40 for Job Posting or 270 for Work Order). A full list can be found in the supporting documentation.
- workItemId string - The ID of the work item.
- authorization string? (default ()) - Only required for production access when using SAP Fieldglass.
- xApplicationkey string? (default ()) - The company-specific key provided by SAP Fieldglass for API access. Required for production access.
getRejectionReasons![](/images/permalink.svg)
function getRejectionReasons(string moduleId, string? authorization, string? xApplicationkey) returns Approvals|error
Get rejection reasons
Parameters
- moduleId string - The ID for the module (for example, 40 for Job Posting or 270 for Work Order). A full list can be found in the supporting documentation.
- authorization string? (default ()) - Only required for production access when using SAP Fieldglass.
- xApplicationkey string? (default ()) - The company-specific key provided by SAP Fieldglass for API access. Required for production access.
Records![](/images/permalink.svg)
sap.fieldglass.approval: Approvals![](/images/permalink.svg)
Fields
- HEADER ApprovalsHeader? -
- PAYLOAD ApprovalsPayload[]? -
sap.fieldglass.approval: ApprovalsAttributes![](/images/permalink.svg)
Fields
- ref string? - Object ID, visible to end users.
- uom string? - 3-character currency code.
- name string? - Name of object as defined by user.
- startDate string? - Start date.
- endDate string? - End date.
- amount string? - Amount to be approved.
- refVersion int? - Revision number of object to be approved.
- validObject boolean? - Always returns false.
- createDate string? - Recorded start date of object to be approved. Logical value is module dependent.
- creatorName string? - Creator name.
- uniqueName string? - Unique name.
- emailId string? - Unique name.
- status string? - Ok if response is OK.
- sourceLink string? - Source link.
- others record {}? - Additional data captured in SAP Fieldglass for the object. Full list of data is module and configuration-dependent and should be consumed/presented as extrinsic.
sap.fieldglass.approval: ApprovalsHeader![](/images/permalink.svg)
Fields
- appVersion string? - API version.
- OSUAStr string? - API version
- numRecs int? - Number of records returned in the payload.
- status string? - Status of the API call.
- details string? - Always All Ok for successful responses.
sap.fieldglass.approval: ApprovalsPayload![](/images/permalink.svg)
Fields
- moduleID string? - Numeric module reference ID.
- moduleName string? - Name of module, also type of object to be approved.
- ID string? - Globally unique database-level identifier of object. This is the ID used for the drill down call. Not visible to end users.
- Attributes ApprovalsAttributes? -
- Status string? - Ok if response is OK.
- Details string? - All ok if response is OK.
- ActivityID string? - Ok if response is OK.
sap.fieldglass.approval: ClientConfig![](/images/permalink.svg)
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- auth OAuth2ClientCredentialsGrantConfig - Configurations related to client authentication
- httpVersion string(default "1.1") - The HTTP version understood by the client
- http1Settings ClientHttp1Settings(default {}) - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings(default {}) - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded
/x-forwarded
header
- followRedirects FollowRedirects?(default ()) - Configurations associated with Redirection
- poolConfig PoolConfiguration?(default ()) - Configurations associated with request pooling
- cache CacheConfig(default {}) - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding
) header
- circuitBreaker CircuitBreakerConfig?(default ()) - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig RetryConfig?(default ()) - Configurations associated with retrying
- cookieConfig CookieConfig?(default ()) - Configurations associated with cookies
- responseLimits ResponseLimitConfigs(default {}) - Configurations associated with inbound response size limits
- secureSocket ClientSecureSocket?(default ()) - SSL/TLS-related options
sap.fieldglass.approval: Status![](/images/permalink.svg)
Fields
- TransactionID string? - Transaction ID.
- ReturnCode int? - Return code.
- Message string? - Message.
String types![](/images/permalink.svg)
sap.fieldglass.approval: Error![](/images/permalink.svg)
Error
Import
import ballerinax/sap.fieldglass.approval;
Metadata
Released date: over 2 years ago
Version: 1.0.0
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.0.0
GraalVM compatible: Yes
Pull count
Total: 0
Current verison: 0
Weekly downloads
Keywords
Business Management/ERP
Cost/Paid
Contributors
Dependencies