OpenapiMarketing
Returns one of the caller org's posts, including the exact error behind a…
Returns one of the caller org's posts, including the exact error behind a failed publish.
GET /v1/marketing/calendar/{id}
| Address | https://api.hanzo.ai/v1/marketing/calendar/{id} |
| Method | GET |
| Operation | get_marketing_calendar_by_id |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Returns one of the caller org's posts, including the exact error behind a failed publish. A post belonging to another org reads as not found.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | ID is the post id from the path, as returned by create. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | CalendarPost | ok |
200 body — 10 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
body | body | string | — | Body is the post text. |
channel | body | string | — | Channel is the target network: x, facebook, instagram, linkedin, tiktok, youtube or threads. |
createdAt | body | integer | — | CreatedAt is unix seconds when the post was added, server-assigned and never rewritten. |
error | body | string | — | Error is the exact reason the last publish attempt failed — the honest record behind a "failed" status, never a faked success. |
id | body | string | — | ID is the server-assigned post id ("cal_" + 128 random bits). |
publishedAt | body | integer | — | PublishedAt is when the publish succeeded; 0 until it does. |
scheduledAt | body | integer | — | ScheduledAt is the unix publish time; 0 leaves the post a draft, and any value makes it "scheduled" for the durable sweep to pick up. |
status | body | string | — | Status is draft, scheduled, published, failed or canceled. |
title | body | string | — | Title is the post's internal label, capped at 1024 bytes. |
updatedAt | body | integer | — | UpdatedAt is unix seconds of the last write, server-assigned. |
Failure carries the platform error shape — see Errors.
Examples
hanzo marketing calendar get <id>import { Configuration, MarketingApi } from 'hanzoai';
const api = new MarketingApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getMarketingCalendarById({ id: 'id' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import MarketingApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = MarketingApi(client).get_marketing_calendar_by_id(id='id')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.MarketingAPI.GetMarketingCalendarById(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, marketing_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = marketing_api::get_marketing_calendar_by_id(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.MarketingApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new MarketingApi(client).getMarketingCalendarById();curl https://api.hanzo.ai/v1/marketing/calendar/<id> \
-H "Authorization: Bearer $HANZO_API_KEY"Tool marketing, op get_marketing_calendar_by_id — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "marketing",
"arguments": {
"op": "get_marketing_calendar_by_id",
"input": {
"id": "<id>"
}
}
}
}'How is this guide?