Sample Talks

CRUD endpoints for a user's sample talks

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

Get All Sample Talks

GET /v2/organization/:corporation/expert/:username/sampletalk

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,
      title: "talk title",
      description: "talk description"
    }
  ],
  success: true
}

Code

const accessToken = `<ACCESS TOKEN>`

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

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

Get Individual Sample Talk

GET /v2/organization/:corporation/expert/:username/link/: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

Sample Talk ID

Response

{
  data: [
    {
      id: 1,
      title: "talk title",
      description: "talk description"
    }
  ],
  success: true
}

Code

const accessToken = `<ACCESS CODE>`

fetch('https://public-api.expertfile.com/v2/organization/:corporation/expert/:username/sampletalk/: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('talk', data)
    }

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

Create Sample Talk

POST /v2/organization/:corporation/expert/:username/sampletalk

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

title*

string

Sample Talk Title

description*

string

Sample Talk Description

Response

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

Code

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

data.append('title', 'My Talk Idea');
data.append('description', 'My talk is going to be about...');

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

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

Update Sample Talk

PUT /v2/organization/:corporation/expert/:username/sampletalk/: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

Sample Talk ID

Body

Name
Type
Description

title*

string

Sample Talk Title

description*

string

Sample Talk Description

Response

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

Code

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

data.append('title', 'My Talk Idea');
data.append('description', 'My talk is going to be about...');

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

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

Delete Sample Talk

DELETE /v2/organization/:corporation/expert/:username/sampletalk/: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

Sample Talk 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/sampletalk/: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 talk id', id)
    }

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

Last updated