How to Test API Endpoints You Just Discovered
Found is not tested. Connect a traffic file as a source, read the evidence behind each API, confirm or dismiss it, then accept the APIs into a new project and run their generated tests.
This is lesson 9.19 of Shift-Left API in Depth, the product track of the learning center, and the second half of Discovery. Lesson 9.18 found APIs with a scan and a capture and read them in the inventory, and none of them was ready to test yet. API Discovery is a paid add-on and is included in the 15-day trial.
How do you test API endpoints you have only just found?
Think of it as a loop. Discovery finds APIs, and says how sure it is that each exists and whether it could be tested. You read the evidence, decide what is real, and accept APIs into a project, where they become endpoints with generated tests. Then you run the tests. Discovery itself never sends a request to an API it found; the tests do, when you run them.
What does each decision do?
- Confirm it is real: it exists. Nothing is sent to it.
- Dismiss: hidden from review, with your reason. Restore undoes it.
- Accept into a project: endpoints and tests are generated. Nothing has run yet.
- Remove a source: it stops, and what it found stays.
- Forget a source: what it read is erased. This cannot be undone.
Connect a source, end to end
Click Sources → Add a source → Traffic capture or access log. It reads a HAR file or a similar capture of calls someone saved. Name it, then keep only the host you care about, because a capture from a proxy holds every app on a computer. Choose Re-read it from an address so it can run on a schedule, paste the file's address, pick the secret (none here) and a schedule, then click Create and run. When the run says Finished, the card shows its kind, one word for its health, what the last run found and when it runs next. Under the cards, administrators open Discovery settings to set how long evidence is kept.
Scan again, and read the evidence
Back on the Overview, Scan again compares with your last scan and marks anything new. A web page with no API can be ignored. In Inventory, Add an API by hand covers a partner's endpoint no source reports. Filters narrow by kind, discovery status, test readiness, domain and more, and Search by meaning finds an operation by what it does.
Click an operation's name to open its evidence. Can it be tested? lists in words what is missing: it is in no project, no specification describes it, and a person should confirm it. Why we think it exists and Recent evidence show the calls behind it.
Decide: several at once, or one at a time
In Review, tick the calls you watched an app make and Confirm selected. For one operation, open its evidence and choose Confirm it is real, or Dismiss a health check with a reason such as a load balancer's probe, which is not an API to test. You can also edit its name and owner.
Accept into a project, and run the tests
Back in Inventory, search for the host, tick every operation on the page and click Accept N operations into a project. Choose A new project, name it, leave Generate tests for them ticked and click Accept. Open the project: its features come from the specification's tags, with every endpoint and its tests, all Not Run. Tick them and click Run Selected; the Bulk Run Summary reports how many passed.
The last chapter covers the Coverage tab, which shows what each source read and skipped, Applications, which group APIs under one name, and Agents, which read sources inside your network and send back only the operations they found.
Try it yourself
With a trial: open Discovery, add a source, and read an operation's evidence in Inventory. Confirm or dismiss what you find, then accept the real ones into a new project and run their tests.
Recap
- To test API endpoints you just found, read how sure Discovery is, then confirm or dismiss each one.
- Accepting makes operations endpoints in a project and can generate their tests; Discovery never calls the API.
- You run the tests, and the project shows each endpoint's result.
- Sources can be removed, which keeps what they found, or forgotten, which erases it.
Next, lesson 9.20 covers the Overview tab and one API's record, where the API you accepted shows its tests, security checks, mocks and load results on one page.
Try it: With a trial, open Discovery in the desktop app, add a source (a HAR traffic file or a specification at an address), read an operation's evidence in Inventory, confirm or dismiss what you find, tick the operations that are real and accept them into a new project with Generate tests for them ticked, then run the tests.
Frequently asked questions
How do you test API endpoints that Discovery has only just found?+
Read how sure Discovery is and whether the operation can be tested, confirm what is real, dismiss what is not, then accept the operations into a project. Accepting turns them into endpoints there and can generate their tests. You run the tests yourself; Discovery never sends a request to an API it found.
What does each Discovery decision do?+
Confirming says an operation exists and sends it nothing. Dismissing hides it from review with your reason, and Restore undoes it. Accepting makes it an endpoint in a project and can generate tests without running them. Removing a source stops it while what it found stays. Forgetting a source erases what it read and cannot be undone.
Is Discovery included in every edition?+
API Discovery is a paid add-on and is included in the 15-day trial. Scan and capture run in the Shift-Left Studio desktop app.
Related lessons
You can only measure test coverage on the APIs you know about. Switch on Discovery, scan your computer, capture an app's calls and read the inventory, where every row says how sure Discovery is.
Which of your APIs have tests, security checks, a mock or a load test? The Overview lists every API of a project with what it has had, and each API has a record of its own. Looking runs nothing.
Your OpenAPI spec is most of a test plan already. Import it into Shift-Left API, explore what it creates, and generate tests from it with no requirements needed.