When clients have certain requirements that cannot be met with the standard product features, APIs are utilized. The Application Program Interface (API) is a layer to enhance and add custom features into the MDO application. Whenever a client has custom requirements which cannot be handled by the configurable features available in the MDO platform, APIs are written to implement and fulfill those requirements.
Below are a few instances where an API could be used.
(X field and C field will be used as references)
JavaScript API
- When X field populates C field with same data:
- When X field becomes populated specifically, C field is populated in another manner:
- Field X Postcode to field C State
- When X field converts to a C field in a certain manner:
- Field X Litres to convert to field C Millilitres
- When X field prompts or restricts C field value
- Field X is under Field C value – prompts
Java API
- When a certain action result in another
- Creation of a record will populate GRID datasets X, Y, Z
- Modifying a record will notify selective recipients
- When a result of an action is to commence another action
- When X records have been created, Action Y will commence
- When X record has a certain dataset recorded, any Action Y will commence
- When another system or database needs to be connected
As mentioned above, there are two types of APIs:
- JavaScript API: It is written to implement client-side validation and displaying pop-up windows and dialog box, confirm dialog box and prompt (dialog box).
- Java API: A Java API refers to a program code which works in the back end and helps in:
-
- Populating default values
- Form validations
- Validate things from backend with third party
- Populate field values from some other system
- Determining workflow path
- Populating grids
- Fetching data for reports
- Integration
Prerequisites:
- Modules and scope need to be identified
- API Development Specification needs to be approved and filled
Below is the API Development Specification Format:
API Specification Name
<Put a name>
Estimated Date of Completion
<Put a date>
Version
Version | Requestor | Date |
<Put Version No.> | <Put Requestor Name> | <Put a date> |
Details
Area | Owner |
Server URL | <https://www.example.com> |
Module ID | <Put an id> |
Module Name | <Put a name> |
Target Product
Product | Target |
ConnektHub Platform | YES/NO |
Master Data Online | YES/NO |
Work Safe Online | YES/NO |
Customers
Customers | Tenant ID |
<Customer name> | <Put a tenant ID if tenant specific> |
User Story
<Put the scenario details>
Triggers
Standard API
Process | Action | Type |
<Create/Change etc> | Online/Workflow/Background | Internal/Javascript |
Grid API
Grid ID | Process | Event |
Field API
Field ID | Event |
Html API
Sample HTML | Event |
Development Specification
TEST CASE #1
Input
<Sample input>
Output/Expected Behaviour
<Sample output/behaviour>
Delivery Specification
Test Results
Input
<Screenshot>
Output
<Screenshot>
Impact Assessment
DB Insert
System | Table Name | Column Name |
DB Update
System | Table Name | Column Name |
DB Delete
System | Table Name | Column Name |
File Create
<Put path>
File Update
<Put path>
File Delete
<Put path>
Event Based API
Event based APIs are triggered when an event occurs.
Below is the list of fields, processes and events for an Event based API:
Field ID | Description | |
Select Object | Select object (module) from the list | |
Description | Enter the API description (E.g. Send email to manager after approval) | |
Action | Online | Executes code at runtime based on the event selection |
Background | Executes code at backend (Schedule jobs and call API on scheduled based) | |
Workflow | Executes code based on the workflow event | |
Enhancement Type | JavaScript | JavaScript validations at server side based on the event selection |
Internal API | Server level API to execute code on event base | |
Process | Create | On record Creation |
Copy | On record Copy | |
Change | On record Change | |
Reject | On workflow Rejection | |
Extend | On record extend | |
Delete | On record delete | |
Summary | On record summary load | |
Print PDF | On print PDF | |
List View | On list page load | |
Mass Create | On mass upload (Creation) | |
Mass Change | On mass upload (Change) | |
Mass Extend | On mass upload (Extend) | |
Integration | On records integration | |
Task Forward | On task forward to users | |
Excel Upload | On excel upload (Mass dump) | |
Event | Initiate Create | Before initiate create/change/delete |
Before Next | Before creation page loaded | |
After Next | After record creation page loaded | |
Before Save | Before record saved | |
After Save | After record saved | |
After Data Save | After all standard data saved | |
After Approve | After workflow approved from the inbox | |
After Data Approve | After standard workflow data saved | |
Before Approve | Before workflow approved from inbox | |
After Reject | After workflow rejected from inbox | |
Before Reject | Before workflow rejected from inbox | |
Before Continue | Before “Continue” to the next page on workflow approval (Only when there is a criteria field) | |
After Continue | After “Continue” to the next page on workflow approval (Only when there is a criteria field) | |
On Load Tab Page | After Creation/Change page loading through JavaScript values can be defaulted or modified | |
On Load Create Page | After Creation Middle page loading through JavaScript values can be defaulted or modified | |
Before Print PDF | Before print PDF | |
After Create Print | After print PDF | |
Before Print PDF Template | Before print PDF (Custom PDF template if any) | |
After Execute | After workflow approval page loaded | |
Before Execute | Before workflow approval page loaded | |
Description Generate | Only applicable for Material Module | |
E-Sign Continue | After E- Signature submission | |
Before Copy | Before record copied | |
Before Change | Before record change page loaded | |
After Change | After record change page loaded | |
Before Extend | Before record extended | |
After Extend | After record extended | |
Delete | On record delete | |
Print PDF | On print PDF generation | |
Action Change | Restrict change from List page | |
Action Copy | Restrict copy from List page | |
Action Create | Restrict create from List page | |
Action Deletion | Restrict deletion from List page | |
Action Extend | Restrict extend from List page | |
Action Delete | Restrict delete from List page | |
Action Reset | Restrict change from List page | |
Mass Create Before | Before mass data upload | |
Mass Create After | After mass data upload | |
Mass Approve After | After mass data approve | |
Mass Change Before | Before change mass data upload | |
Mass Change After | After change mass data upload | |
Before Publish | During integration through this event values can be modified | |
After Data Object Preparation | During integration through this event values can be modified | |
Before XML Read | During integration through this event values can be modified | |
After XML Read | During integration through this event values can be modified | |
After XML Generation | During integration through this event values can be modified | |
After EDI Generation | During EDI integration through this event EDI data can be changed | |
Before Forward | Before task forward to users | |
Order | Select the order to be executed if there are multiple APIs written for the same module. | |
Enhancement Flow Type | Select Synchronous for all APIs | |
Activate | To activate or deactivate API | |
Plan Code | Enter Zero as default “0” (Plant Code requires only if there are multiple companies hosted on same application) |
Grid Based API:
Grid based APIs are implemented on grids and are triggered on grid events.
Below is the list of fields and events for a Grid based API.
Field ID | Description | |
Select Object | Select object (module) from the list | |
Description | Enter the API description (E.g. Send email to manager after approval) | |
Action | Online | Executes code at runtime based on the event selection |
Background | Executes code at backend (Schedule jobs and call API on scheduled based) | |
Workflow | Executes code based on the workflow event | |
Select Grid | Select required field from the list | |
Process | Create | On record Creation |
Copy | On record Copy | |
Change | On record Change | |
Extend | On record extend | |
Summary | On record summary load | |
Event | On Load | On Grid Load |
On Save | On Record Save | |
On JavaScript | Grid JavaScript validation | |
After Description Generate | Applicable for Material Module only | |
On BOM Confirm | Applicable for Bill of Material Module only | |
Before Form Save | Form data can be validated before saving | |
After Form Save | Form data can be changed after saving | |
On Row Delete | Validation can be performed after deletion of row | |
Order | Select the order to be executed if there are multiple APIs written for the same module. | |
Enhancement Flow Type | Select Synchronous for all API | |
Activate | To activate or deactivate API | |
Plan Code | Enter Zero as default “0” (Plant Code requires only if there are multiple companies hosted on same application) |
Field Based API
These APIs are implemented on fields and are triggered when an “On search” field event occurs.
Below is the list of fields and events for a Field based API.
Field ID | Description | |
Select Object | Select object (module) from the list | |
Description | Enter the API description (E.g. Send email to manager after approval) | |
Action | Online | Executes code at runtime based on the event selection |
Background | Executes code at backend (Schedule jobs and call API on scheduled based) | |
Workflow | Executes code based on the workflow event | |
Select Field | Select required field from the list | |
Event | On Search | |
Order | Select the order to be executed if there are multiple APIs written for the same module. | |
Enhancement Type | Internal API | |
Web Services | ||
Enhancement Flow Type | Select Synchronous for all APIs | |
Activate | To activate or deactivate API | |
Plan Code | Enter Zero as default “0” (Plant Code requires only if there are multiple companies hosted on same application) |
Report Based API
These APIs are used to generate reports.
Below is the list of fields for a Report based API.
Field ID | Description |
Select Object | Select object (module) from the list |
Description | Enter the API description (E.g. Send email to manager after approval) |
Select Field | Select required field from the list |
Enhancement Type | Internal API |
Web Services | |
Enhancement Flow Type | Select Synchronous for all APIs |
Activate | To activate or deactivate API |
Plan Code | Enter Zero as default “0” (Plant Code requires only if there are multiple companies hosted on same application) |