Get all articles details
Return information about all your articles.
GET
/api/articles/
curl -X GET "https://<your_app_subdomain>.user.com/api/articles/"
Response
{
"count": 3,
"next": null,
"page_links": [
[
"http://dev.user.localhost/api/articles/",
1,
true,
false
]
],
"previous": null,
"results": [
{
"author": {
"avatar": "http://dev.user.localhost/static/img/agent.svg",
"id": 1,
"name": "developer developer"
},
"categories": [],
"content": "test
",
"created_at": "2020-12-04T15:04:09.951199Z",
"id": 3,
"intro_text": "test",
"language": "en",
"rating": null,
"slug": "test-2",
"tags": [],
"title": "Test",
"translations": [
{
"id": 3,
"is_default": true,
"label": "English",
"language": "en",
"status": 0
}
],
"updated_at": "2020-12-04T15:04:09.997904Z",
"url": "/knowledge-base/test-2/",
"views": 0
},
{
"author": {
"avatar": "http://dev.user.localhost/static/img/agent.svg",
"id": 1,
"name": "developer developer"
},
"categories": [],
"content": "test
",
"created_at": "2020-12-04T13:42:35.803250Z",
"id": 2,
"intro_text": "test",
"language": "en",
"rating": "5.00",
"slug": "test-1",
"tags": [],
"title": "Test",
"translations": [
{
"id": 2,
"is_default": true,
"label": "English",
"language": "en",
"status": 0
}
],
"updated_at": "2020-12-04T13:42:35.827713Z",
"url": "/knowledge-base/test-1/",
"views": 1
},
{
"author": {
"avatar": "http://dev.user.localhost/static/img/agent.svg",
"id": 1,
"name": "developer developer"
},
"categories": [],
"content": "test
",
"created_at": "2020-12-04T13:41:46.540889Z",
"id": 1,
"intro_text": "test",
"language": "en",
"rating": "4.00",
"slug": "test",
"tags": [],
"title": "Test",
"translations": [
{
"id": 1,
"is_default": true,
"label": "English",
"language": "en",
"status": 0
}
],
"updated_at": "2020-12-04T13:41:46.620162Z",
"url": "/knowledge-base/test/",
"views": 1
}
]
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://<your_app_subdomain>.user.com/api/articles/",
"method": "GET"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://<your_app_subdomain>.user.com/api/articles/");
xhr.send(data);
var request = require("request");
var options = { method: 'GET',
url: 'https://<your_app_subdomain>.user.com/api/articles/' };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/articles/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => ""
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "https://<your_app_subdomain>.user.com/api/articles/"
payload = ""
response = requests.request("GET", url, data=payload)
print(response.text)
import http.client
conn = http.client.HTTPSConnection("<your_app_subdomain>.user.com")
payload = ""
conn.request("GET", "/api/articles/", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))