We will use Create Customer as a sample to define the REST API Endpoint Group.
Go to the ##RestEndpointGroup worksheet. AlchemyJ Workbook can support multiple REST API Endpoint Groups worksheets.
In the Basic Settings section, key in the values as shown below for the basic settings. This defines the endpoint group name.
Item
Value
Endpoint group
CustomerService
Endpoint group path
/customers
Next, we define the function point Create Customer. In the Function Points section (for output & declaration of function), key in the values as shown below. For REST API, the output must be an object defined in the Data Relationship Schema.
Function Point
Path
Operation
Response Data Address
Response File Address
DB Operation Type
Create Customer
/customer
POST
CreateCustomer!B21:L24
Transactional
The Response Data Address is the output data relationship schema which is defined in the business logic sheet
In the Input Parameters section, key in the values as shown below. The input is an object and the Data Address is the output data relationship schema which is defined in the business logic sheet.
Function Point
Style
Name
Data Type
Data Address
Required
Create Customer
Request body
customer
Object
CreateCustomer!B15:L18
Yes
Our model expects the customer name at GetCustomer!C12. Therefore, in Function Input Parameters section, we define an input parameter called name for Function Point Get Customer. Name should be a string so its parameter class is String. Set Data Address to GetCustomer!C12 so that when the method is invoked, it will set the input value to GetCustomer!C12 at run-time.