Publishes multiple articles
  • 26 Sep 2023
  • 5 Minutes to read
  • Contributors
  • Dark
    Light

Publishes multiple articles

  • Dark
    Light

Article Summary

Post
/v2/Articles/bulkpublish/{langCode}
Security
API Key
Header parameter nameapi_token
Enter REST API key. To generate a key, go to Settings → Knowledge base portal → API tokens
Path parameters
langCode
stringRequired

Language code of the article

Default"en"
Body parameters
Publish Article Request Example

Publishing an article with ArticleId, langCode, user_id, version_number, and publish_message.

[
  {
    "article_id": "8bcd4bf9-eb93-40d9-a8df-c3b518660ceb",
    "user_id": "f11efc6f-e968-4e95-82eb-85ad61559de8",
    "version_number": 1,
    "publish_message": "multiple article published"
  },
  {
    "article_id": "2ce2607f-6cfa-4bc9-9e47-1dc3843198629",
    "user_id": "f11efc6f-e968-4e95-82eb-85ad61559de8",
    "version_number": 1,
    "publish_message": "multiple article published"
  }
]
Array of object
object
article_id
string Required

The ID of the article

Min length1
user_id
string Required

The ID of the team account that will be marked as the contributor of this publish

Min length1
version_number
integer (int32) Required

The version number of the article to be published

Max length32767
Min length1
publish_message
string

The publish message of the article

Publish Article Request Example

Publishing an article with ArticleId, langCode, user_id, version_number, and publish_message.

[
  {
    "article_id": "8bcd4bf9-eb93-40d9-a8df-c3b518660ceb",
    "user_id": "f11efc6f-e968-4e95-82eb-85ad61559de8",
    "version_number": 1,
    "publish_message": "multiple article published"
  },
  {
    "article_id": "2ce2607f-6cfa-4bc9-9e47-1dc3843198629",
    "user_id": "f11efc6f-e968-4e95-82eb-85ad61559de8",
    "version_number": 1,
    "publish_message": "multiple article published"
  }
]
Array of object
object
article_id
string Required

The ID of the article

Min length1
user_id
string Required

The ID of the team account that will be marked as the contributor of this publish

Min length1
version_number
integer (int32) Required

The version number of the article to be published

Max length32767
Min length1
publish_message
string

The publish message of the article

Publish Article Request Example

Publishing an article with ArticleId, langCode, user_id, version_number, and publish_message.

[
  {
    "article_id": "8bcd4bf9-eb93-40d9-a8df-c3b518660ceb",
    "user_id": "f11efc6f-e968-4e95-82eb-85ad61559de8",
    "version_number": 1,
    "publish_message": "multiple article published"
  },
  {
    "article_id": "2ce2607f-6cfa-4bc9-9e47-1dc3843198629",
    "user_id": "f11efc6f-e968-4e95-82eb-85ad61559de8",
    "version_number": 1,
    "publish_message": "multiple article published"
  }
]
Array of object
object
article_id
string Required

The ID of the article

Min length1
user_id
string Required

The ID of the team account that will be marked as the contributor of this publish

Min length1
version_number
integer (int32) Required

The version number of the article to be published

Max length32767
Min length1
publish_message
string

The publish message of the article

Publish Article Request Example

Publishing an article with ArticleId, langCode, user_id, version_number, and publish_message.

[
  {
    "article_id": "8bcd4bf9-eb93-40d9-a8df-c3b518660ceb",
    "user_id": "f11efc6f-e968-4e95-82eb-85ad61559de8",
    "version_number": 1,
    "publish_message": "multiple article published"
  },
  {
    "article_id": "2ce2607f-6cfa-4bc9-9e47-1dc3843198629",
    "user_id": "f11efc6f-e968-4e95-82eb-85ad61559de8",
    "version_number": 1,
    "publish_message": "multiple article published"
  }
]
Array of object
object
article_id
string Required

The ID of the article

Min length1
user_id
string Required

The ID of the team account that will be marked as the contributor of this publish

Min length1
version_number
integer (int32) Required

The version number of the article to be published

Max length32767
Min length1
publish_message
string

The publish message of the article

Responses
200

Success

Publish Article Request Example

Publishing an article with ArticleId, langCode, user_id, version_number, and publish_message.

{
  "data": [
    {
      "article_id": "8bcd4bf9-eb93-40d9-a8df-c3b518660ceb",
      "success": true,
      "details": "Successfully published article with an id 8bcd4bf9-eb93-40d9-a8df-c3b518660ceb"
    },
    {
      "article_id": "99575fe3-f7b0-4e0a-bc46-38aed8c621f9",
      "success": true,
      "details": "Successfully published article with an id 99575fe3-f7b0-4e0a-bc46-38aed8c621f9"
    }
  ],
  "extension_data": null,
  "success": true,
  "errors": [],
  "warnings": [],
  "information": []
}
Expand All
object
data
object (ArticleSimpleDataCustomer)
id
string

The ID of the article

title
string

The article title

public_version
integer (int32)

The article version number(revision) that is currently published

latest_version
integer (int32)

The latest version number of this article

language_code
string

Language code of the article

hidden
boolean

Indicates if the article is visible on the site

status
integer (int32)

The status of the category page: 0 - Draft, 1 - In review, 2 - Public, 3 - Published, 4 - Deleted, 5 - Forked

Valid values[0,1,2,3,4,5]
order
integer (int32)

The position of the article inside the parent category

slug
string

The slug of the article

content_type
integer (int32)

0 - Markdown content; 1 - HTML content; 2 - Block Content

Valid values[0,1,2]
extension_data
object (ExtensionDataObject)
success
boolean

Status indication for customer API response

errors
Array of object (BaseError)

Errors in the customer API response

object
extension_data
object (ExtensionDataObject)
stack_trace
string

Stack trace for error response message

description
string

Description for error cause

error_code
string

Error code for Api resonse

custom_data
object
warnings
Array of object (BaseWarning)

Warning in the customer API response

object
extension_data
object (ExtensionDataObject)
description
string

Warning description

warning_code
string

warning code for customer Api base response

information
Array of object (BaseInformation)

Information passed by the customer API response

object
extension_data
object (ExtensionDataObject)
description
string

status description for customer Api response information

400

Bad Request

already published article

This article has been already published.

{
  "data": [
    {
      "article_id": "8bcd4bf9-eb93-40d9-a8df-c3b518660ceb",
      "success": false,
      "details": "Failed to publish article with an id 99575fe3-f7b0-4e0a-bc46-38aed8c621f9\r\nError: Article has already been published."
    }
  ],
  "extension_data": null,
  "success": true,
  "errors": [],
  "warnings": [],
  "information": []
}
user_id not found

Kindly verfy the user_id is not null or empty, and perform the task again.

{
  "data": [
    {
      "article_id": "99575fe3-f7b0-4e0a-bc46-38aed8c621f9",
      "success": false,
      "details": "Failed to publish article with an id 99575fe3-f7b0-4e0a-bc46-38aed8c621f9\r\nError: The user with id 'f11efc6f-e968-4e95-82eb-85ad61559de81' does not exist in your project."
    }
  ],
  "extension_data": null,
  "success": true,
  "errors": [],
  "warnings": [],
  "information": []
}
article_id not found

Invalid article_id or null reference, verify the article Id and perform the task again.

{
  "data": null,
  "extension_data": null,
  "success": false,
  "errors": [
    {
      "extension_data": null,
      "stack_trace": null,
      "description": "The ArticleId field is required.",
      "error_code": "400",
      "custom_data": null
    }
  ],
  "warnings": [],
  "information": []
}
version_number not found

Invalid datatype for version_number, Kindly use integer value perform the task again.

{
  "data": null,
  "extension_data": null,
  "success": false,
  "errors": [
    {
      "extension_data": null,
      "stack_trace": null,
      "description": "The field VersionNumber must be between 1 and 32767.",
      "error_code": "400",
      "custom_data": null
    }
  ],
  "warnings": [],
  "information": []
}
Expand All
object
data
object (ArticleSimpleDataCustomer)
id
string

The ID of the article

title
string

The article title

public_version
integer (int32)

The article version number(revision) that is currently published

latest_version
integer (int32)

The latest version number of this article

language_code
string

Language code of the article

hidden
boolean

Indicates if the article is visible on the site

status
integer (int32)

The status of the category page: 0 - Draft, 1 - In review, 2 - Public, 3 - Published, 4 - Deleted, 5 - Forked

Valid values[0,1,2,3,4,5]
order
integer (int32)

The position of the article inside the parent category

slug
string

The slug of the article

content_type
integer (int32)

0 - Markdown content; 1 - HTML content; 2 - Block Content

Valid values[0,1,2]
extension_data
object (ExtensionDataObject)
success
boolean

Status indication for customer API response

errors
Array of object (BaseError)

Errors in the customer API response

object
extension_data
object (ExtensionDataObject)
stack_trace
string

Stack trace for error response message

description
string

Description for error cause

error_code
string

Error code for Api resonse

custom_data
object
warnings
Array of object (BaseWarning)

Warning in the customer API response

object
extension_data
object (ExtensionDataObject)
description
string

Warning description

warning_code
string

warning code for customer Api base response

information
Array of object (BaseInformation)

Information passed by the customer API response

object
extension_data
object (ExtensionDataObject)
description
string

status description for customer Api response information


Was this article helpful?