Update a published article
  • 12 Jul 2022
  • 2 Minutes to read
  • Contributors
  • Dark
    Light

Update a published article

  • Dark
    Light

Updating and publishing an article with API allows you to automate the authoring process. Three steps are involved in updating an article:

  1. Fork the article
  2. Update the article content
  3. Publish the article

Fork the article

1_Screenshot-Forks_an_article

  1. Under v2, expand Articles{article Id} and click Forks an article with an ID

  2. In the Params tab, you can find the Path variables section

  3. In the 'Value' field of articleId, paste the desired article id
    2_Screenshot-Forks_an_article_body

  4. Navigate to the Body tab in the main window

  5. You can find the below parameters:

    • lang_code - Add the desired language code. Language code is filled as 'en' by default
    • user_id - Add the desired user id
    • version_number - Add the desired version number you want to fork

    For example, If you want to create an article version by forking version 3, mention the 'version_number' as 3

    How to find the versions of an article?

    a. Under v2, expand Articles{article Id}{lang Code}versions and click Get all article versions
    b. In the Params tab, you can find the Path variables section
    c. In the 'Value' field of articleId and langCode, enter the desired article id and language code
    d. Click Send
    e. All the versions of that article appears in the Response section

  6. Click Send and the desired article version is created


Update the article

4_Screenshot-Updates_an_article

  1. Under v2, expand Articles{article Id}{lang Code}settings and click Updates an article with the ID

  2. In the Params tab, you can find the Path variables section

  3. In the 'Value' field of articleId, paste the desired article id

  4. In the 'Value' field of langCode, type in the desired language code. Language code is filled as 'en' by default
    5_Screenshot-Updates_an_article_body

  5. Navigate to the Body tab in the main window

  6. You can find the below parameters:
    title, content/html_content, category_id, and version_number are mandatory parameters.

    • title - Add the desired article title
    • content - Add the desired article markdown content. If the editor type is Markdown, update here. If the article is in the WYSIWYG editor, remove this parameter.
    • html_content - Add the desired HTML content. If the editor type is WYSIWYG, update here. If the article is in the Markdown editor, remove this parameter.
    • category_id - Paste the desired category id
    • hidden - Hide/Show article
    • version_number - Add the desired article version you want to update
    • translation_option - Mention the translation status of the article. 0 - None, 1 - Needs translation, 2 - Translated
    • source - Mention any free text. It can be used for future reference
Remove the parameters you do not want to update

The parameter values in this tab are updated for the respective settings in the article. If the unwanted parameters are not removed, the unwanted parameters also get updated.

  1. Click Send
  2. The article changes are updated successfully. You can verify this with the 200 OK status and success parameter value as true

Publish the article

To publish an article, you need the following values:

  1. Article id
  2. User id

6_Screenshot-Publishes_an_article

  1. Under v2, expand Articles{article Id} and click Publishes an article with an id
  2. In the Params tab, you can find the Path variables section
  3. In the 'Value' field of articleId, paste the desired article id
    7_Screenshot-Publishes_an_article_body
  4. Navigate to the Body tab in the main window
  5. You can find the below parameters:
    • user_id - Paste the desired user id
    • version_number - Add the desired article version number
    • publish_message - Add the desired publish message for the article
  6. Click Send
  7. The desired article is published successfully. You can verify this with the 200 OK status and success parameter value as true

Was this article helpful?