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.
Comments¶
Discussions attached to an article. An API-token integration can list, create, update, and archive comments on behalf of its own end-users. Replies are one level deep via
parent_comment_id. The short reference returned asid(e.g.K7M2Q9XA) — not a UUID — is the handle for update/archive.list_comments¶Returns
CommentList—recordsis a list of rootComments, each carrying up to one level ofreplies. There is no pagination envelope; the endpoint returnsrecordsonly.create_comment¶Returns
Comment— the created comment (HTTP 201). Passparent_comment_idto post a reply.Body (
CommentCreateRequest):Field
Type
contentstr(1–10,000 chars)authorCommentAuthorInput—namerequired; optionalemail,external_idparent_comment_idstr | None(omit for root comments)update_comment¶Replace the content of a comment your token created. Updating someone else’s comment (or one created from the dashboard) returns HTTP 403.
Returns
Comment— the updated comment.client.articles.update_comment("art_1", "K7M2Q9XA", {"content": "Updated text."})archive_comment¶Soft-delete a comment your token created. Archived comments drop out of
list_commentsand the dashboard.Returns
CommentArchiveResponse— an empty marker object; the API responds204 No Content, so in JSON mode this is{}. Success is signalled by the absence of an exception (a 403 means the comment isn’t yours).client.articles.archive_comment("art_1", "K7M2Q9XA")