Article
CRUD endpoints for a user's articles
Get All Articles
GET /v2/organization/:corporation/expert/:username/article
Headers
Content-Type
application/json
Authorization
Bearer <token>
Url
corporation
number
Corporation ID
username
string
Unique username
Response
{
data: [
{
id: 1,
title: 'Article Title',
publisher: '',
details: '',
date: 0,
url: 'https://myurl.com',
authors: ''
},
],
success: true
}Code
const accessToken = `<ACCESS TOKEN>`
fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article', {
method: 'GET',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': `Bearer ${accessToken}`
}
})
.then(response => response.json())
.then(json => {
const { success, data } = json
if (success) {
const articles = data;
console.log('all articles', articles)
}
})
.catch(error => console.error(error));$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article';
$ch = curl_init($url);
curl_setopt(
$ch,
CURLOPT_HTTPHEADER,
array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$json = json_decode($response);
if($json->success){
var_dump($json->data);
}
curl_close($ch);
curl https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS TOKEN>"Get Individual Article
GET /v2/organization/:corporation/expert/:username/article/:id
Headers
Content-Type
application/json
Authorization
Bearer <token>
Url
corporation
number
Corporation ID
username
string
Unique username
id
number
Article ID
Response
{
data: [
{
id: 1,
title: 'Article Title',
publisher: '',
details: '',
date: 0,
url: 'https://myurl.com',
authors: ''
},
],
success: true
}Code
const accessToken = `<ACCESS TOKEN>`
fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id', {
method: 'GET',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': `Bearer ${accessToken}`
}
})
.then(response => response.json())
.then(json => {
const { success, data } = json
if (success) {
const article = data;
console.log('article', article)
}
})
.catch(error => console.error(error));$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id';
$ch = curl_init($url);
curl_setopt(
$ch,
CURLOPT_HTTPHEADER,
array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$json = json_decode($response);
if($json->success){
var_dump($json->data);
}
curl_close($ch);curl -X GET https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS TOKEN>" Create Article
POST /v2/organization/:corporation/expert/:username/article
Headers
Content-Type
application/json
Authorization
Bearer <token>
Url
corporation
number
Corporation ID
username
string
Unique username
Body
title*
string
Article Title
details*
string
Article Details
url
string
Article Url
publisher*
string
Article Publisher
authors
string
Article Authors
Response
{
data: {
id: 1
},
success: true
}Code
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`
data.append('title', 'Article title');
data.append('details', 'Article details...');
data.append('url', 'https://myurl.com');
data.append('publisher', 'Article publishers...');
data.append('authors', 'Article authors');
fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': `Bearer ${accessToken}`
},
body: data
})
.then(response => response.json())
.then(json => {
const { success, data, error } = json
if (success) {
const { id } = data
console.log('New article id', id)
}
})
.catch(error => console.error(error));$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article';
$data = ['title' => 'Article title', 'details' => 'Article details...', 'url' => 'https://myurl.com', 'publisher' => 'Article publishers...', 'authors' => 'Article authors'];
$ch = curl_init($url);
curl_setopt(
$ch,
CURLOPT_HTTPHEADER,
array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$response = curl_exec($ch);
$json = json_decode($response);
if($json->success){
var_dump($json->data);
}
curl_close($ch)curl -X POST https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS TOKEN>" \
-d '{"title": "Article title", "Article": "Article details...", "url": "https://myurl.com", "publisher": "Article publishers...", "authors": "Article authors"}'Update Article
PUT /v2/organization/:corporation/expert/:username/article/:id
Headers
Content-Type
application/json
Authorization
Bearer <token>
Url
corporation
number
Corporation ID
username
string
Unique username
id
number
Article ID
Body
title*
string
Article Title
details*
string
Article Details
url
string
Article Url
publisher*
string
Article Publisher
authors
string
Article Authors
Response
{
data: {
id: 1,
updated: true
},
success: true
}Code
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`
data.append('title', 'Article title');
data.append('details', 'Article details...');
data.append('url', 'https://myurl.com');
data.append('publisher', 'Article publishers...');
data.append('authors', 'Article authors');
fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id', {
method: 'PUT',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': `Bearer ${accessToken}`
},
body: data
})
.then(response => response.json())
.then(json => {
const { success, data, error } = json
if (success) {
const { id } = data
console.log('New article id', id)
}
})
.catch(error => console.error(error));
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id';
$data = ['title' => 'Article title', 'details' => 'Article details...', 'url' => 'https://myurl.com', 'publisher' => 'Article publishers...', 'authors' => 'Article authors'];
$ch = curl_init($url);
curl_setopt(
$ch,
CURLOPT_HTTPHEADER,
array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, http_build_query($data));
$response = curl_exec($ch);
$json = json_decode($response);
if($json->success){
var_dump($json->data);
}
curl_close($ch)curl -X PUT https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS TOKEN>" \
-d '{"title": "Article title", "Article": "Course details...", "url": "https://myurl.com", "publisher": "Article publishers...", "authors": "Article authors"}'Delete Article
DELETE /v2/organization/:corporation/expert/:username/article/:id
Headers
Content-Type
application/json
Authorization
Bearer <token>
Url
corporation
number
Corporation ID
username
string
Unique username
id
number
Article ID
Response
{
data: {
deleted: true,
id: 1
},
success: true
}Code
const accessToken = `<ACCESS TOKEN>`
fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/article/:id', {
method: 'DELETE',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': `Bearer ${accessToken}`
}
})
.then(response => response.json())
.then(json => {
const { success, data, error } = json
if (success) {
const { id } = data
console.log('Deleted article id', id)
}
})
.catch(error => console.error(error));
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/:id';
$ch = curl_init($url);
curl_setopt(
$ch,
CURLOPT_HTTPHEADER,
array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $accessToken)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
$response = curl_exec($ch);
$json = json_decode($response);
if($json->success){
var_dump($json->data);
}
curl_close($ch);curl -X DELETE https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/course/:id \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS TOKEN>"Last updated
Was this helpful?