REST API Endpoint Group Worksheet
Introduction
The following sections are provided in this worksheet:
- Basic Settings
- Function Points
- Input Parameters
- Function Point Response Operations
- Related Worksheets
Basic Settings
Defines the basic information for a REST API Endpoint Group.
Item | Description |
---|---|
Endpoint group | Defines the name of the REST API Endpoint Group if required. |
Endpoint group path | Defines the path of this REST API Endpoint Group. |
Tags | The OpenAPI specification groups the operations by tags. You can specify the tag name for the endpoints defined in the current worksheet. Currently, it only supports a single value and will support multiple values in the future. |
Description | The description of the endpoint group. It will appear in the OpenAPI specification to describe the tag. |
Function Points
Defines the function list and output properties for this REST API Endpoint Group.
Item | Description | Remark |
---|---|---|
Function Point | The name of the Function Point. | The Function Point list will be shown in AlchemyJ > Preview Function Point. |
Path | The URI of this Function Point. The actual path is the concatenation of Endpoint Group Path and Path. | It could be a static path or a dynamic path. For example: if Endpoint Group Path is "Customers" and Path is "/all", the URL for this endpoint is <domain>/Customers/all. To use a dynamic path, use open and close curly brackets to define variables. For example, <domain>/Customer/{id}. The actual value of id in the path can be extracted as input parameter by using URL path segment style in Input Parameters table. |
Operation | HTTP method for this endpoint. | It can be: POST - Use POST to create new subordinate resources. e.g. a file is a subordinate to a directory containing it or a row is subordinate to a database table. GET - Use GET requests to retrieve resource representation/information only PUT - Use PUT to update an existing resource. If you want to update a specific resource (which comes with a specific URI), you can call the PUT method to that resource URI with the request body containing the complete new version of the resource you are trying to update. PATCH - The PATCH method is similar to the PUT method because it also modifies an existing resource. The difference is that for the PUT method, the request body contains the complete new version, whereas for the PATCH method, the request body only needs to contain the specific changes to the resource, specifically a set of instructions describing how that resource should be changed, and the API service will create a new version according to that instruction. DELETE - Use DELETE to delete a specific resource. |
Response Data Type | The return data type. | It can be: File Object |
Response Data Address | The cell address that AlchemyJ should refer to for the output of this function. | When Response Data Type is Object, the value should be the address of a Data Relationship Schema that defines the structure of the response. When Response Data Type is File, the value should be the address of the output file path. |
Data Source ID | The data source ID when DB connection is required. | The data source ID should exist in ##ExternalResources Worksheet. Multiple data source IDs should be separated using a comma. |
Kafka Connection ID | The Kafka connection ID when Kafka service is required. | The Kafka connection ID should exist in ##ExternalResources Worksheet. Multiple connection ID shall be separated by a comma. |
Mark Deprecated | Whether the Function Point will be marked as deprecated. | Yes - The endpoint path in OpenAPI specification will be crossed out which indicates the endpoint is deprecated. Blank - Do not mark. |
Description | Description of the API Function point. | It will be shown in OpenAPI specification beside the endpoint path. |
Notes | The notes of the API Function point. | It will be shown in OpenAPI specification under the endpoint path. |
Input Parameters
Input parameters for defined endpoints if any.
Item | Description | Remark |
---|---|---|
Function Point | The Function Point that this input parameter refers to. | The value must exist in the Function Point table's Function Point column. |
Style | Style refers to the parameter style. | The valid inputs are: All request headers - all attributes in HTTP Header in JSON format All request parameters - all request parameters in JSON format Cookie item - data retrieved from browser cookie HTTP header - data retrieved from HTTP Header Request body - a node retrieved from the request body. Request parameter - a field retrieved from query parameters, form data, and parts in multi-part requests Session variable - data retrieved from the session variable URI path segment - data retrieved from the URI path, such as https://localhost/001/getCustomerInfoById. |
Name | The Name of this parameter. | It must begin with an alphabet and contain no space and dot. |
Data Type | The value could be held for this parameter | The value can be: Big Number: the length of return number could be more than 15. Big String: the length of return string could be more than the Excel maximum number of character (32727) limitation. Boolean: TRUE or FALSE Date: Date value Double: A whole number between 4.9406564584124654 x 10^-324. to 1.7976931348623157 x 10^308 Integer: A whole number between -2,147,483,648 and 2,147,483,647. String: Text value Object: Object |
Data Address | The cell address that this parameter value should be written to. | It should include the sheet name. For example, Sheet1!A2. If Data Type is Object, this should be the address of a Data Relationship Schema. It is recommended to use ajAddress to get the address value instead of typing in an address manually. |
Required | The parameter is required or not. | Valid inputs: Yes, No. |
Default Value | The default value of the parameter. | When the parameter is not provided, the default value will be used for the parameter. |
Example Value | The example value of the parameter. | It will appear in the OpenAPI specification to guide the user to input the parameter and will be used in Testing Tool as default value. |
Description | The description of the parameter | It will appear in the OpenAPI specification as the description of this input parameter. |
Function Point Response Operations
Item | Description | Remark |
---|---|---|
Function Point | The Function Point that this input parameter refers to. | The value must exist in the Function Points table Function Point column. |
Style | Indicates which type of Function Point Response Operation this refers to. | The valid inputs are: Clean up files - Reserved for future use. Set Cookie - Set a value in a browser cookie.Set Response Header - Set a value into the HTTP Header of the response message. Set Session - Set a value into the Session object in Java. Please note that some special characters such as " " (space) is invalid in an HTTP header and cookie value. Check the Internet Engineering Task Force (IETF) for the allowable characters in the HTTP header field values. |
Name | The Name of the parameter to be set | |
Data Address | The cell address that contains the value of this parameter. It should include the sheet name. | It should include the sheet name. For example, Sheet1!A2. If the Class is object, the Data Address should be the address of a Data Relationship Schema. It is recommended to use ajAddress to get the address value instead of typing in an address manually. |
Related Worksheets
The Related Worksheet section defines the function point and worksheet relationship. There is no need to include system worksheets and definition worksheets, such as : %%AppConfig, %%SysRuntime, ##JavaApiPackage and so on. The worksheets of the component and snippet should be included, such as the Data Relationship Schema. AlchemyJ provides an utilities in AlchemyJ ribbon -> More Tools -> Configure Function Point Related Worksheets provides a user interface to setup this table.
Item | Description |
---|---|
Function Point | The name of the function point. If the function point is blank, then all function points in this class will use the defined worksheet names. It is recommend to define the necessary worksheet for each function point. |
Worksheet Name | Related Worksheet name of the function point. |