Education

CRUD endpoints for a user's education

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

Get All Education

GET /v2/organization/:corporation/staff/:username/education

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Url

Name
Type
Description

corporation

number

Corporation ID

username

string

Unique username

Response

 {
  data: [
    {
      id: 1,
      institution: "Instituion Name",
      degree: 'Degree Name',
      description: 'Description',
      major: 'Major',
      date: 2000
    },
  ],
  success: true
}

Code

const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education', {
    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 education = data;
        console.log('all education', education)
    }

})
.catch(error => console.error(error));

Get Individual Education

GET /v2/organization/:corporation/staff/:username/education/:id

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Url

Name
Type
Description

corporation

number

Corporation ID

username

string

Unique username

id

number

Education ID

Response

 {
  data: [
    {
      id: 1,
      institution: "Instituion Name",
      degree: 'Degree Name',
      description: 'Description',
      major: 'Major',
      date: 2000
    },
  ],
  success: true
}

Code

const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education/:id', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Bearer ${accessToken}`
    }
})
.then(response => response.json())
.then(json => {
    const { success, data, error } = json

    if (success) {
        console.log('education', data)
    }

})
.catch(error => console.error(error));

Create Education

POST /v2/organization/:corporation/staff/:username/education

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

institution*

string

Institution Name

degree*

string

Degree Name

major

string

Major

description

string

Description

date

string

Graduation date(i.e. '2004')

Response

{ 
    data: { 
        id: 1
    }, 
    success: true 
}

Code

const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('institution', 'University Name');
data.append('degree', 'BSc.');
data.append('major', 'Mathematics');
data.append('description', 'Some additional info. on my degree')
data.append('date', '2004')

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education', {
    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 education id', id)
    }

})
.catch(error => console.error(error));

Update Education

PUT /v2/organization/:corporation/staff/:username/education/:id

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Url

Name
Type
Description

corporation

number

Corporation ID

username

string

Unique username

id

number

Education ID

Body

Name
Type
Description

institution*

string

Institution Name

degree*

string

Degree Name

major

string

Major

description

string

Description

date

string

Graduation date(i.e. '2004')

Response

{ 
    data: { 
        id: 1, 
        updated: true 
    }, 
    success: true 
}

Code

const data = new URLSearchParams();
const accessToken = `<ACCESS TOKEN>`

data.append('institution', 'University Name');
data.append('degree', 'BSc.');
data.append('major', 'Mathematics');
data.append('description', 'Some additional info. on my degree')
data.append('date', '2004')

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education/: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 education id', id)
    }

})
.catch(error => console.error(error));

Delete Education

DELETE /v2/organization/:corporation/expert/:username/education/:id

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Url

Name
Type
Description

corporation

number

Corporation ID

username

string

Unique username

id

number

Education ID

Response

{ 
    data: { 
        deleted: true, 
        id: 1 
    }, 
    success: true 
}

Code

const accessToken = `<ACCESS TOKEN>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/staff/:username/education/: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 education id', id)
    }

})
.catch(error => console.error(error));

Last updated