Service Order Open API Developer Guide
-
- UpdatedJan 30, 2025
- 3 minutes to read
- Yokohama
- Developer guides
Use the Service Order Open API to create, update, and retrieve service order information.
This developer guide provides information on how to extend the Service Order Open API to make various customizations.
Extending the Service Order Open API
The Service Order Open API can be extended by editing script includes.
- TMFServiceOrderAPIUtil: Contains functions to handle POST requests.
- TMFServiceOrderGetAPIUtil: Contains functions to handle GET requests.
- ServiceOrderExtensionOOB: Contains helper functions that support functions in TMFServiceOrderAPIUtil and TMFServiceOrderGetAPIUtil.
- ServiceOrderProcessor: An empty script include file. Use this file to define any functions that you want to override from ServiceOrderExtensionOOB.
Extend the Service Order Open API to make the following customizations.
Required parameters
To change which request body parameters are required or not required to create a service order, override the function getServiceOrderSchema()
contained in the ServiceOrderExtensionOOB script
include.
The function getServiceOrderSchema()
reads the schema from the TMFOrderAPIConstants script include. TMFOrderAPIConstants is protected and can't be edited, so you can't
just update the schema. Instead, a new schema must be read from a different file. You can override getServiceOrderSchema()
to read a new schema. To override getServiceOrderSchema()
, write a
function with the same name in the ServiceOrderProcessor script include. The new function in ServiceOrderProcessor will be called by TMFServiceOrderAPIUtil to
replace the default getServiceOrderSchema()
function in ServiceOrderExtensionOOB.
getServiceOrderSchema()
returns a custom schema that is defined in a new constant file. Request body validation
true
by default.validatePostRequest()
- Called byprocessPostOrder()
in TMFServiceOrderAPIUtil.validateServiceObj()
- Called byprocessPostOrder()
in TMFServiceOrderAPIUtil.validateRelatedPartyObj()
- Called byprocessPostOrder()
in TMFServiceOrderAPIUtil.validateGetRequest()
- Called byprocessGetOrder()
in TMFServiceOrderGetAPIUtil.
false
, it stops the API operation. To apply custom validation, override ServiceOrderExtensionOOB helper functions by creating functions with identical names
and parameters in ServiceOrderProcessor. These new ServiceOrderProcessor functions will be called by TMFServiceOrderAPIUtil and
TMFServiceOrderGetAPIUtil to replace the default ServiceOrderExtensionOOB helper functions.Additional REST operations
To create additional operations beyond the existing GET and POST operations, create additional scripted REST resources for the Service Order Open API. The logic of the new scripted REST resources should be consistent with the existing operations. Define functions for the new operations in a new script include.
Field mapping
When creating records, the API maps request body parameters to record fields. When retrieving records, the API maps record fields to response object attributes.
transformOrderGr()
transformOrdLineItemGr()
transformCustLineItmContact()
transformOrderItemChar()
transformPostOrderResponse()
transformGetOrderResponse()
transformServiceObj()
transformRelatedPartyCustomerLineItem()
transformOrderItemRelationship()
transformGetOrdLineItmResponse()
transformServiceCharacteristics()
transformServiceSpecification()
Customize field mappings to add and retrieve data for additional fields, or to change the default mappings for fields. To customize the field mappings, override ServiceOrderExtensionOOB mapping functions by creating functions with identical names and parameters in ServiceOrderProcessor. These new ServiceOrderProcessor functions will be used by TMFServiceOrderAPIUtil and TMFServiceOrderGetAPIUtil to replace the default ServiceOrderExtensionOOB mapping functions.