Appearance
Testing your implementation
Check your API in three steps. Do the first two before you connect. The third is the real check, and it runs in DataFlair.
1. Run it locally, before you deploy
Run the conformance check against your server. It replays the fixtures and prints a pass or a fail for each case, with a link to the section that explains each failure. It runs against localhost and needs no DataFlair account.
bash
node tools/adserver-check/bin/adserver-check.mjs http://localhost:3000/api/v1 --key sk_test_localThe checker is not published to npm yet. Conformance check says where it is and how to run it. Add --only orders to check one endpoint.
A failing case shows the value it found and links to the rule. This is the first failing case of a server that returns its orders as ACTIVE:
text
✗ POST /orders 201 Creates a draft order
Order "ord_55021" returned as "ACTIVE". It must come back as DRAFT and must not serve.
Line item "li_88012" returned as "ACTIVE". Every line item must come back as DRAFT and must not serve.
→ See https://docs.dataflair.ai/marketplace/ad-server-api/operations/orders#draft-onlyOr by hand
Send each request to your own server with curl. Every endpoint page has a curl tab that you can copy:
| Endpoint | Page |
|---|---|
GET /health | Health |
GET /inventory | Inventory |
POST /forecast | Forecast |
POST /orders | Orders |
POST /reports | Reports |
Set BASE_URL and API_KEY first:
bash
export BASE_URL=http://localhost:3000/api/v1
export API_KEY=sk_test_localCheck each answer against the fields table on the page. Then check these rules, which are the ones that break most often:
GET /healthreturnstimezoneas a real IANA name,currencyas three uppercase letters, andcapabilitiesas booleans withreportinganddraft_bookingset totrue.POST /ordersreturnsstatus: "DRAFT"for the order and every line. It does not activate anything. See Draft only.- A repeat of the same
idempotency_keyand body returns the same ids. The same key with a different body returns409. line_item_idvalues do not change when a line is renamed.
2. Compare with the fixtures
The fixtures are the requests DataFlair sends, each with an answer that passes. exemplary/ holds the happy path. supplemental/ holds errors and edge cases.
3. Connect and verify in DataFlair
The Verify button is in the DataFlair Marketplace app. Only workspace owners and admins can use it.
- Go to Settings, then Ad server.
- Choose the Custom ad server card. Its description is "Connect over a bearer API key."
- Enter your Base URL, for example
https://ads.example.com. It is the HTTPS root DataFlair calls/healthagainst. - Enter your API key.
- Click Connect & verify.
DataFlair then runs a short read-only probe. It creates nothing.
- It calls
GET /healthwith your key. This decides whether the connection is Connected. - If
/healthsucceeds, it callsGET /inventory?limit=1. This confirms Inventory read.
The card then shows your account name, timezone and currency, the time of the last verification, and a capability checklist.
| Capability | State today |
|---|---|
| Inventory read | Confirmed when GET /inventory returns a data array. Otherwise Not verified. |
| Forecast | Not verified. "Not built yet." |
| Reporting | Not verified. "Not built yet." |
| Draft booking | Not verified. "Not built yet." |
After you change your API, click Re-verify on the card. To start again, click Disconnect.
If the card shows an error, see Errors and Troubleshooting.