Staff Profiles
Please note that in all urls & code samples you'll need to replace:username
and :corporation
with appropriate values
Get Individual Staff
GET
/v2/organization/:corporation/staff/:username
Headers
Url
Response
{
data: {
avatar: [],
account: [],
biography: [],
category: [],
corporationprofile: [],
education: [],
language: [],
link: [],
profiletype: [],
tag: [],
tagline: []
},
success: true
}
Code
const accessToken = `<ACCESS TOKEN>`
fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username', {
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 profile = data;
console.log('profile', profile)
}
})
.catch(error => console.error(error));
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/expert/:username';
$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
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS TOKEN>"
Create Staff
POST
/v2/organization/:corporation/staff
Headers
Url
Body
Response
{
data: {
username: '<USERNAME>',
inserted: true
},
success: true
}
Code
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`
data.append('firstname', 'Testfirstname');
data.append('lastname', 'Testlastname');
data.append('job_title', 'Job title');
data.append('email', 'testfromstaffapi@testing.com');
data.append('company', 'Testcompany');
data.append('department', 'Testdepartment');
data.append('phone_number', 'Testphone');
data.append('phone_number_extension', 'Testext');
data.append('location_city', 'Testcity');
data.append('location_state', 'ON');
data.append('location_country', 'CA');
data.append('location_postal', 'Testpostal');
data.append('location_address', 'Testaddress');
data.append('location_building', 'Testbuilding');
data.append('location_room', 'Testroom');
fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff', {
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 { username } = data
console.log('New username', username)
}
})
.catch(error => console.error(error));
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff';
$data = [
'firstname' => 'Testfirstname',
'lastname' => 'Testlastname',
'job_title' => 'Job title',
'email' => 'testfromapi@testing.com',
'company' => 'Testcompany',
'department' => 'Testdepartment',
'phone_number' => 'Testphone',
'phone_number_extension' => 'Testext',
'location_city' => 'Testcity',
'location_state' => 'ON',
'location_country' => 'CA',
'location_postal' => 'Testpostal',
'location_address' => 'Testaddress',
'location_building' => 'Testbuilding',
'location_room' => 'Testroom'
];
$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/staff \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS TOKEN>" \
-d '{"firstname": "Testfirstname","lastname": "Testlastname","job_title": "Job title","email": "testfromapi@testing.com","company": "Testcompany","department": "Testdepartment","phone_number": "Testphone","phone_number_extension": "Testext","location_city": "Testcity","location_state": "ON","location_country": "CA","location_postal": "Testpostal","location_address": "Testaddress","location_building": "Testbuilding", "location_room": "Testroom"}'
Update Staff
PUT
/v2/organization/:corporation/staff/:username
Headers
Url
Body
Response
{
data: {
username: '<USERNAME>',
updated: true
},
success: true
}
Code
const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`
data.append('firstname', 'Testfirstname');
data.append('lastname', 'Testlastname');
data.append('job_title', 'Job title');
data.append('email', 'testfromapi@testing.com');
data.append('company', 'Testcompany');
data.append('department', 'Testdepartment');
data.append('phone_number', 'Testphone');
data.append('phone_number_extension', 'Testext');
data.append('location_city', 'Testcity');
data.append('location_state', 'ON');
data.append('location_country', 'CA');
data.append('location_postal', 'Testpostal');
data.append('location_address', 'Testaddress');
data.append('location_building', 'Testbuilding');
data.append('location_room', 'Testroom');
data.append('is_published', '1');
data.append('is_private', '0');
fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username', {
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 { username } = data
console.log('Updated username', username)
}
})
.catch(error => console.error(error));
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username';
$data = [
'firstname' => 'Testfirstname',
'lastname' => 'Testlastname',
'job_title' => 'Job title',
'email' => 'testfromapi@testing.com',
'company' => 'Testcompany',
'department' => 'Testdepartment',
'phone_number' => 'Testphone',
'phone_number_extension' => 'Testext',
'location_city' => 'Testcity',
'location_state' => 'ON',
'location_country' => 'CA',
'location_postal' => 'Testpostal',
'location_address' => 'Testaddress',
'location_building' => 'Testbuilding',
'location_room' => 'Testroom',
'is_published' => '1',
'is_private' => '0'
];
$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/staff/:username \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS TOKEN>" \
-d '{"firstname": "Testfirstname","lastname": "Testlastname","job_title": "Job title","email": "testfromapi@testing.com","company": "Testcompany","department": "Testdepartment","phone_number": "Testphone","phone_number_extension": "Testext","location_city": "Testcity","location_state": "ON","location_country": "CA","location_postal": "Testpostal","location_address": "Testaddress","location_building": "Testbuilding", "location_room": "Testroom", "is_published": "1" "is_private": "0"}'
Delete Staff
DELETE
/v2/organization/:corporation/staff/:username
Headers
Url
Response
{
data: {
deleted: true,
username: '<USERNAME>',
},
success: true
}
Code
const accessToken = `<ACCESS TOKEN>`
fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username', {
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 { username } = data
console.log('Deleted username', username)
}
})
.catch(error => console.error(error));
$accessToken = urlencode('<ACCESS TOKEN>');
$url = 'https://public-api.expertfile.com/v2/organization/:corporation/staff/:username';
$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/staff/:username \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS TOKEN>"
Last updated