Topics
CRUD endpoints for a user's topics
Get All Topics
GET /v2/organization/:corporation/expert/:username/topic
Headers
Content-Type
application/json
Authorization
Bearer <token>
Url
corporation
number
Corporation ID
username
string
Unique username
Response
 {
  data: [
    {
      id: 1,
      name: "topic name"
    }
  ],
  success: true
}Code
const accessToken = `<ACCESS TOKEN>`
fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic', {
    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 topic = data
        console.log('topic', topic)
    }
})
.catch(error => console.error(error));$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic';
$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/topic \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"Get Individual Topic
GET /v2/organization/:corporation/expert/:username/topic/:id
Headers
Content-Type
application/json
Authorization
Bearer <token>
Url
corporation
number
Corporation ID
username
string
Unique username
id
number
Topic ID
Response
{
  data: [
    {
      id: 1,
      name: "topic name"
    }
  ],
  success: true
}Code
const accessToken = `<ACCESS CODE>`
fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic/: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 topic = data
        console.log('topic', topic[0])
    }
})
.catch(error => console.error(error));$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/industry/: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/industry/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"     Create Topic
POST /v2/organization/:corporation/expert/:username/topic
Headers
Content-Type
application/json
Authorization
Bearer <token>
Url
corporation
number
Corporation ID
username
string
Unique username
Body
name*
string
Topic Name
Response
{ 
    data: { 
        id: 1
    }, 
    success: true 
}Code
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`
data.append('name', 'AI');
fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic', {
    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 topic id', id)
    }
})
.catch(error => console.error(error));
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic';
$data = ['name' => 'AI'];
$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/topic \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>" \
    -d '{"name":"AI"}'Delete Topic
DELETE/v2/organization/:corporation/expert/:username/topic/:id
Headers
Content-Type
application/json
Authorization
Bearer <token>
Url
corporation
number
Corporation ID
username
string
Unique username
id
number
Topic 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/topic/: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 topic id', id)
    }
})
.catch(error => console.error(error));
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/topic/: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/topic/:id \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <ACCESS TOKEN>"Last updated
Was this helpful?
