Test a source or one of its koppelingen
const url = 'https://example.com/api/v1/sources/example/test';const options = { method: 'POST', headers: { cookie: 'bl_%3Cslug%3E_session=%3Cbl_%3Cslug%3E_session%3E', 'Content-Type': 'application/json' }, body: '{"object":"example","local_id":"example","auth_header_value":"example","provides":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/sources/example/test \ --header 'Content-Type: application/json' \ --cookie bl_%3Cslug%3E_session=%3Cbl_%3Cslug%3E_session%3E \ --data '{ "object": "example", "local_id": "example", "auth_header_value": "example", "provides": "example" }'Without a body or object: asks the system’s health path with its key (without one, whether the address answers). With object: the discovery of that building (GET v1/buildings/{id}/points, or /topology for a koppeling that only provides the indeling), optionally with changes that are not saved. The answer shows the request without the key and what came back.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The id of the source.
Request Body
Section titled “Request Body”A koppeling to test: the building, and its own id, key and what it provides when they differ (also before it is saved).
object
The building to test; left out: test the system itself.
The system’s own id of the building.
A key for this building only; •••••• is the saved one.
data, topology or both.
Example generated
{ "object": "example", "local_id": "example", "auth_header_value": "example", "provides": "example"}Responses
Section titled “Responses”The outcome, also when the test failed (ok: false).
The outcome of a test of a system or a koppeling, as the UI shows it.
object
system or koppeling.
Where it went wrong: unreachable, key, unknown, answer or invalid; null when ok.
The HTTP status of the system’s answer.
Milliseconds.
The request as sent, without the key: method, url, header (its name).
object
What came back: status, content_type, body (at most 64 KiB), bytes, truncated.
Koppeling: the building, and its id in the system.
Koppeling: how many points and locations the system listed.
Example generated
{ "kind": "example", "ok": true, "stage": "example", "status": 1, "ms": 1, "message": "example", "request": {}, "response": "example", "object": "example", "local_id": "example", "points": 1, "locations": 1}The request is not valid.
The body of every failed call to a management API.
object
object
Stable, machine-readable: invalid_request, unauthenticated,
forbidden, not_found, conflict, upstream_unavailable,
unavailable, internal, or a more specific code of the operation.
For people; may change between versions.
Example
{ "error": { "code": "not_found", "message": "unknown negotiation" }}No valid session, DPoP-bound token or API key.
The body of every failed call to a management API.
object
object
Stable, machine-readable: invalid_request, unauthenticated,
forbidden, not_found, conflict, upstream_unavailable,
unavailable, internal, or a more specific code of the operation.
For people; may change between versions.
Example
{ "error": { "code": "not_found", "message": "unknown negotiation" }}The caller lacks the role this operation needs; or a change with the session cookie came from a page of another site (cross_site_request, decisions #83).
The body of every failed call to a management API.
object
object
Stable, machine-readable: invalid_request, unauthenticated,
forbidden, not_found, conflict, upstream_unavailable,
unavailable, internal, or a more specific code of the operation.
For people; may change between versions.
Example
{ "error": { "code": "not_found", "message": "unknown negotiation" }}Not found.
The body of every failed call to a management API.
object
object
Stable, machine-readable: invalid_request, unauthenticated,
forbidden, not_found, conflict, upstream_unavailable,
unavailable, internal, or a more specific code of the operation.
For people; may change between versions.
Example
{ "error": { "code": "not_found", "message": "unknown negotiation" }}