Staff Profiles
Get Individual Staff
GET
/v2/organization/:corporation/staff/:username
Headers
Content-Type
application/json
Authorization
Bearer <token>
Url
corporation
number
Corporation ID
username
string
Unique username
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));
Create Staff
POST
/v2/organization/:corporation/staff
Headers
Content-Type
application/json
Authorization
Bearer <token>
Url
corporation
number
Corporation ID
username
string
Unique username
Body
firstname*
string
First Name
lastname*
string
Last Name
job_title*
string
Job
email*
string
company*
string
Company
department
string
Department
phone_number
string
Phone #
phone_number_extension
string
Phone extension
location_city
string
City
location_postal
string
ZIP/Postal Code
location_address
string
Address
location_building
string
Building
location_room
string
Room #
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', '[email protected]');
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));
Update Staff
PUT
/v2/organization/:corporation/staff/:username
Headers
Content-Type
application/json
Authorization
Bearer <token>
Url
corporation
number
Corporation ID
username
string
Unique username
Body
firstname
string
First Name
lastname
string
Last Name
job_title
string
Job
string
company
string
Company
department
string
Department
phone_number
string
Phone #
phone_number_extension
string
Phone extension
location_city
string
City
location_postal
string
ZIP/Postal Code
location_address
string
Address
location_building
string
Building
location_room
string
Room #
is_published
number
Published(1 or 0)
is_private
number
Private(1 or 0)
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', '[email protected]');
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));
Delete Staff
DELETE
/v2/organization/:corporation/staff/:username
Headers
Content-Type
application/json
Authorization
Bearer <token>
Url
corporation
number
Corporation ID
username
string
Unique username
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));
Last updated
Was this helpful?