Availability

Get or create/update the a user's availability

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

Get Availability

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

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Url

NameTypeDescription

corporation

number

Corporation ID

username

string

Unique username

Response

 {
  data: [
    {
      availability_keynote: 1,
      availability_moderator: 1,
      availability_panelist: 1,
      availability_workshop: 1,
      availability_host_mc: 1,
      availability_appearance: 1,
      availability_corptraining: 1
    }
  ],
  success: true
}

Code

const accessToken = `<ACCESS TOKEN>`

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

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

Update Availability

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

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Url

NameTypeDescription

corporation

number

Corporation ID

username

string

Unique username

Body

NameTypeDescription

availability_keynote

number

Available for Keynote

availability_moderator

number

Available for Moderator

availability_panelist

number

Available for Panelist

availability_workshop

number

Available for Workshop

availability_host_mc

number

Available for Host/MC

availability_appearance

number

Available for Author Appearance

availability_corptraining

number

Available for Corp Training

Response

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

Code

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

data.append('availability_keynote', 1)
data.append('availability_moderator', 1)
data.append('availability_panelist', 1)
data.append('availability_workshop', 1)
data.append('availability_host_mc', 1)
data.append('availability_appearance', 1)
data.append('availability_corptraining', 1)

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

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

Last updated