An article
in the knowledge base is composed of a title and an HTML content, and belongs to one or more categories.
For employees, the access to an article can be based on:
The organisation perimeter of the employee
Some filtering rules based on the custom attributes of the employee
For managers, the access to an article can be based on the role of the manager.
This method returns all articles based the query GET parameters.
GET /api/articles/?...
Accept: application/json
Content-Type: application/json
X-API-KEY: xxxxxxxxxxxxxxxxxxxxxxxxxxx
Search filters:
Parameter |
Description |
Type |
mandatory |
Exemple |
---|---|---|---|---|
category_code |
Identifying code (slug) of a category. If set, return only the articles included in this category. |
|
|
category_code: onboarding |
accessible_by |
Some articles may be accessible only to employees or managers. When set to |
|
|
accessible_by: employees |
employee_technical_id |
Return only the articles accessible to this specific employee. Note: |
|
|
employee_technical_id: XAQ678900 |
manager_technical_id |
Return only the articles accessible to this specific manager. Note: |
|
|
manager_technical_id: MAQ678900 |
featured |
If true, returns only “featured” articles (those articles are displayed on the employee home page), if false, return non “featured” articles. If empty or not in the query, all articles are returned. |
|
|
featured: true |
state |
Returns only the articles with this specific state. If empty or not in the query, all articles are returned. |
|
|
state: published |
query |
Full text search in the article title and the article content. |
|
|
query: Onboarding form |
Ordering and pagination:
Parameter |
Description |
Type |
mandatory |
Exemple |
---|---|---|---|---|
order_by |
Ordering rule. Specify an attribute of an article, with a possible unary negative to imply descending sort order. The attribute can be |
|
|
order_by: -created_at |
per_page |
Number of request per page (defaults to 20, max 100) |
|
|
per_page: 50 |
page |
Page number |
|
|
page: 2 |
The response is encoded in the JSON format with the following parameters, and is a list of article objects with the following attributes:
Parameter |
Description |
Type |
Exemple |
---|---|---|---|
slug |
The slug of the article, wich is the default unique identifier used in the URI for this article |
|
how-to-complete-the-onboarding-form |
title |
The title of the article |
|
How to complete the onboarding form ? |
body |
The HTML content of the article |
|
<div>…</div> |
categories |
The list of categories of this article |
|
[{…}, {…}] |
featured |
The featured state of the article |
|
false |
state |
The state of the article (can be |
|
published |
total_hits |
Total number of pageviews of this article on the employee portal (API hits are not counted…) |
|
1856 |
updated_at |
Last update of the article |
|
2012-01-01T12:00:00+00:00 |
created_at |
Creation date of the article |
|
2012-01-01T12:00:00+00:00 |
manager_url |
The URL of the |
|
|
employee_url |
The URL of the |
|
|
api_url |
The URI of the |
|
For instance:
HTTP 200 OK:
HTTP/1.1 200 OK
Link: <https://BASE_URL/manager/articles/?page=2&per_page=30>; rel="next",
<https://BASE_URL/manager/articles/?page=5&per_page=30>; rel="last"
[
{article_object_1},
...,
{article_object_2}
]
Where article_object_x is a json like this:
{
"slug": "how-to-complete-the-onboarding-form",
"title": "How to complete the onboarding form?",
"body": "<div>...</div>",
"categories": [
{
"slug": "onboarding",
"name": "OnBoarding Section!",
"language_code": "en",
"description": "..."
},
{
"slug": "accueil",
"name": "Accueil dans l'entreprise !",
"language_code": "fr",
"description": "..."
},
],
"featured": false,
"state": "published",
"total_hits": 5678,
"updated_at": "2012-01-01T12:00:00+00:00",
"created_at": "2012-01-01T12:00:00+00:00",
"api_url": "https://API_DOMAIN/api/articles/:slug/",
"manager_url": "https://CLIENT-SUBDOMAIN/manager/articles/:slug/",
"employee_url": "https://CLIENT-SUBDOMAIN/employee/articles/:slug/"
}
curl -v -X GET "https://peopleask.net/api/articles/?category_code=onboarding&employee_technical_id=56789G79" \
-H "Content-type: application/json" \
-H "Accept: application/json" \
-H "X-API-KEY: XXXXXXXXXXXXXX"