ExpertFile Documentation
  • 👋Welcome!
  • Reference
    • API Reference
      • Authentication
      • Experts
        • Expert Directory/Search
        • Expert Profile
          • Accomplishments
          • Affiliations
          • Article
          • Availability
          • Biography
          • Categories
          • Course
          • Education
          • Event Appearances
          • Fees
          • Industries
          • Languages
          • Links
          • Media Appearances
          • Partnerships
          • Patents
          • Research Focus
          • Research Grants
          • Sample Talks
          • Social
          • Tagline
          • Tags
          • Testimonials
          • Topics
          • SEO/Meta Data
      • Staff
        • Staff Directories/Search
        • Staff Profiles
          • Biography
          • Categories
          • Education
          • Languages
          • Links
          • Tagline
          • Tags
      • Inquiries
        • Admission
        • Business
        • Donor
        • Event
        • Expert Witness
        • General
        • Media
        • Meeting
        • Partnership
        • Research
      • Posts (Spotlights)
        • Post Listings/Search
        • Full Post
      • Q&A (Answers)
        • Q&A Listings/Search
        • Individual Q&A
    • Embeds
      • Expert Directory/Search
      • Expert & Staff Profiles
        • Adding Profile Meta Data
      • Featured Experts
      • Inquiries
      • Post Listings/Search
      • Full Post
        • Adding Post Meta Data
      • Q&A Listings/Search
      • Individual Q&A
        • Adding Q&A Meta Data
      • Adding Meta Data to Embeds
    • WordPress
      • Expert Directory/Search
      • Expert & Staff Profiles
      • Featured Experts
      • Inquiries
      • Q&A Listings/Search
      • Individual Q&A
      • Post Listings/Search
      • Full Post
    • Tracking Code (Analytics)
    • Adding Meta Data for SEO
    • Helpers
Powered by GitBook
On this page
  • Get Individual Staff
  • Create Staff
  • Update Staff
  • Delete Staff

Was this helpful?

  1. Reference
  2. API Reference
  3. Staff

Staff Profiles

PreviousStaff Directories/SearchNextBiography

Last updated 1 year ago

Was this helpful?

Please note that in all urls & code samples you'll need to replace:username and :corporation with appropriate values

Get Individual Staff

GET

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Url

Name
Type
Description

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));
$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

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Url

Name
Type
Description

corporation

number

Corporation ID

username

string

Unique username

Body

Name
Type
Description

firstname*

string

First Name

lastname*

string

Last Name

job_title*

string

Job

email*

string

Email

company*

string

Company

department

string

Department

phone_number

string

Phone #

phone_number_extension

string

Phone extension

location_city

string

City

location_state

string

location_country

string

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', '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

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Url

Name
Type
Description

corporation

number

Corporation ID

username

string

Unique username

Body

Name
Type
Description

firstname

string

First Name

lastname

string

Last Name

job_title

string

Job

email

string

Email

company

string

Company

department

string

Department

phone_number

string

Phone #

phone_number_extension

string

Phone extension

location_city

string

City

location_state

string

location_country

string

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', '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

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Url

Name
Type
Description

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));
$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>"

POST

State/Province See full list

Country See full list

PUT

State/Province See full list

Country See full list

DELETE

/v2/organization/:corporation/staff/:username
/v2/organization/:corporation/staff
/v2/organization/:corporation/staff/:username
/v2/organization/:corporation/staff/:username
here
here
here
here