Creating and publishing articles is a common task in Document360. Using the API, you can automate this process to improve efficiency and scalability.
Prerequisites for creating an article
Before creating an article, complete the following authorization steps in Postman.
Authorization
To authorize requests in Postman, make sure your API token is added and the appropriate Base URL is set.
Click Document360 Customer API in the category tree.
In the Postman Workbench, go to the Variables tab.
In the Variables tab, check the Initial and Current values of the
baseUrl
variable.This value should already be set to
https://apihub.document360.io
. If not, update both fields accordingly.Add a new variable for your API token. For example, name it
api_token
.Paste your API token from Document360 into both the Initial value and Current value fields.
Go to the Authorization tab and enter the variable you created in the Value field.
For example, enter
{{api_token}}
if your variable is namedapi_token
.
Once you've completed these steps, you're ready to start using Document360 APIs in Postman.
Creating an article using Document360’s API
To create an article, you need the following values:
Project version ID
Category ID
User ID
Get project version ID
To create an article using the API, you must associate it with the correct version of your documentation project. This step helps you retrieve that version ID.
In Postman, under Document360 Customer API, expand v2 > Project Versions.
Click Gets list of project versions, then click Send.
In the response body (as shown in the screenshot), locate the
id
of the version you want to use.NOTE
If you're unsure which one to choose, look for the version marked with
"is_main_version": true
.Copy the corresponding
id
value and save it for later use.
NOTE
In Document360, the order of categories and articles is based on the paths defined in the API specification files rather than tags. The first tag in the path determines the first category, with all endpoints mapped to that tag grouped accordingly.
Get category ID
To create an article, you need the ID of the category where the article should be added. Follow these steps to retrieve it using Postman:
Under Project Versions, expand the relevant {projectVersionId}, then go to categories > Gets list of categories within project version.
Click Gets list of categories within project version, then switch to the Params tab.
In the Path Variables section, enter the project version ID you copied in step 4 of the previous section.
In the Query Params section, provide the following values:
excludeArticles
→true
langCode
→en
includeCategoryDescription
→false
Click Send.
In the response body, locate the
id
value of the category you want to use.Copy the
id
and save it for later use.
PRO TIP
If you're not sure which category to use, look for the
"name"
field in the response to identify familiar category names (e.g.,"Getting started"
).
Get user ID
To create an article using the API, you must also provide the user ID of the team member creating the article.
In Postman, under v2, expand Teams, then click Get all team accounts.
Click Send to retrieve the list of all team members in the project.
In the response body, locate the desired user and copy the
id
value.
PRO TIP
If you're not sure which user to pick, look at fields like
"email_id"
,"portal_role"
, or"last_name"
to identify the appropriate account.
Creating an article
Once you have the required values (category ID, project version ID, user ID), follow these steps to create a new article using the API.
Under v2, expand Articles, and click Adds an article to an existing category.
In the main panel, switch to the Body tab.
Enter the following parameters in the request body:
category_id
: Paste the desired category ID.project_version_id
: Paste the project version ID.title
: Enter the article title.user_id
: Paste the user ID.content
: Add the article content.order
: Set the article’s position in the category.For example:
To place the article at the start, set
order
to0
.To make it the fifth item, set
order
to4
.
content_type
: Select the editor type for the article. The default value of the parameter isnull
.Set
content_type
to0
for Markdown editor.Set
content_type
to1
for WYSIWYG editor.Set
content_type
to2
for Advanced WYSIWYG editor.
Click Send.
If the article is created successfully, the API returns a
200 OK
status and"success": true
.Copy the
id
value from the response body and save it. This is the unique ID of the newly created article.
Publishing an article
To publish an article using the API, you need the following values:
article_id
: The ID of the article to publish.user_id
: The ID of the user performing the action.
Follow these steps to publish an article:
Under v2, expand Articles > {articleId} > publish, and click Publishes an article with an id.
In the Params tab, locate the Path variables section.
In the
Value
field ofarticleId
, paste the article ID you want to publish.
Navigate to the Body tab in the main window.
Add the following parameters in the request body:
user_id
: Paste the user ID.version_number
: Specify the version number to publish.publish_message
: Enter a short message describing the purpose or context of the publish action.
Click Send.
If the article is published successfully, the API returns a
200 OK
status and"success": true
.