Testing an API operation
Using the Swagger API tool
It is possible to test defined API endpoints directly from ACE with all defined properties by clicking Try it out.
Testing the API
Clicking execute in the Try it out view performs an API request. Request is then matched by the API operation and associated flow is called to process the data and produce a response:
The Try it out view lets you pass query parameters that are defined in the form. Update the form to pass additional data.
// Code: 200
{
"fullName": "Unknown",
"requestTime": "2023-07-05T15:59:23.888Z"
}
// Query params: ?name=Joe&surname=Test
// Code: 200
{
"fullName": "Joe Test",
"requestTime": "2023-07-06T05:11:54.793Z",
"name": "Joe",
"surname": "Test"
}
The query parameters were received as nodes name
and surname
in the flow document. This will also happen to any data sent in the request body or path parameters.
Using external tool
If the swagger API tool is not sufficient for testing the API, the generated URL can be imported into external tooling or called from the commandline. If using ACE Web make sure the ace-development
header value is re-generated after making any changes to your workspace.
Extracting the URL
A cURL command matching the sent request is generated in the API tool.
curl -X 'GET' \
'https://dev.ace-instance.com/ace/api/transformUser' \
-H 'accept: */*' \
-H 'ace-development: eyJyZXBvc2l0b3...'
Only use this URL for development. The URL is pointed at a development version of your API. APIs need to be deployed before they can be used in production.
Every time changes are made to the workspace the ace-development
header has to be regenerated.
Using an outdated value in the ace-development
header causes the request to happen on an older version of the API which does not reflect latest changes.