Docs / Write News Bot
Write News Bot
Write News Bot
- Auth
- cookie session + X-Requested-With: cabinhub-console
- Cache-Control
no-store- Source of truth
clients/openapi.jsonanddocs/API.md§12
Create or replace the brief. `prompt is required, topics` optional.
The optional `coverage` boolean lets the scheduler use this brief to select an extra public story. Omitting it preserves the account’s existing choice.
The same write opts the account into the emailed daily digest when `deliver_at is present (a minute of the UTC day, or null to turn it off); deliver_locale` picks the edition language. Keeping it on this route means one call cannot save a brief whose schedule was forgotten, and vice versa.
Description: clients/openapi.json
Parameters
| Name | In | Required | Type | Example | Notes |
|---|---|---|---|---|---|
X-Requested-With | header | no | string |
Example request
curl -sS -X PUT \
'https://vg.tempproject.online/v1/account/news-bot' \
-H "Cookie: cbn_session=$NEWS_SESSION" \
-H "X-Requested-With: cabinhub-console"import json
import os
import urllib.request
URL = "https://vg.tempproject.online/v1/account/news-bot"
def call() -> dict:
req = urllib.request.Request(URL, method="PUT", headers={
"Cookie": f"cbn_session={os.environ['NEWS_SESSION']}",
"X-Requested-With": "cabinhub-console",
})
with urllib.request.urlopen(req, timeout=15) as res:
print(res.status, res.headers.get("Location"))
text = res.read().decode("utf-8")
return json.loads(text) if text else {}
if __name__ == "__main__":
print(call())const res = await fetch(
"https://vg.tempproject.online/v1/account/news-bot",
{
method: "PUT",
headers: {
cookie: `cbn_session=${process.env.NEWS_SESSION}`,
"x-requested-with": "cabinhub-console",
},
},
);
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
console.log(res.headers.get("etag"), await res.json());The requests are generated from the path template and the parameters in clients/openapi.json, so a new parameter appears here without an edit to this site.
Example response
cache-control: no-store
content-type: application/octet-streamNo JSON body on this route; the headers are the ones docs/API.md §2 documents for it
Failures
This operation can answer 200, 400, 401, 422. The full envelope for each status, with its body, is on Errors.