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

Url

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

Url

Body

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