--- title: WorkforceManagementApi --- ## PureCloud::WorkforceManagementApi All URIs are relative to *https://api.mypurecloud.com* Method | Description ------------- | ------------- | ------------- [**get_adherence**](WorkforceManagementApi.html#get_adherence) | Get a list of UserScheduleAdherence records for the requested users [**get_managementunits**](WorkforceManagementApi.html#get_managementunits) | Get management units [**get_managementunits_mu_id_activitycodes**](WorkforceManagementApi.html#get_managementunits_mu_id_activitycodes) | Get activity codes corresponding to a management unit [**get_managementunits_mu_id_users**](WorkforceManagementApi.html#get_managementunits_mu_id_users) | Get agents in the management unit [**get_managementunits_mu_id_users_user_id_timeoffrequests**](WorkforceManagementApi.html#get_managementunits_mu_id_users_user_id_timeoffrequests) | Get a list of time off requests for any user [**get_managementunits_mu_id_users_user_id_timeoffrequests_timeoffrequest_id**](WorkforceManagementApi.html#get_managementunits_mu_id_users_user_id_timeoffrequests_timeoffrequest_id) | Get a time off request by id [**get_timeoffrequests**](WorkforceManagementApi.html#get_timeoffrequests) | Get a list of time off requests for the current user [**get_timeoffrequests_timeoffrequest_id**](WorkforceManagementApi.html#get_timeoffrequests_timeoffrequest_id) | Get a time off request for the current user by id [**patch_timeoffrequests_timeoffrequest_id**](WorkforceManagementApi.html#patch_timeoffrequests_timeoffrequest_id) | Mark a time off request for the current user as read or unread [**post_managementunits_mu_id_schedules_search**](WorkforceManagementApi.html#post_managementunits_mu_id_schedules_search) | Get user schedules within the given time range [**post_schedules**](WorkforceManagementApi.html#post_schedules) | Get a schedule for the current user {: class="table table-striped"} ## -[**Array<UserScheduleAdherence>**](UserScheduleAdherence.html) get_adherence(user_id) Get a list of UserScheduleAdherence records for the requested users Wraps GET /api/v2/workforcemanagement/adherence ### Example ~~~ruby # load the gem require 'purecloud' # setup authorization @secret = ENV['PURECLOUD_SECRET'] @id = ENV['PURECLOUD_CLIENT_ID'] environment = "mypurecloud.com" @authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment PureCloud.configure do |config| config.access_token = @authToken end api_instance = PureCloud::WorkforceManagementApi.new user_id = ["user_id_example"] # Array | User Id(s) for which to fetch current schedule adherence information. Min 1, Max of 100 userIds per request begin #Get a list of UserScheduleAdherence records for the requested users result = api_instance.get_adherence(user_id) p result rescue PureCloud::ApiError => e puts "Exception when calling WorkforceManagementApi->get_adherence: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_id** | [**Array<String>**](String.html)| User Id(s) for which to fetch current schedule adherence information. Min 1, Max of 100 userIds per request | {: class="table table-striped"} ### Return type [**Array<UserScheduleAdherence>**](UserScheduleAdherence.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -[**Array<ManagementUnit>**](ManagementUnit.html) get_managementunits(opts) Get management units Wraps GET /api/v2/workforcemanagement/managementunits ### Example ~~~ruby # load the gem require 'purecloud' # setup authorization @secret = ENV['PURECLOUD_SECRET'] @id = ENV['PURECLOUD_CLIENT_ID'] environment = "mypurecloud.com" @authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment PureCloud.configure do |config| config.access_token = @authToken end api_instance = PureCloud::WorkforceManagementApi.new opts = { selector: "selector_example", # String | Selector page_size: 25, # Integer | page_number: 1 # Integer | } begin #Get management units result = api_instance.get_managementunits(opts) p result rescue PureCloud::ApiError => e puts "Exception when calling WorkforceManagementApi->get_managementunits: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **selector** | **String**| Selector | [optional] **page_size** | **Integer**| | [optional] [default to 25] **page_number** | **Integer**| | [optional] [default to 1] {: class="table table-striped"} ### Return type [**Array<ManagementUnit>**](ManagementUnit.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -[**ActivityCodeContainer**](ActivityCodeContainer.html) get_managementunits_mu_id_activitycodes(mu_id) Get activity codes corresponding to a management unit Wraps GET /api/v2/workforcemanagement/managementunits/{muId}/activitycodes ### Example ~~~ruby # load the gem require 'purecloud' # setup authorization @secret = ENV['PURECLOUD_SECRET'] @id = ENV['PURECLOUD_CLIENT_ID'] environment = "mypurecloud.com" @authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment PureCloud.configure do |config| config.access_token = @authToken end api_instance = PureCloud::WorkforceManagementApi.new mu_id = "mu_id_example" # String | The muId of the management unit. begin #Get activity codes corresponding to a management unit result = api_instance.get_managementunits_mu_id_activitycodes(mu_id) p result rescue PureCloud::ApiError => e puts "Exception when calling WorkforceManagementApi->get_managementunits_mu_id_activitycodes: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **mu_id** | **String**| The muId of the management unit. | {: class="table table-striped"} ### Return type [**ActivityCodeContainer**](ActivityCodeContainer.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -[**WfmUserEntityListing**](WfmUserEntityListing.html) get_managementunits_mu_id_users(mu_id) Get agents in the management unit Wraps GET /api/v2/workforcemanagement/managementunits/{muId}/users ### Example ~~~ruby # load the gem require 'purecloud' # setup authorization @secret = ENV['PURECLOUD_SECRET'] @id = ENV['PURECLOUD_CLIENT_ID'] environment = "mypurecloud.com" @authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment PureCloud.configure do |config| config.access_token = @authToken end api_instance = PureCloud::WorkforceManagementApi.new mu_id = "mu_id_example" # String | The muId of the management unit. begin #Get agents in the management unit result = api_instance.get_managementunits_mu_id_users(mu_id) p result rescue PureCloud::ApiError => e puts "Exception when calling WorkforceManagementApi->get_managementunits_mu_id_users: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **mu_id** | **String**| The muId of the management unit. | {: class="table table-striped"} ### Return type [**WfmUserEntityListing**](WfmUserEntityListing.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -[**TimeOffRequestList**](TimeOffRequestList.html) get_managementunits_mu_id_users_user_id_timeoffrequests(mu_id, user_id, opts) Get a list of time off requests for any user Wraps GET /api/v2/workforcemanagement/managementunits/{muId}/users/{userId}/timeoffrequests ### Example ~~~ruby # load the gem require 'purecloud' # setup authorization @secret = ENV['PURECLOUD_SECRET'] @id = ENV['PURECLOUD_CLIENT_ID'] environment = "mypurecloud.com" @authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment PureCloud.configure do |config| config.access_token = @authToken end api_instance = PureCloud::WorkforceManagementApi.new mu_id = "mu_id_example" # String | The muId of the management unit. user_id = "user_id_example" # String | The userId to whom the Time Off Request applies. opts = { recently_reviewed: false # BOOLEAN | Limit results to requests that have been reviewed within the preceding 30 days } begin #Get a list of time off requests for any user result = api_instance.get_managementunits_mu_id_users_user_id_timeoffrequests(mu_id, user_id, opts) p result rescue PureCloud::ApiError => e puts "Exception when calling WorkforceManagementApi->get_managementunits_mu_id_users_user_id_timeoffrequests: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **mu_id** | **String**| The muId of the management unit. | **user_id** | **String**| The userId to whom the Time Off Request applies. | **recently_reviewed** | **BOOLEAN**| Limit results to requests that have been reviewed within the preceding 30 days | [optional] [default to false] {: class="table table-striped"} ### Return type [**TimeOffRequestList**](TimeOffRequestList.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -[**TimeOffRequest**](TimeOffRequest.html) get_managementunits_mu_id_users_user_id_timeoffrequests_timeoffrequest_id(mu_id, user_id, time_off_request_id) Get a time off request by id Wraps GET /api/v2/workforcemanagement/managementunits/{muId}/users/{userId}/timeoffrequests/{timeOffRequestId} ### Example ~~~ruby # load the gem require 'purecloud' # setup authorization @secret = ENV['PURECLOUD_SECRET'] @id = ENV['PURECLOUD_CLIENT_ID'] environment = "mypurecloud.com" @authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment PureCloud.configure do |config| config.access_token = @authToken end api_instance = PureCloud::WorkforceManagementApi.new mu_id = "mu_id_example" # String | The muId of the management unit. user_id = "user_id_example" # String | The userId to whom the Time Off Request applies. time_off_request_id = "time_off_request_id_example" # String | Time Off Request Id begin #Get a time off request by id result = api_instance.get_managementunits_mu_id_users_user_id_timeoffrequests_timeoffrequest_id(mu_id, user_id, time_off_request_id) p result rescue PureCloud::ApiError => e puts "Exception when calling WorkforceManagementApi->get_managementunits_mu_id_users_user_id_timeoffrequests_timeoffrequest_id: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **mu_id** | **String**| The muId of the management unit. | **user_id** | **String**| The userId to whom the Time Off Request applies. | **time_off_request_id** | **String**| Time Off Request Id | {: class="table table-striped"} ### Return type [**TimeOffRequest**](TimeOffRequest.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -[**TimeOffRequestList**](TimeOffRequestList.html) get_timeoffrequests(opts) Get a list of time off requests for the current user Wraps GET /api/v2/workforcemanagement/timeoffrequests ### Example ~~~ruby # load the gem require 'purecloud' # setup authorization @secret = ENV['PURECLOUD_SECRET'] @id = ENV['PURECLOUD_CLIENT_ID'] environment = "mypurecloud.com" @authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment PureCloud.configure do |config| config.access_token = @authToken end api_instance = PureCloud::WorkforceManagementApi.new opts = { recently_reviewed: false # BOOLEAN | Limit results to requests that have been reviewed within the preceding 30 days } begin #Get a list of time off requests for the current user result = api_instance.get_timeoffrequests(opts) p result rescue PureCloud::ApiError => e puts "Exception when calling WorkforceManagementApi->get_timeoffrequests: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **recently_reviewed** | **BOOLEAN**| Limit results to requests that have been reviewed within the preceding 30 days | [optional] [default to false] {: class="table table-striped"} ### Return type [**TimeOffRequestList**](TimeOffRequestList.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -[**TimeOffRequest**](TimeOffRequest.html) get_timeoffrequests_timeoffrequest_id(time_off_request_id) Get a time off request for the current user by id Wraps GET /api/v2/workforcemanagement/timeoffrequests/{timeOffRequestId} ### Example ~~~ruby # load the gem require 'purecloud' # setup authorization @secret = ENV['PURECLOUD_SECRET'] @id = ENV['PURECLOUD_CLIENT_ID'] environment = "mypurecloud.com" @authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment PureCloud.configure do |config| config.access_token = @authToken end api_instance = PureCloud::WorkforceManagementApi.new time_off_request_id = "time_off_request_id_example" # String | Time Off Request Id begin #Get a time off request for the current user by id result = api_instance.get_timeoffrequests_timeoffrequest_id(time_off_request_id) p result rescue PureCloud::ApiError => e puts "Exception when calling WorkforceManagementApi->get_timeoffrequests_timeoffrequest_id: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **time_off_request_id** | **String**| Time Off Request Id | {: class="table table-striped"} ### Return type [**TimeOffRequest**](TimeOffRequest.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## - patch_timeoffrequests_timeoffrequest_id(time_off_request_id, opts) Mark a time off request for the current user as read or unread Wraps PATCH /api/v2/workforcemanagement/timeoffrequests/{timeOffRequestId} ### Example ~~~ruby # load the gem require 'purecloud' # setup authorization @secret = ENV['PURECLOUD_SECRET'] @id = ENV['PURECLOUD_CLIENT_ID'] environment = "mypurecloud.com" @authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment PureCloud.configure do |config| config.access_token = @authToken end api_instance = PureCloud::WorkforceManagementApi.new time_off_request_id = "time_off_request_id_example" # String | Time Off Request Id opts = { body: PureCloud::TimeOffRequestPatch.new # TimeOffRequestPatch | } begin #Mark a time off request for the current user as read or unread api_instance.patch_timeoffrequests_timeoffrequest_id(time_off_request_id, opts) rescue PureCloud::ApiError => e puts "Exception when calling WorkforceManagementApi->patch_timeoffrequests_timeoffrequest_id: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **time_off_request_id** | **String**| Time Off Request Id | **body** | [**TimeOffRequestPatch**](TimeOffRequestPatch.html)| | [optional] {: class="table table-striped"} ### Return type nil (empty response body) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -[**UserScheduleContainer**](UserScheduleContainer.html) post_managementunits_mu_id_schedules_search(mu_id, opts) Get user schedules within the given time range Wraps POST /api/v2/workforcemanagement/managementunits/{muId}/schedules/search ### Example ~~~ruby # load the gem require 'purecloud' # setup authorization @secret = ENV['PURECLOUD_SECRET'] @id = ENV['PURECLOUD_CLIENT_ID'] environment = "mypurecloud.com" @authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment PureCloud.configure do |config| config.access_token = @authToken end api_instance = PureCloud::WorkforceManagementApi.new mu_id = "mu_id_example" # String | The muId of the management unit. opts = { body: PureCloud::UserListScheduleRequestBody.new # UserListScheduleRequestBody | body } begin #Get user schedules within the given time range result = api_instance.post_managementunits_mu_id_schedules_search(mu_id, opts) p result rescue PureCloud::ApiError => e puts "Exception when calling WorkforceManagementApi->post_managementunits_mu_id_schedules_search: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **mu_id** | **String**| The muId of the management unit. | **body** | [**UserListScheduleRequestBody**](UserListScheduleRequestBody.html)| body | [optional] {: class="table table-striped"} ### Return type [**UserScheduleContainer**](UserScheduleContainer.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json ## -[**UserScheduleContainer**](UserScheduleContainer.html) post_schedules(opts) Get a schedule for the current user Wraps POST /api/v2/workforcemanagement/schedules ### Example ~~~ruby # load the gem require 'purecloud' # setup authorization @secret = ENV['PURECLOUD_SECRET'] @id = ENV['PURECLOUD_CLIENT_ID'] environment = "mypurecloud.com" @authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment PureCloud.configure do |config| config.access_token = @authToken end api_instance = PureCloud::WorkforceManagementApi.new opts = { body: PureCloud::CurrentUserScheduleRequestBody.new # CurrentUserScheduleRequestBody | body } begin #Get a schedule for the current user result = api_instance.post_schedules(opts) p result rescue PureCloud::ApiError => e puts "Exception when calling WorkforceManagementApi->post_schedules: #{e}" end ~~~ ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**CurrentUserScheduleRequestBody**](CurrentUserScheduleRequestBody.html)| body | [optional] {: class="table table-striped"} ### Return type [**UserScheduleContainer**](UserScheduleContainer.html) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json