Skip to main content

Fetch User Availability

This event allows you to fetch the availability of a given user using their userId. This event provides the current availability status of the user.

{
"type": "API.FETCH_USER_AVAILABILITY",
"payload": {
"variables": {
"userId": "Number!"
}
}
}

Usage

{
"type": "API.FETCH_USER_AVAILABILITY",
"payload": {
"variables": {
"userId": 123
}
}
}

Successful fetch

When the request is successful, you will receive a API.FETCH_USER_AVAILABILITY_FULFILLED event that provides information about the user's availability status.

{
"type": "API.FETCH_USER_AVAILABILITY_FULFILLED",
"payload": {
"userId": "Number",
"status": "UserAvailabilityStatus!",
"wrapUpTimeConfig": "Number",
"wrapUpTimeTtl": "Number",
"version": "Number"
}
}

Something went wrong

If something bad happens, you will receive a API.FETCH_USER_AVAILABILITY_REJECTED event:

{
"type": "API.FETCH_USER_AVAILABILITY_REJECTED",
"payload": {
"error": "Error"
}
}

The error here, will correspond to whatever the backend service returns.

Reference

  • userId: the id of the user you want to fetch the availability for
  • status: the availability status of the API. It can be one of the following:
    • offline: the user is offline
    • do_not_disturb: the user is unavailable with no specific reason
      • The user can specify a reason for this status in the Aircall app, which can be either out_for_lunch, on_a_break, in_traning, doing_back_office, other.
    • available: the user is available to receive calls
    • on_mobile: the user is logged in to the mobile app
    • in_call: the user is in a call
  • version: the version of the availability. This is used to know if the availability has changed since the last time you fetched it.
  • wrapUpTimeConfig: the time that the user configures to become unavailable after each call.
  • wrapUpTimeTtl: represents how much time is left for the wrap-up time to expire

Both wrapUpTimeConfig and wrapUpTimeTtl keys will only be present if the agent has configured wrap-up time.