Alert channels
POST /darkcrawl/v1/channels/{channel_id}/test
Copy page
Send a test alert to a channel now.
POST /
Authentication: your key as a bearer token.
Path parameters
| Field | Type | Required | Default |
|---|---|---|---|
channel_id | string | Required |
Request
curl -X POST https://api.darkcrawl.dev/darkcrawl/v1/channels/CHANNEL_ID/test \
-H "Authorization: Bearer $DARKCRAWL_API_KEY"import os
import requests
resp = requests.post(
"https://api.darkcrawl.dev/darkcrawl/v1/channels/CHANNEL_ID/test",
headers={"Authorization": "Bearer " + os.environ["DARKCRAWL_API_KEY"]},
timeout=330,
)
print(resp.json())const resp = await fetch("https://api.darkcrawl.dev/darkcrawl/v1/channels/CHANNEL_ID/test", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.DARKCRAWL_API_KEY,
},
signal: AbortSignal.timeout(330000),
});
console.log(await resp.json());Response
Status 200.
{
"delivered": true,
"status": 200,
"error": null
}Errors
| Code | Status |
|---|---|
NOT_FOUND | 404 |
CONFLICT | 409 |
What each code means, and what to do about it: Errors.
Notes
- The test holds no page text. The call waits for the receiver's answer:
statusis the status the receiver answered with, anderroris a code when the test did not get through. - A test is
409 CONFLICTwhile a send to the channel is in flight. Try again. - An unknown id, and another company's channel, answer
404 NOT_FOUND.