Run your API in test mode to confirm it processes records the way you expect before you deploy it to production. A test run lets you review the behavior of each step — transformation, mapping, filter, or hook — and adjust your configuration to handle every variation of result or response those steps might return.
Before performing test runs, you must:
- Configure your API request.
- Configure your API response.
- Configure your lookups and imports.
- Provide mock API request data for your request and any lookup step you want to test.
- Provide mock response data for each import.
Your test run logs include the headers, query parameters, and path parameters from your mock data. As with test mode in the Flow builder, you can review test run results and execution logs for each step and hook.
Run test is disabled if any of the following are true:
- If the HTTP method and Relative URI are not configured in the API request.
- If mock data is not available in the API request, except for APIs using the
GETmethod. - If the HTTP status code is not configured in the API response.
You can run a test using one of two ways:
- Click Run test at the top right of the API builder
- Click Run test in the Run console panel
You can watch an API as it's running and access the errors as they are reported (even before the API run has been completed) using the Run console. The top half of the page shows the API configuration, and the Run console appears on the first tab below. You can see detailed information for each step in the API as it runs.
Note
The Run console reflects the status of the most recent run or the run currently in progress. If you begin to resolve errors, this is NOT reflected in the error counts.
Reviewing the error messages and codes provided during the test run is extremely important. These messages often contain specific details about what went wrong and where. By thoroughly analyzing test run errors, you can proactively resolve issues, optimize your API, and ensure it works as expected before deployment.
You can perform debugging for every step of your API, including the request and responses, branches, lookups, and imports. Look for the blue T that designates a test run log as available for that step.
To view your test run errors:
- Use the Test run
button to run a test.
-
After completing your test, review the Run console to see where your errors occurred.
-
Click the error button or the blue T in the step to open the Test run errors window. In steps where only the blue T appears instead of the error indicator, you'll need to open the step first; then, use the View debug logs button to open the logs for the step.
-
Review your errors.
During the test run, the Run test button is replaced with a Cancel test run button. Click Cancel test run to abort the test run.
If a test run takes over 100 seconds, the system displays a message due to the long processing time. You can either cancel the run or wait for it to complete.
To avoid system performance issues, the test run will be auto-canceled in the following scenarios:
- if the API runs longer than two minutes
- Uncaught exceptions
Test run data is automatically deleted in the following scenarios:
- When your Celigo platform session expires
- On running the next test API in the same session
- On navigating away from the API builder
- On changing the URL
Keep in mind these important tips to get started with test mode:
-
Always add mock response data to each destination step before you run your first test. Otherwise, dummy data will auto-populate the first run, which will not provide accurate test results. You can add mock response data either by...
- Clicking Populate with live data inside a destination's mock response panel (running the import can result in records being updated or created)
- Entering your own data from the app's API documentation (must include
statusCode)
- Test results will not change until the next test run, even if you modify the API configuration.
- Test results will be cleared and are not saved if you navigate away from your API, refresh, run a new test, or enable your API.
Debug mode temporarily elevates logging to the Debug level for your API, capturing complete execution detail — request and response payloads, headers, and inputs and outputs for internal step components such as mappings and transformations — for every request received while it's active. It overrides whatever log level is otherwise set for as long as it's on.
Note
Debug mode is separate from the test run functionality described earlier in this article. Test runs validate your API configuration against mock data before deployment. Debug mode captures live execution detail for real inbound requests once your API is running.
To enable debug mode:
- In API builder, select the debug icon in the toolbar.
- In the Capture debug logs for next panel, enter a duration in hours and minutes.
- Select Start.
Debug mode takes effect immediately, and every request received during the active window is logged at the Debug level. You can view the captured logs in the Request history tab — see View API request and execution logs in API builder.
The minimum duration is 5 minutes. The maximum debug duration depends on your subscription:
| Subscription | Maximum debug duration |
|---|---|
| Free trial | 15 minutes |
| Standard | 1 hour |
| Professional | 24 hours |
| Enterprise | 72 hours |
Warning
Debug logging requires payload consent to be enabled at the account level by an admin or owner. If payload consent is not enabled, you will see a prompt to request admin approval when attempting to enable debug mode. You can resend the request once every 24 hours.