ScreenSteps 5

Updating article content through the API

Updated on

Review API Update Limitations

  • You can only update text content via API.
  • To replace images, use the ScreenSteps web or desktop app.
  • API updates appear in Activity logs as the user whose credentials are used.

Retrieve Article Content

  1. Get the article JSON via the API.
    How to retrieve article contents
  2. Find the content_blocks key.
    • Each block has: uuid, type, depth.
    • depth 0 = top-level block.
    • type shows block type (see table below).
Content Block TypeValues
StepContenttitle: string
content_block_ids: array
foldable: boolean
auto_numbered: boolean
depth: integer
TextContentbody: string (html text)
style: string (introduction, info, alert, tip, or warning)
HtmlEmbedContentbody: string (html text)
ImageContentBlockimage_asset_id: integer
alt_tag: string
AttachmentContentfile_asset_id: integer
CodeContentbody: string
TableContentbody: string
  • StepContent blocks are headings and can have child content_block_ids.

Modify Article JSON

  • Edit the content_blocks array to update text.
  • To add blocks, include all required values from the table above.

Upload Changes via API

  1. POST the modified JSON to:
    /api/v2/sites/:site_id/articles/:article_id/contents
  2. Include JSON data like:
    {  article: {    title: "Article title",    content_blocks: [      { uuid: "ase4399s", type: "StepContent", title: "First step", depth: 0 }    ],    publish: true  } }
  3. Set publish to true to make updates live.
    If omitted, a draft is saved.
Previous Article Example requests and responses (v2 JSON API)
Next Article Resolving Internal Links in API