Articles¶
Individual articles (the content piece going to an outlet) within a campaign.
client.articles # ArticlesResource
Methods overview¶
Method |
HTTP |
Scope |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
get¶
def get(
article_id: str,
*,
as_json: bool | None = None,
) -> Article | dict
Returns Article — the article’s brief URL, draft URL, live URL (when published), writer, current status, and expected completion date.
art = client.articles.get("art_1")
print(art.name, art.status.name, art.expected_completion_date)
update¶
def update(
article_id: str,
body: ArticleUpdateRequest | BaseModel | dict,
*,
as_json: bool | None = None,
) -> Article | dict
Returns Article — the updated article.
Body (ArticleUpdateRequest):
Field |
Type |
|---|---|
|
|
|
|
Example
from pypresscart import ArticleUpdateRequest
client.articles.update(
"art_1",
ArticleUpdateRequest(brief_google_doc_url="https://docs.google.com/document/d/..."),
)
approve_brief¶
Mark the brief as approved — moves the article forward in the workflow.
def approve_brief(
article_id: str,
*,
as_json: bool | None = None,
) -> Article | dict
Returns Article — the updated article. No request body.
client.articles.approve_brief("art_1")
approve_draft¶
Approve the draft, optionally providing the Google Doc URL if it’s not already set.
def approve_draft(
article_id: str,
body: ApproveDraftRequest | BaseModel | dict | None = None,
*,
as_json: bool | None = None,
) -> Article | dict
Returns Article — the updated article.
Body (optional) — ApproveDraftRequest(draft_google_doc_url=...).
client.articles.approve_draft(
"art_1",
{"draft_google_doc_url": "https://docs.google.com/document/d/..."},
)
Recipes¶
Walk the approval flow¶
art = client.articles.get("art_1")
if art.status.name == "Brief Ready":
client.articles.approve_brief(art.id)
# ...later, when writer submits draft...
client.articles.approve_draft(
art.id,
{"draft_google_doc_url": draft_url},
)
List all articles for a campaign¶
Use client.campaigns.list_articles(campaign_id) — see Campaigns.