sap.fieldglass.approval
Module sap.fieldglass.approval
API
ballerinax/sap.fieldglass.approval Ballerina library
Overview
The SAP Fieldglass Approval API API v1.0.0 connector(https://api.sap.com/api/approvals/resource) 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.
Key Features
- Programmatic access to create and manage resources via REST API
- Manage user accounts and profiles
- Secure authentication with API key or OAuth support
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create and configure an OAuth2 client credentials by following this guide.
Clients
sap.fieldglass.approval: Client
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
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 (ConnectionConfig config, string serviceUrl)- config ConnectionConfig - The configurations to be used when initializing the
connector
- serviceUrl string - URL of the target service
getItemListForApproval
function getItemListForApproval(string? authorization, string? xApplicationkey) returns Approvals|errorGet 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
function getItemListFroApprovalByModule(string moduleId, string? authorization, string? xApplicationkey) returns Approvals|errorGet 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
function approveOrRejectItem(string moduleId, string workItemId, string action, string? authorization, string? xApplicationkey, string? comments, string? reasonId) returns Approvals|errorApprove 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
function getWorkItemDetail(string moduleId, string workItemId, string? authorization, string? xApplicationkey) returns Approvals|errorGet 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
function getRejectionReasons(string moduleId, string? authorization, string? xApplicationkey) returns Approvals|errorGet 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
sap.fieldglass.approval: Approvals
Fields
- HEADER? ApprovalsHeader -
- PAYLOAD? ApprovalsPayload[] -
sap.fieldglass.approval: ApprovalsAttributes
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
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
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: ClientHttp1Settings
Provides settings related to HTTP/1.x protocol.
Fields
- keepAlive KeepAlive(default http:KEEPALIVE_AUTO) - Specifies whether to reuse a connection for multiple requests
- chunking Chunking(default http:CHUNKING_AUTO) - The chunking behaviour of the request
- proxy? ProxyConfig - Proxy server related options
sap.fieldglass.approval: ConnectionConfig
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 HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings? ClientHttp1Settings - Configurations related to HTTP/1.x protocol
- http2Settings? ClientHttp2Settings - 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-forwardedheader
- poolConfig? PoolConfiguration - Configurations associated with request pooling
- cache? CacheConfig - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding) header
- circuitBreaker? CircuitBreakerConfig - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig? RetryConfig - Configurations associated with retrying
- responseLimits? ResponseLimitConfigs - Configurations associated with inbound response size limits
- secureSocket? ClientSecureSocket - SSL/TLS-related options
- proxy? ProxyConfig - Proxy server related options
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
sap.fieldglass.approval: OAuth2ClientCredentialsGrantConfig
OAuth2 Client Credentials Grant Configs
Fields
- Fields Included from *OAuth2ClientCredentialsGrantConfig
- tokenUrl string(default " ") - Token URL
sap.fieldglass.approval: ProxyConfig
Proxy server configurations to be used with the HTTP client endpoint.
Fields
- host string(default "") - Host name of the proxy server
- port int(default 0) - Proxy server port
- userName string(default "") - Proxy server username
- password string(default "") - Proxy server password
sap.fieldglass.approval: Status
Fields
- TransactionID? string - Transaction ID.
- ReturnCode? int - Return code.
- Message? string - Message.
String types
sap.fieldglass.approval: Error
Error
Import
import ballerinax/sap.fieldglass.approval;Metadata
Released date: 3 days ago
Version: 1.3.2
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.8.0
GraalVM compatible: Yes
Pull count
Total: 25
Current verison: 0
Weekly downloads
Keywords
Type/Connector
Vendor/SAP
Area/ERP & Business Operations
Business Management/ERP
Cost/Paid
Contributors
Dependencies