Hello I tried using the code snippet provided by the API explorer for this endpoint:
GET
/api/v2/workforcemanagement/businessunits/{businessUnitId}/weeks/{weekId}/schedules
import PureCloudPlatformClientV2
from PureCloudPlatformClientV2.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: PureCloud OAuth
PureCloudPlatformClientV2.configuration.access_token = 'your_access_token'
# or use get_client_credentials_token(...), get_saml2bearer_token(...) or get_code_authorization_token(...)
# create an instance of the API class
api_instance = PureCloudPlatformClientV2.Workforce_ManagementApi()
business_unit_id = 'business_unit_id_example' # str | The ID of the business unit
week_id = 'week_id_example' # str | First day of schedule week in yyyy-MM-dd format, or 'recent' (without quotes) to get recent schedules
include_only_published = True # bool | includeOnlyPublished (optional)
expand = 'expand_example' # str | expand (optional)
try:
# Get the list of week schedules for the specified week
api_response = api_instance.get_workforcemanagement_businessunit_week_schedules(business_unit_id, week_id, include_only_published=include_only_published, expand=expand)
pprint(api_response)
except ApiException as e:
print("Exception when calling GetWorkforcemanagementBusinessunitWeekSchedulesRequest->get_workforcemanagement_businessunit_week_schedules: %s\n" % e)
but I get this error:
AttributeError: module 'PureCloudPlatformClientV2' has no attribute 'Workforce_ManagementApi'
have this been deprecated? what's the alternative?
Thanks,