-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference: Availability
Wilson Lau edited this page Apr 10, 2021
·
15 revisions
A user can mark certain time slots (denoted as UTC-standardized ISO strings on the hour, ie. 2021-04-10T05:00:00Z
) as available. If they do so, other users will be able to find matches and invite them to a mock interview. This resource is unique on userId + startTime.
interface Availability {
id: uuid;
userId: uuid;
startTime: string; // ISO DateTime String in UTC
isAvailable: boolean;
}
This represents a more detailed interface to be used when other users are querying availability, and includes details of the other user.
interface AvailabilityWithUser extends Availability {
user: InterviewUser;
}
Gets all availabilities for the authenticated user from startTime to endTime inclusive
- This is authenticated, so no userId is specified in the request
- Defaults to next 7 days if both query params are not specified
- We return Availability instead of InterviewAvailability because this is for the calendar
interface GetAvailabilityResponse {
availabilities: Availability[];
}
Set availabilities for a user in a batched request
- This is authenticated, so no userId is specified in the request
- We return Availability instead of InterviewAvailability because this is for the calendar
interface SetAvailabilityRequest {
availabilities: {
[key: string]: boolean; // ISO DateTime String in UTC
}
}
- Identical to GetAvailabilityResponse
interface SetAvailabilityResponse {
availabilities: Availability[];
}
Search for availabilities from other users given a certain timeslot (denoted as an ISO DateTime String in UTC)
- This is an authenticated request. Response should filter out availability of currentUser.
- Ideally, this response returns availabilities in 'best match' order.
- This also only returns items with
isAvailable: true
interface SearchAvailabilityRequest {
startTime: string // ISO DateTime String in UTC
}
interface SearchAvailabilityResponse {
availabilities: AvailabilityWithUser[];
}