Skip to content

Create an article

Articles

A moderator can create an article in a category, providing the title and content. An article is always created as a draft (which later can be published) and open (authors can reply to it). Moderators can optionally add public labels to provide more context about the type of article. It can also optionally have a featured image with a valid url. The allowed image extensions for featured image are png, jpeg, jpg, gif. Moderators can optionally create an article with a poll. A poll consists of a title and options. Existing authors can vote on the poll attached to an article. Authors can like (& unlike!) an article and individual replies to the article. Moderators can optionally create an article as closed, which means that only moderators can reply to it. Moderators can also optionally create an article sticky, which highlights the article at the top of the category on the community.

POST
/articles/create

Parameters

Query Parameters

authorId*

The ID of the author of the article

Type
string
Required
moderatorId

The ID of the moderator who will create the article on behalf of the author (who in this case can be a registered user as well)

Type
string

Request Body

application/json
JSON
{
  
"title": "This is an interesting article",
  
"featuredImage": "https://example.com/some-optional-image.png",
  
"featuredImageAltText": "Alt text for the featured image",
  
"publicLabel": "New",
  
"content": "This will explain all you need to know about everything",
  
"categoryId": 31,
  
"poll": {
  
  
"title": "Which option sounds better?",
  
  
"options": [
  
  
  
[
  
  
  
  
"Option A",
  
  
  
  
"Option B",
  
  
  
  
"Other"
  
  
  
]
  
  
]
  
},
  
"tags": [
  
  
[
  
  
  
"question",
  
  
  
"urgent"
  
  
]
  
],
  
"sticky": false,
  
"closed": false,
  
"moderatorTags": [
  
  
[
  
  
  
"highlighted"
  
  
]
  
]
}

Responses

Article created

application/json
JSON
{
  
"id": "string",
  
"publicId": "string"
}

Samples

Gainsight CC Developer Portal