instruction
stringlengths
81
221
input
stringlengths
50
1.19k
output
stringlengths
525
3.61k
Provide a Python example that uses the DELETE /api/v2/flows/milestones/{milestoneId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Delete a flow milestone.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); milestone_id = 'milestone_id_example' # str | flow milestone ID try: # Delete a flow milestone. api_response = api_instance.delete_flows_milestone(milestone_id) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->delete_flows_milestone: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/flows/milestones/{milestoneId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get a flow milestone. Returns a specified flow milestone
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); milestone_id = 'milestone_id_example' # str | flow milestone ID try: # Get a flow milestone api_response = api_instance.get_flows_milestone(milestone_id) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->get_flows_milestone: %s\n" % e)```
Provide a Python example that uses the PUT /api/v2/flows/milestones/{milestoneId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Updates a flow milestone
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); milestone_id = 'milestone_id_example' # str | flow milestone ID body = PureCloudPlatformClientV2.FlowMilestone() # FlowMilestone | (optional) try: # Updates a flow milestone api_response = api_instance.put_flows_milestone(milestone_id, body=body) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->put_flows_milestone: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/flows/outcomes Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get a pageable list of flow outcomes, filtered by query parameters. Multiple IDs can be specified, in which case all matching flow outcomes will be returned, and no other parameters will be evaluated.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); page_number = 1 # int | Page number (optional) (default to 1) page_size = 25 # int | Page size (optional) (default to 25) sort_by = ''id'' # str | Sort by (optional) (default to 'id') sort_order = ''asc'' # str | Sort order (optional) (default to 'asc') id = ['id_example'] # list[str] | ID (optional) name = 'name_example' # str | Name (optional) description = 'description_example' # str | Description (optional) name_or_description = 'name_or_description_example' # str | Name or description (optional) division_id = ['division_id_example'] # list[str] | division ID(s) (optional) try: # Get a pageable list of flow outcomes, filtered by query parameters api_response = api_instance.get_flows_outcomes(page_number=page_number, page_size=page_size, sort_by=sort_by, sort_order=sort_order, id=id, name=name, description=description, name_or_description=name_or_description, division_id=division_id) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->get_flows_outcomes: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/flows/outcomes Genesys Cloud Python SDK.
Genesys describes this as an API used to: Create a flow outcome. Asynchronous. Notification topic: v2.flows.outcomes.{flowOutcomeId}
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); body = PureCloudPlatformClientV2.FlowOutcome() # FlowOutcome | (optional) try: # Create a flow outcome api_response = api_instance.post_flows_outcomes(body=body) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->post_flows_outcomes: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/flows/outcomes/divisionviews Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get a pageable list of basic flow outcome information objects filterable by query parameters. This returns flow outcomes consisting of name and division. If one or more IDs are specified, the search will fetch flow outcomes that match the given ID(s) and not use any additional supplied query parameters in the search.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); page_number = 1 # int | Page number (optional) (default to 1) page_size = 25 # int | Page size (optional) (default to 25) sort_by = ''id'' # str | Sort by (optional) (default to 'id') sort_order = ''asc'' # str | Sort order (optional) (default to 'asc') id = ['id_example'] # list[str] | ID (optional) name = 'name_example' # str | Name (optional) division_id = ['division_id_example'] # list[str] | division ID(s) (optional) try: # Get a pageable list of basic flow outcome information objects filterable by query parameters. api_response = api_instance.get_flows_outcomes_divisionviews(page_number=page_number, page_size=page_size, sort_by=sort_by, sort_order=sort_order, id=id, name=name, division_id=division_id) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->get_flows_outcomes_divisionviews: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/flows/outcomes/{flowOutcomeId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get a flow outcome. Returns a specified flow outcome
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_outcome_id = 'flow_outcome_id_example' # str | flow outcome ID try: # Get a flow outcome api_response = api_instance.get_flows_outcome(flow_outcome_id) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->get_flows_outcome: %s\n" % e)```
Provide a Python example that uses the PUT /api/v2/flows/outcomes/{flowOutcomeId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Updates a flow outcome. Updates a flow outcome. Asynchronous. Notification topic: v2.flowoutcomes.{flowoutcomeId}
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_outcome_id = 'flow_outcome_id_example' # str | flow outcome ID body = PureCloudPlatformClientV2.FlowOutcome() # FlowOutcome | (optional) try: # Updates a flow outcome api_response = api_instance.put_flows_outcome(flow_outcome_id, body=body) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->put_flows_outcome: %s\n" % e)```
Provide a Python example that uses the DELETE /api/v2/flows/{flowId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Delete flow
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | Flow ID try: # Delete flow api_instance.delete_flow(flow_id) except ApiException as e: print("Exception when calling ArchitectApi->delete_flow: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/flows/{flowId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get flow
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | Flow ID deleted = False # bool | Deleted flows (optional) (default to False) try: # Get flow api_response = api_instance.get_flow(flow_id, deleted=deleted) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->get_flow: %s\n" % e)```
Provide a Python example that uses the PUT /api/v2/flows/{flowId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Update flow
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | Flow ID body = PureCloudPlatformClientV2.Flow() # Flow | try: # Update flow api_response = api_instance.put_flow(flow_id, body) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->put_flow: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/flows/{flowId}/history Genesys Cloud Python SDK.
Genesys describes this as an API used to: Generate flow history. Asynchronous. Notification topic: v2.flows.{flowId}
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | Flow ID try: # Generate flow history api_response = api_instance.post_flow_history(flow_id) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->post_flow_history: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/flows/{flowId}/history/{historyId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get generated flow history
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | Flow ID history_id = 'history_id_example' # str | History request ID page_number = 1 # int | Page number (optional) (default to 1) page_size = 25 # int | Page size (optional) (default to 25) sort_order = ''desc'' # str | Sort order (optional) (default to 'desc') sort_by = ''timestamp'' # str | Sort by (optional) (default to 'timestamp') action = ['action_example'] # list[str] | Flow actions to include (omit to include all) (optional) try: # Get generated flow history api_response = api_instance.get_flow_history_history_id(flow_id, history_id, page_number=page_number, page_size=page_size, sort_order=sort_order, sort_by=sort_by, action=action) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->get_flow_history_history_id: %s\n" % e)```
Provide a Python example that uses the DELETE /api/v2/flows/{flowId}/instances/settings/loglevels Genesys Cloud Python SDK.
Genesys describes this as an API used to: Deletes a log level for a flow by flow id. Deletes the associated log level for a flow by flow id
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | The flow id to delete the loglevel for try: # Deletes a log level for a flow by flow id. api_instance.delete_flow_instances_settings_loglevels(flow_id) except ApiException as e: print("Exception when calling ArchitectApi->delete_flow_instances_settings_loglevels: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/flows/{flowId}/instances/settings/loglevels Genesys Cloud Python SDK.
Genesys describes this as an API used to: Retrieves the log level for a flow by flow id. Retrieves the log level for a flow by flow id.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | The flow id to get the loglevel for expand = ['expand_example'] # list[str] | Expand instructions for the result (optional) try: # Retrieves the log level for a flow by flow id. api_response = api_instance.get_flow_instances_settings_loglevels(flow_id, expand=expand) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->get_flow_instances_settings_loglevels: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/flows/{flowId}/instances/settings/loglevels Genesys Cloud Python SDK.
Genesys describes this as an API used to: Set the logLevel for a particular flow id. Assigns a new loglevel to a flow id
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | The flow id to set the loglevel for body = PureCloudPlatformClientV2.FlowLogLevelRequest() # FlowLogLevelRequest | New LogLevel settings expand = ['expand_example'] # list[str] | Expand instructions for the result (optional) try: # Set the logLevel for a particular flow id api_response = api_instance.post_flow_instances_settings_loglevels(flow_id, body, expand=expand) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->post_flow_instances_settings_loglevels: %s\n" % e)```
Provide a Python example that uses the PUT /api/v2/flows/{flowId}/instances/settings/loglevels Genesys Cloud Python SDK.
Genesys describes this as an API used to: Edit the logLevel for a particular flow id. Updates the loglevel for a flow id
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | The flow id to edit the loglevel for body = PureCloudPlatformClientV2.FlowLogLevelRequest() # FlowLogLevelRequest | New LogLevel settings expand = ['expand_example'] # list[str] | Expand instructions for the result (optional) try: # Edit the logLevel for a particular flow id api_response = api_instance.put_flow_instances_settings_loglevels(flow_id, body, expand=expand) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->put_flow_instances_settings_loglevels: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/flows/{flowId}/latestconfiguration Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get the latest configuration for flow
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | Flow ID deleted = False # bool | Deleted flows (optional) (default to False) try: # Get the latest configuration for flow api_response = api_instance.get_flow_latestconfiguration(flow_id, deleted=deleted) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->get_flow_latestconfiguration: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/flows/{flowId}/versions Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get flow version list
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | Flow ID page_number = 1 # int | Page number (optional) (default to 1) page_size = 25 # int | Page size (optional) (default to 25) deleted = True # bool | Include Deleted flows (optional) try: # Get flow version list api_response = api_instance.get_flow_versions(flow_id, page_number=page_number, page_size=page_size, deleted=deleted) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->get_flow_versions: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/flows/{flowId}/versions Genesys Cloud Python SDK.
Genesys describes this as an API used to: Create flow version
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | Flow ID body = NULL # object | try: # Create flow version api_response = api_instance.post_flow_versions(flow_id, body) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->post_flow_versions: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/flows/{flowId}/versions/{versionId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get flow version
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | Flow ID version_id = 'version_id_example' # str | Version ID deleted = 'deleted_example' # str | Deleted flows (optional) try: # Get flow version api_response = api_instance.get_flow_version(flow_id, version_id, deleted=deleted) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->get_flow_version: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/flows/{flowId}/versions/{versionId}/configuration Genesys Cloud Python SDK.
Genesys describes this as an API used to: Create flow version configuration
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | Flow ID version_id = 'version_id_example' # str | Version ID deleted = 'deleted_example' # str | Deleted flows (optional) try: # Create flow version configuration api_response = api_instance.get_flow_version_configuration(flow_id, version_id, deleted=deleted) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->get_flow_version_configuration: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/flows/{flowId}/versions/{versionId}/health Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get overall health scores for all intents present in the NLU domain version associated with the bot flow version.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | Flow ID. version_id = 'version_id_example' # str | Version ID. language = 'language_example' # str | Language to filter for (optional) try: # Get overall health scores for all intents present in the NLU domain version associated with the bot flow version. api_response = api_instance.get_flow_version_health(flow_id, version_id, language=language) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->get_flow_version_health: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/flows/{flowId}/versions/{versionId}/intents/{intentId}/health Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get health scores and other health metrics for a specific intent. This includes the health metrics for each utterance in an intent.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | Flow ID. version_id = 'version_id_example' # str | Version ID. intent_id = 'intent_id_example' # str | Intent ID. language = 'language_example' # str | Language to filter for try: # Get health scores and other health metrics for a specific intent. This includes the health metrics for each utterance in an intent. api_response = api_instance.get_flow_version_intent_health(flow_id, version_id, intent_id, language) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->get_flow_version_intent_health: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/flows/{flowId}/versions/{versionId}/intents/{intentId}/utterances/{utteranceId}/health Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get health metrics associated with a specific utterance of an intent.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ArchitectApi(); flow_id = 'flow_id_example' # str | Flow ID. version_id = 'version_id_example' # str | Version ID. intent_id = 'intent_id_example' # str | Intent ID. utterance_id = 'utterance_id_example' # str | Utterance ID. language = 'language_example' # str | Language to filter for try: # Get health metrics associated with a specific utterance of an intent. api_response = api_instance.get_flow_version_intent_utterance_health(flow_id, version_id, intent_id, utterance_id, language) pprint(api_response) except ApiException as e: print("Exception when calling ArchitectApi->get_flow_version_intent_utterance_health: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/audits/query Genesys Cloud Python SDK.
Genesys describes this as an API used to: Create audit query execution. Use /api/v2/audits/query/servicemapping endpoint for a list of valid values
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuditApi(); body = PureCloudPlatformClientV2.AuditQueryRequest() # AuditQueryRequest | query try: # Create audit query execution api_response = api_instance.post_audits_query(body) pprint(api_response) except ApiException as e: print("Exception when calling AuditApi->post_audits_query: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/audits/query/realtime Genesys Cloud Python SDK.
Genesys describes this as an API used to: This endpoint will only retrieve 14 days worth of audits for certain services. Please use /query to get a full list and older audits. Use /api/v2/audits/query/realtime/servicemapping endpoint for a list of valid values
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuditApi(); body = PureCloudPlatformClientV2.AuditRealtimeQueryRequest() # AuditRealtimeQueryRequest | query expand = ['expand_example'] # list[str] | Which fields, if any, to expand (optional) try: # This endpoint will only retrieve 14 days worth of audits for certain services. Please use /query to get a full list and older audits. api_response = api_instance.post_audits_query_realtime(body, expand=expand) pprint(api_response) except ApiException as e: print("Exception when calling AuditApi->post_audits_query_realtime: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/audits/query/realtime/related Genesys Cloud Python SDK.
Genesys describes this as an API used to: Often a single action results in multiple audits. The endpoint retrieves all audits created by the same action as the given audit id.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuditApi(); body = PureCloudPlatformClientV2.AuditRealtimeRelatedRequest() # AuditRealtimeRelatedRequest | query expand = ['expand_example'] # list[str] | Which fields, if any, to expand (optional) try: # Often a single action results in multiple audits. The endpoint retrieves all audits created by the same action as the given audit id. api_response = api_instance.post_audits_query_realtime_related(body, expand=expand) pprint(api_response) except ApiException as e: print("Exception when calling AuditApi->post_audits_query_realtime_related: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/audits/query/realtime/servicemapping Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get service mapping information used in realtime audits.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuditApi(); try: # Get service mapping information used in realtime audits. api_response = api_instance.get_audits_query_realtime_servicemapping() pprint(api_response) except ApiException as e: print("Exception when calling AuditApi->get_audits_query_realtime_servicemapping: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/audits/query/servicemapping Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get service mapping information used in audits.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuditApi(); try: # Get service mapping information used in audits. api_response = api_instance.get_audits_query_servicemapping() pprint(api_response) except ApiException as e: print("Exception when calling AuditApi->get_audits_query_servicemapping: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/audits/query/{transactionId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get status of audit query execution
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuditApi(); transaction_id = 'transaction_id_example' # str | Transaction ID try: # Get status of audit query execution api_response = api_instance.get_audits_query_transaction_id(transaction_id) pprint(api_response) except ApiException as e: print("Exception when calling AuditApi->get_audits_query_transaction_id: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/audits/query/{transactionId}/results Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get results of audit query
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuditApi(); transaction_id = 'transaction_id_example' # str | Transaction ID cursor = 'cursor_example' # str | Indicates where to resume query results (not required for first page) (optional) page_size = 25 # int | Indicates maximum number of results in response. Default page size is 25 results. The maximum page size is 500. (optional) (default to 25) expand = ['expand_example'] # list[str] | Which fields, if any, to expand (optional) allow_redirect = True # bool | Result sets with large amounts of data will respond with a download url (optional) try: # Get results of audit query api_response = api_instance.get_audits_query_transaction_id_results(transaction_id, cursor=cursor, page_size=page_size, expand=expand, allow_redirect=allow_redirect) pprint(api_response) except ApiException as e: print("Exception when calling AuditApi->get_audits_query_transaction_id_results: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/divisions Genesys Cloud Python SDK.
Genesys describes this as an API used to: Retrieve a list of all divisions defined for the organization. Request specific divisions by id using a query param "id", e.g. ?id=5f777167-63be-4c24-ad41-374155d9e28b&id=72e9fb25-c484-488d-9312-7acba82435b3
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ObjectsApi(); page_size = 25 # int | The total page size requested (optional) (default to 25) page_number = 1 # int | The page number requested (optional) (default to 1) sort_by = 'sort_by_example' # str | variable name requested to sort by (optional) expand = ['expand_example'] # list[str] | variable name requested by expand list (optional) next_page = 'next_page_example' # str | next page token (optional) previous_page = 'previous_page_example' # str | Previous page token (optional) object_count = False # bool | Include the count of objects contained in the division (optional) (default to False) id = ['id_example'] # list[str] | Optionally request specific divisions by their IDs (optional) name = 'name_example' # str | Search term to filter by division name (optional) try: # Retrieve a list of all divisions defined for the organization api_response = api_instance.get_authorization_divisions(page_size=page_size, page_number=page_number, sort_by=sort_by, expand=expand, next_page=next_page, previous_page=previous_page, object_count=object_count, id=id, name=name) pprint(api_response) except ApiException as e: print("Exception when calling ObjectsApi->get_authorization_divisions: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/authorization/divisions Genesys Cloud Python SDK.
Genesys describes this as an API used to: Create a division.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ObjectsApi(); body = PureCloudPlatformClientV2.AuthzDivision() # AuthzDivision | Division try: # Create a division. api_response = api_instance.post_authorization_divisions(body) pprint(api_response) except ApiException as e: print("Exception when calling ObjectsApi->post_authorization_divisions: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/divisions/home Genesys Cloud Python SDK.
Genesys describes this as an API used to: Retrieve the home division for the organization. Will not include object counts.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ObjectsApi(); try: # Retrieve the home division for the organization. api_response = api_instance.get_authorization_divisions_home() pprint(api_response) except ApiException as e: print("Exception when calling ObjectsApi->get_authorization_divisions_home: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/divisions/limit Genesys Cloud Python SDK.
Genesys describes this as an API used to: Returns the maximum allowed number of divisions.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ObjectsApi(); try: # Returns the maximum allowed number of divisions. api_response = api_instance.get_authorization_divisions_limit() pprint(api_response) except ApiException as e: print("Exception when calling ObjectsApi->get_authorization_divisions_limit: %s\n" % e)```
Provide a Python example that uses the DELETE /api/v2/authorization/divisions/{divisionId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Delete a division.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ObjectsApi(); division_id = 'division_id_example' # str | Division ID force = False # bool | Force delete this division as well as the grants and objects associated with it (optional) (default to False) try: # Delete a division. api_instance.delete_authorization_division(division_id, force=force) except ApiException as e: print("Exception when calling ObjectsApi->delete_authorization_division: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/divisions/{divisionId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Returns an authorization division.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ObjectsApi(); division_id = 'division_id_example' # str | Division ID object_count = False # bool | Get count of objects in this division, grouped by type (optional) (default to False) try: # Returns an authorization division. api_response = api_instance.get_authorization_division(division_id, object_count=object_count) pprint(api_response) except ApiException as e: print("Exception when calling ObjectsApi->get_authorization_division: %s\n" % e)```
Provide a Python example that uses the PUT /api/v2/authorization/divisions/{divisionId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Update a division.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ObjectsApi(); division_id = 'division_id_example' # str | Division ID body = PureCloudPlatformClientV2.AuthzDivision() # AuthzDivision | Updated division data try: # Update a division. api_response = api_instance.put_authorization_division(division_id, body) pprint(api_response) except ApiException as e: print("Exception when calling ObjectsApi->put_authorization_division: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/divisions/{divisionId}/grants Genesys Cloud Python SDK.
Genesys describes this as an API used to: Gets all grants for a given division. Returns all grants assigned to a given division. Maximum page size is 500.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); division_id = 'division_id_example' # str | Division ID page_number = 1 # int | Page number (optional) (default to 1) page_size = 25 # int | Page size (optional) (default to 25) try: # Gets all grants for a given division. api_response = api_instance.get_authorization_division_grants(division_id, page_number=page_number, page_size=page_size) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->get_authorization_division_grants: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/authorization/divisions/{divisionId}/objects/{objectType} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Assign a list of objects to a division. Set the division of a specified list of objects. The objects must all be of the same type, one of: CAMPAIGN, MANAGEMENTUNIT, FLOW, QUEUE, DATATABLES or USER. The body of the request is a list of object IDs, which are expected to be GUIDs, e.g. ["206ce31f-61ec-40ed-a8b1-be6f06303998","250a754e-f5e4-4f51-800f-a92f09d3bf8c"]
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ObjectsApi(); division_id = 'division_id_example' # str | Division ID object_type = 'object_type_example' # str | The type of the objects. Must be one of the valid object types body = ['body_example'] # list[str] | Object Id List try: # Assign a list of objects to a division api_instance.post_authorization_division_object(division_id, object_type, body) except ApiException as e: print("Exception when calling ObjectsApi->post_authorization_division_object: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/authorization/divisions/{divisionId}/restore Genesys Cloud Python SDK.
Genesys describes this as an API used to: Recreate a previously deleted division.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ObjectsApi(); division_id = 'division_id_example' # str | Division ID body = PureCloudPlatformClientV2.AuthzDivision() # AuthzDivision | Recreated division data (optional) try: # Recreate a previously deleted division. api_response = api_instance.post_authorization_division_restore(division_id, body=body) pprint(api_response) except ApiException as e: print("Exception when calling ObjectsApi->post_authorization_division_restore: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/divisionspermitted/paged/me Genesys Cloud Python SDK.
Genesys describes this as an API used to: Returns which divisions the current user has the given permission in.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.UsersApi(); permission = 'permission_example' # str | The permission string, including the object to access, e.g. routing:queue:view page_number = 1 # int | Page number (optional) (default to 1) page_size = 25 # int | Page size (optional) (default to 25) try: # Returns which divisions the current user has the given permission in. api_response = api_instance.get_authorization_divisionspermitted_paged_me(permission, page_number=page_number, page_size=page_size) pprint(api_response) except ApiException as e: print("Exception when calling UsersApi->get_authorization_divisionspermitted_paged_me: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/permissions Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get all permissions. Retrieve a list of all permission defined in the system.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); page_size = 25 # int | Page size (optional) (default to 25) page_number = 1 # int | Page number (optional) (default to 1) query_type = 'query_type_example' # str | Query filter type (optional) query = 'query_example' # str | Comma-separated list of permissions or domains to query (optional) try: # Get all permissions. api_response = api_instance.get_authorization_permissions(page_size=page_size, page_number=page_number, query_type=query_type, query=query) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->get_authorization_permissions: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/products Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get the list of enabled products. Gets the list of enabled products. Some example product names are: collaborateFree, collaboratePro, communicate, and engage.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); try: # Get the list of enabled products api_response = api_instance.get_authorization_products() pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->get_authorization_products: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/roles Genesys Cloud Python SDK.
Genesys describes this as an API used to: Retrieve a list of all roles defined for the organization
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); page_size = 25 # int | The total page size requested (optional) (default to 25) page_number = 1 # int | The page number requested (optional) (default to 1) sort_by = 'sort_by_example' # str | variable name requested to sort by (optional) expand = ['expand_example'] # list[str] | variable name requested by expand list (optional) next_page = 'next_page_example' # str | next page token (optional) previous_page = 'previous_page_example' # str | Previous page token (optional) name = 'name_example' # str | (optional) permission = ['permission_example'] # list[str] | (optional) default_role_id = ['default_role_id_example'] # list[str] | (optional) user_count = True # bool | (optional) (default to True) id = ['id_example'] # list[str] | id (optional) try: # Retrieve a list of all roles defined for the organization api_response = api_instance.get_authorization_roles(page_size=page_size, page_number=page_number, sort_by=sort_by, expand=expand, next_page=next_page, previous_page=previous_page, name=name, permission=permission, default_role_id=default_role_id, user_count=user_count, id=id) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->get_authorization_roles: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/authorization/roles Genesys Cloud Python SDK.
Genesys describes this as an API used to: Create an organization role.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); body = PureCloudPlatformClientV2.DomainOrganizationRoleCreate() # DomainOrganizationRoleCreate | Organization role try: # Create an organization role. api_response = api_instance.post_authorization_roles(body) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->post_authorization_roles: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/authorization/roles/default Genesys Cloud Python SDK.
Genesys describes this as an API used to: Restores all default roles. This endpoint serves several purposes. 1. It provides the org with default roles. This is important for default roles that will be added after go-live (they can retroactively add the new default-role). Note: When not using a query param of force=true, it only adds the default roles not configured for the org; it does not overwrite roles. 2. Using the query param force=true, you can restore all default roles. Note: This does not have an effect on custom roles.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); force = False # bool | Restore default roles (optional) (default to False) try: # Restores all default roles api_response = api_instance.post_authorization_roles_default(force=force) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->post_authorization_roles_default: %s\n" % e)```
Provide a Python example that uses the PUT /api/v2/authorization/roles/default Genesys Cloud Python SDK.
Genesys describes this as an API used to: Restore specified default roles
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); body = [PureCloudPlatformClientV2.DomainOrganizationRole()] # list[DomainOrganizationRole] | Organization roles list try: # Restore specified default roles api_response = api_instance.put_authorization_roles_default(body) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->put_authorization_roles_default: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/roles/settings Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get authorization role settings
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); try: # Get authorization role settings api_response = api_instance.get_authorization_roles_settings() pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->get_authorization_roles_settings: %s\n" % e)```
Provide a Python example that uses the PUT /api/v2/authorization/roles/settings Genesys Cloud Python SDK.
Genesys describes this as an API used to: Change authorization role settings. Change role settings
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); body = PureCloudPlatformClientV2.RoleSettings() # RoleSettings | Authorization Role Settings try: # Change authorization role settings api_response = api_instance.put_authorization_roles_settings(body) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->put_authorization_roles_settings: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/roles/{leftRoleId}/comparedefault/{rightRoleId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get an org role to default role comparison. Compares any organization role to a default role id and show differences
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); left_role_id = 'left_role_id_example' # str | Left Role ID right_role_id = 'right_role_id_example' # str | Right Role id try: # Get an org role to default role comparison api_response = api_instance.get_authorization_role_comparedefault_right_role_id(left_role_id, right_role_id) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->get_authorization_role_comparedefault_right_role_id: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/authorization/roles/{leftRoleId}/comparedefault/{rightRoleId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get an unsaved org role to default role comparison. Allows users to compare their existing roles in an unsaved state to its default role
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); left_role_id = 'left_role_id_example' # str | Left Role ID right_role_id = 'right_role_id_example' # str | Right Role id body = PureCloudPlatformClientV2.DomainOrganizationRole() # DomainOrganizationRole | Organization role try: # Get an unsaved org role to default role comparison api_response = api_instance.post_authorization_role_comparedefault_right_role_id(left_role_id, right_role_id, body) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->post_authorization_role_comparedefault_right_role_id: %s\n" % e)```
Provide a Python example that uses the DELETE /api/v2/authorization/roles/{roleId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Delete an organization role.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); role_id = 'role_id_example' # str | Role ID try: # Delete an organization role. api_instance.delete_authorization_role(role_id) except ApiException as e: print("Exception when calling AuthorizationApi->delete_authorization_role: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/roles/{roleId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get a single organization role. Get the organization role specified by its ID.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); role_id = 'role_id_example' # str | Role ID user_count = True # bool | Fetch the count of users who have this role granted in at least one division. Setting this value or defaulting to 'true' can lead to slower load times or timeouts for role queries with large member counts. (optional) (default to True) expand = ['expand_example'] # list[str] | Which fields, if any, to expand. \"unusedPermissions\" returns the permissions not used for the role (optional) try: # Get a single organization role. api_response = api_instance.get_authorization_role(role_id, user_count=user_count, expand=expand) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->get_authorization_role: %s\n" % e)```
Provide a Python example that uses the PATCH /api/v2/authorization/roles/{roleId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Patch Organization Role for needsUpdate Field. Patch Organization Role for needsUpdate Field
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); role_id = 'role_id_example' # str | Role ID body = PureCloudPlatformClientV2.DomainOrganizationRole() # DomainOrganizationRole | Organization role try: # Patch Organization Role for needsUpdate Field api_response = api_instance.patch_authorization_role(role_id, body) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->patch_authorization_role: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/authorization/roles/{roleId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Bulk-grant subjects and divisions with an organization role.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); role_id = 'role_id_example' # str | Role ID body = PureCloudPlatformClientV2.SubjectDivisions() # SubjectDivisions | Subjects and Divisions subject_type = ''PC_USER'' # str | what the type of the subjects are (PC_GROUP, PC_USER or PC_OAUTH_CLIENT) (optional) (default to 'PC_USER') try: # Bulk-grant subjects and divisions with an organization role. api_instance.post_authorization_role(role_id, body, subject_type=subject_type) except ApiException as e: print("Exception when calling AuthorizationApi->post_authorization_role: %s\n" % e)```
Provide a Python example that uses the PUT /api/v2/authorization/roles/{roleId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Update an organization role. Update
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); role_id = 'role_id_example' # str | Role ID body = PureCloudPlatformClientV2.DomainOrganizationRoleUpdate() # DomainOrganizationRoleUpdate | Organization role try: # Update an organization role. api_response = api_instance.put_authorization_role(role_id, body) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->put_authorization_role: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/roles/{roleId}/subjectgrants Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get the subjects' granted divisions in the specified role. Includes the divisions for which the subject has a grant.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); role_id = 'role_id_example' # str | Role ID page_size = 25 # int | The total page size requested (optional) (default to 25) page_number = 1 # int | The page number requested (optional) (default to 1) sort_by = 'sort_by_example' # str | variable name requested to sort by (optional) expand = ['expand_example'] # list[str] | variable name requested by expand list (optional) next_page = 'next_page_example' # str | next page token (optional) previous_page = 'previous_page_example' # str | Previous page token (optional) try: # Get the subjects' granted divisions in the specified role. api_response = api_instance.get_authorization_role_subjectgrants(role_id, page_size=page_size, page_number=page_number, sort_by=sort_by, expand=expand, next_page=next_page, previous_page=previous_page) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->get_authorization_role_subjectgrants: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/roles/{roleId}/users Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get a list of the users in a specified role. Get an array of the UUIDs of the users in the specified role.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); role_id = 'role_id_example' # str | Role ID page_size = 25 # int | Page size (optional) (default to 25) page_number = 1 # int | Page number (optional) (default to 1) try: # Get a list of the users in a specified role. api_response = api_instance.get_authorization_role_users(role_id, page_size=page_size, page_number=page_number) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->get_authorization_role_users: %s\n" % e)```
Provide a Python example that uses the PUT /api/v2/authorization/roles/{roleId}/users/add Genesys Cloud Python SDK.
Genesys describes this as an API used to: Sets the users for the role
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); role_id = 'role_id_example' # str | Role ID body = ['body_example'] # list[str] | List of user IDs try: # Sets the users for the role api_response = api_instance.put_authorization_role_users_add(role_id, body) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->put_authorization_role_users_add: %s\n" % e)```
Provide a Python example that uses the PUT /api/v2/authorization/roles/{roleId}/users/remove Genesys Cloud Python SDK.
Genesys describes this as an API used to: Removes the users from the role
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); role_id = 'role_id_example' # str | Role ID body = ['body_example'] # list[str] | List of user IDs try: # Removes the users from the role api_response = api_instance.put_authorization_role_users_remove(role_id, body) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->put_authorization_role_users_remove: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/settings Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get authorization settings
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); try: # Get authorization settings api_response = api_instance.get_authorization_settings() pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->get_authorization_settings: %s\n" % e)```
Provide a Python example that uses the PATCH /api/v2/authorization/settings Genesys Cloud Python SDK.
Genesys describes this as an API used to: Change authorization settings. Change authorization settings
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); body = PureCloudPlatformClientV2.AuthorizationSettings() # AuthorizationSettings | Authorization Settings try: # Change authorization settings api_response = api_instance.patch_authorization_settings(body) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->patch_authorization_settings: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/subjects/me Genesys Cloud Python SDK.
Genesys describes this as an API used to: Returns a listing of roles and permissions for the currently authenticated user.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.UsersApi(); include_duplicates = False # bool | Include multiple entries with the same role and division but different subjects (optional) (default to False) try: # Returns a listing of roles and permissions for the currently authenticated user. api_response = api_instance.get_authorization_subjects_me(include_duplicates=include_duplicates) pprint(api_response) except ApiException as e: print("Exception when calling UsersApi->get_authorization_subjects_me: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/subjects/rolecounts Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get the count of roles granted to a list of subjects
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.AuthorizationApi(); id = ['id_example'] # list[str] | id (optional) try: # Get the count of roles granted to a list of subjects api_response = api_instance.get_authorization_subjects_rolecounts(id=id) pprint(api_response) except ApiException as e: print("Exception when calling AuthorizationApi->get_authorization_subjects_rolecounts: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/authorization/subjects/{subjectId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Returns a listing of roles and permissions for a user.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.UsersApi(); subject_id = 'subject_id_example' # str | Subject ID (user or group) include_duplicates = False # bool | Include multiple entries with the same role and division but different subjects (optional) (default to False) try: # Returns a listing of roles and permissions for a user. api_response = api_instance.get_authorization_subject(subject_id, include_duplicates=include_duplicates) pprint(api_response) except ApiException as e: print("Exception when calling UsersApi->get_authorization_subject: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/authorization/subjects/{subjectId}/bulkadd Genesys Cloud Python SDK.
Genesys describes this as an API used to: Bulk-grant roles and divisions to a subject.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.UsersApi(); subject_id = 'subject_id_example' # str | Subject ID (user or group) body = PureCloudPlatformClientV2.RoleDivisionGrants() # RoleDivisionGrants | Pairs of role and division IDs subject_type = ''PC_USER'' # str | what the type of the subject is (PC_GROUP, PC_USER or PC_OAUTH_CLIENT) (optional) (default to 'PC_USER') try: # Bulk-grant roles and divisions to a subject. api_instance.post_authorization_subject_bulkadd(subject_id, body, subject_type=subject_type) except ApiException as e: print("Exception when calling UsersApi->post_authorization_subject_bulkadd: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/authorization/subjects/{subjectId}/bulkremove Genesys Cloud Python SDK.
Genesys describes this as an API used to: Bulk-remove grants from a subject.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.UsersApi(); subject_id = 'subject_id_example' # str | Subject ID (user or group) body = PureCloudPlatformClientV2.RoleDivisionGrants() # RoleDivisionGrants | Pairs of role and division IDs try: # Bulk-remove grants from a subject. api_instance.post_authorization_subject_bulkremove(subject_id, body) except ApiException as e: print("Exception when calling UsersApi->post_authorization_subject_bulkremove: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/authorization/subjects/{subjectId}/bulkreplace Genesys Cloud Python SDK.
Genesys describes this as an API used to: Replace subject's roles and divisions with the exact list supplied in the request. This operation will not remove grants that are inherited from group membership. It will only set the grants directly applied to the subject.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.UsersApi(); subject_id = 'subject_id_example' # str | Subject ID (user or group) body = PureCloudPlatformClientV2.RoleDivisionGrants() # RoleDivisionGrants | Pairs of role and division IDs subject_type = ''PC_USER'' # str | what the type of the subject is (PC_GROUP, PC_USER or PC_OAUTH_CLIENT) (optional) (default to 'PC_USER') try: # Replace subject's roles and divisions with the exact list supplied in the request. api_instance.post_authorization_subject_bulkreplace(subject_id, body, subject_type=subject_type) except ApiException as e: print("Exception when calling UsersApi->post_authorization_subject_bulkreplace: %s\n" % e)```
Provide a Python example that uses the DELETE /api/v2/authorization/subjects/{subjectId}/divisions/{divisionId}/roles/{roleId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Delete a grant of a role in a division
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.UsersApi(); subject_id = 'subject_id_example' # str | Subject ID (user or group) division_id = 'division_id_example' # str | the id of the division of the grant role_id = 'role_id_example' # str | the id of the role of the grant try: # Delete a grant of a role in a division api_instance.delete_authorization_subject_division_role(subject_id, division_id, role_id) except ApiException as e: print("Exception when calling UsersApi->delete_authorization_subject_division_role: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/authorization/subjects/{subjectId}/divisions/{divisionId}/roles/{roleId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Make a grant of a role in a division
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.UsersApi(); subject_id = 'subject_id_example' # str | Subject ID (user or group) division_id = 'division_id_example' # str | the id of the division to which to make the grant role_id = 'role_id_example' # str | the id of the role to grant subject_type = ''PC_USER'' # str | what the type of the subject is: PC_GROUP, PC_USER or PC_OAUTH_CLIENT (note: for cross-org authorization, please use the Organization Authorization endpoints) (optional) (default to 'PC_USER') try: # Make a grant of a role in a division api_instance.post_authorization_subject_division_role(subject_id, division_id, role_id, subject_type=subject_type) except ApiException as e: print("Exception when calling UsersApi->post_authorization_subject_division_role: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/users/{subjectId}/roles Genesys Cloud Python SDK.
Genesys describes this as an API used to: Returns a listing of roles and permissions for a user.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.UsersApi(); subject_id = 'subject_id_example' # str | User ID try: # Returns a listing of roles and permissions for a user. api_response = api_instance.get_user_roles(subject_id) pprint(api_response) except ApiException as e: print("Exception when calling UsersApi->get_user_roles: %s\n" % e)```
Provide a Python example that uses the PUT /api/v2/users/{subjectId}/roles Genesys Cloud Python SDK.
Genesys describes this as an API used to: Sets the user's roles
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.UsersApi(); subject_id = 'subject_id_example' # str | User ID body = ['body_example'] # list[str] | List of roles try: # Sets the user's roles api_response = api_instance.put_user_roles(subject_id, body) pprint(api_response) except ApiException as e: print("Exception when calling UsersApi->put_user_roles: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/billing/reports/billableusage Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get a report of the billable license usages. Report is of the billable usages (e.g. licenses and devices utilized) for a given period. If response's status is InProgress, wait a few seconds, then try the same request again.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.BillingApi(); start_date = '2013-10-20T19:20:30+01:00' # datetime | The period start date. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z end_date = '2013-10-20T19:20:30+01:00' # datetime | The period end date. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z try: # Get a report of the billable license usages api_response = api_instance.get_billing_reports_billableusage(start_date, end_date) pprint(api_response) except ApiException as e: print("Exception when calling BillingApi->get_billing_reports_billableusage: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/billing/trusteebillingoverview/{trustorOrgId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get the billing overview for an organization that is managed by a partner. Tax Disclaimer: Prices returned by this API do not include applicable taxes. It is the responsibility of the customer to pay all taxes that are appropriate in their jurisdiction. See the PureCloud API Documentation in the Developer Center for more information about this API: https://developer.mypurecloud.com/api/rest/v2/
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.BillingApi(); trustor_org_id = 'trustor_org_id_example' # str | The organization ID of the trustor (customer) organization. billing_period_index = 0 # int | 0 for active period (overview data may change until period closes). 1 for prior completed billing period. 2 for two billing cycles prior, and so on. (optional) (default to 0) try: # Get the billing overview for an organization that is managed by a partner. api_response = api_instance.get_billing_trusteebillingoverview_trustor_org_id(trustor_org_id, billing_period_index=billing_period_index) pprint(api_response) except ApiException as e: print("Exception when calling BillingApi->get_billing_trusteebillingoverview_trustor_org_id: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/carrierservices/integrations/emergencylocations/me Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get location for the logged in user
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.CarrierServicesApi(); phone_number = 'phone_number_example' # str | Phone number in E164 format try: # Get location for the logged in user api_response = api_instance.get_carrierservices_integrations_emergencylocations_me(phone_number) pprint(api_response) except ApiException as e: print("Exception when calling CarrierServicesApi->get_carrierservices_integrations_emergencylocations_me: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/carrierservices/integrations/emergencylocations/me Genesys Cloud Python SDK.
Genesys describes this as an API used to: Set current location for the logged in user
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.CarrierServicesApi(); body = PureCloudPlatformClientV2.EmergencyLocation() # EmergencyLocation | (optional) try: # Set current location for the logged in user api_response = api_instance.post_carrierservices_integrations_emergencylocations_me(body=body) pprint(api_response) except ApiException as e: print("Exception when calling CarrierServicesApi->post_carrierservices_integrations_emergencylocations_me: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/chats/messages/{messageId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get a message
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); message_id = 'message_id_example' # str | messageId try: # Get a message api_response = api_instance.get_chats_message(message_id) pprint(api_response) except ApiException as e: print("Exception when calling ChatApi->get_chats_message: %s\n" % e)```
Provide a Python example that uses the PUT /api/v2/chats/messages/{messageId}/reactions Genesys Cloud Python SDK.
Genesys describes this as an API used to: Update reactions to a message
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); message_id = 'message_id_example' # str | messageId body = PureCloudPlatformClientV2.ChatReactionUpdate() # ChatReactionUpdate | reactionUpdate try: # Update reactions to a message api_instance.put_chats_message_reactions(message_id, body) except ApiException as e: print("Exception when calling ChatApi->put_chats_message_reactions: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/chats/rooms Genesys Cloud Python SDK.
Genesys describes this as an API used to: Create an adhoc room
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); body = PureCloudPlatformClientV2.CreateRoomRequest() # CreateRoomRequest | Room properties try: # Create an adhoc room api_response = api_instance.post_chats_rooms(body) pprint(api_response) except ApiException as e: print("Exception when calling ChatApi->post_chats_rooms: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/chats/rooms/{roomJid} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get a room
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); room_jid = 'room_jid_example' # str | roomJid try: # Get a room api_response = api_instance.get_chats_room(room_jid) pprint(api_response) except ApiException as e: print("Exception when calling ChatApi->get_chats_room: %s\n" % e)```
Provide a Python example that uses the PATCH /api/v2/chats/rooms/{roomJid} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Set properties for a room
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); room_jid = 'room_jid_example' # str | roomJid body = PureCloudPlatformClientV2.RoomUpdateRequest() # RoomUpdateRequest | Room properties try: # Set properties for a room api_instance.patch_chats_room(room_jid, body) except ApiException as e: print("Exception when calling ChatApi->patch_chats_room: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/chats/rooms/{roomJid}/messages Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get a room's message history
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); room_jid = 'room_jid_example' # str | roomJid limit = 'limit_example' # str | The maximum number of messages to retrieve (optional) before = 'before_example' # str | The cutoff date for messages to retrieve (optional) after = 'after_example' # str | The beginning date for messages to retrieve (optional) try: # Get a room's message history api_response = api_instance.get_chats_room_messages(room_jid, limit=limit, before=before, after=after) pprint(api_response) except ApiException as e: print("Exception when calling ChatApi->get_chats_room_messages: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/chats/rooms/{roomJid}/messages Genesys Cloud Python SDK.
Genesys describes this as an API used to: Send a message to a room
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); room_jid = 'room_jid_example' # str | roomId body = PureCloudPlatformClientV2.SendMessageBody() # SendMessageBody | messageBody try: # Send a message to a room api_response = api_instance.post_chats_room_messages(room_jid, body) pprint(api_response) except ApiException as e: print("Exception when calling ChatApi->post_chats_room_messages: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/chats/rooms/{roomJid}/messages/pins Genesys Cloud Python SDK.
Genesys describes this as an API used to: Add pinned messages for a room, up to a maximum of 5 pinned messages
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); room_jid = 'room_jid_example' # str | roomJid body = PureCloudPlatformClientV2.PinnedMessageRequest() # PinnedMessageRequest | Pinned Message Ids try: # Add pinned messages for a room, up to a maximum of 5 pinned messages api_instance.post_chats_room_messages_pins(room_jid, body) except ApiException as e: print("Exception when calling ChatApi->post_chats_room_messages_pins: %s\n" % e)```
Provide a Python example that uses the DELETE /api/v2/chats/rooms/{roomJid}/messages/pins/{pinnedMessageId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Remove a pinned message from a room
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); room_jid = 'room_jid_example' # str | roomJid pinned_message_id = 'pinned_message_id_example' # str | pinnedMessageId try: # Remove a pinned message from a room api_instance.delete_chats_room_messages_pin(room_jid, pinned_message_id) except ApiException as e: print("Exception when calling ChatApi->delete_chats_room_messages_pin: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/chats/rooms/{roomJid}/messages/{messageIds} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get messages by id(s) from a room
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); room_jid = 'room_jid_example' # str | roomJid message_ids = 'message_ids_example' # str | messageIds, comma separated try: # Get messages by id(s) from a room api_response = api_instance.get_chats_room_message(room_jid, message_ids) pprint(api_response) except ApiException as e: print("Exception when calling ChatApi->get_chats_room_message: %s\n" % e)```
Provide a Python example that uses the DELETE /api/v2/chats/rooms/{roomJid}/messages/{messageId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Delete a message in a room
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); room_jid = 'room_jid_example' # str | roomId message_id = 'message_id_example' # str | messageId try: # Delete a message in a room api_instance.delete_chats_room_message(room_jid, message_id) except ApiException as e: print("Exception when calling ChatApi->delete_chats_room_message: %s\n" % e)```
Provide a Python example that uses the PATCH /api/v2/chats/rooms/{roomJid}/messages/{messageId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Edit a message in a room
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); room_jid = 'room_jid_example' # str | roomId message_id = 'message_id_example' # str | messageId body = PureCloudPlatformClientV2.SendMessageBody() # SendMessageBody | messageBody try: # Edit a message in a room api_response = api_instance.patch_chats_room_message(room_jid, message_id, body) pprint(api_response) except ApiException as e: print("Exception when calling ChatApi->patch_chats_room_message: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/chats/rooms/{roomJid}/participants Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get room participants in a room
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); room_jid = 'room_jid_example' # str | roomJid try: # Get room participants in a room api_response = api_instance.get_chats_room_participants(room_jid) pprint(api_response) except ApiException as e: print("Exception when calling ChatApi->get_chats_room_participants: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/chats/rooms/{roomJid}/participants/{participantJid} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get a room participant
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); room_jid = 'room_jid_example' # str | roomJid participant_jid = 'participant_jid_example' # str | participantJid try: # Get a room participant api_response = api_instance.get_chats_room_participant(room_jid, participant_jid) pprint(api_response) except ApiException as e: print("Exception when calling ChatApi->get_chats_room_participant: %s\n" % e)```
Provide a Python example that uses the DELETE /api/v2/chats/rooms/{roomJid}/participants/{userId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Remove a user from a room.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); room_jid = 'room_jid_example' # str | roomJid user_id = 'user_id_example' # str | userId try: # Remove a user from a room. api_instance.delete_chats_room_participant(room_jid, user_id) except ApiException as e: print("Exception when calling ChatApi->delete_chats_room_participant: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/chats/rooms/{roomJid}/participants/{userId} Genesys Cloud Python SDK.
Genesys describes this as an API used to: Join a room
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); room_jid = 'room_jid_example' # str | roomJid user_id = 'user_id_example' # str | userId try: # Join a room api_instance.post_chats_room_participant(room_jid, user_id) except ApiException as e: print("Exception when calling ChatApi->post_chats_room_participant: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/chats/settings Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get Chat Settings.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); try: # Get Chat Settings. api_response = api_instance.get_chats_settings() pprint(api_response) except ApiException as e: print("Exception when calling ChatApi->get_chats_settings: %s\n" % e)```
Provide a Python example that uses the PATCH /api/v2/chats/settings Genesys Cloud Python SDK.
Genesys describes this as an API used to: Patch Chat Settings.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); body = PureCloudPlatformClientV2.ChatSettings() # ChatSettings | Chat try: # Patch Chat Settings. api_response = api_instance.patch_chats_settings(body) pprint(api_response) except ApiException as e: print("Exception when calling ChatApi->patch_chats_settings: %s\n" % e)```
Provide a Python example that uses the PUT /api/v2/chats/settings Genesys Cloud Python SDK.
Genesys describes this as an API used to: Update Chat Settings.
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); body = PureCloudPlatformClientV2.ChatSettings() # ChatSettings | Chat try: # Update Chat Settings. api_response = api_instance.put_chats_settings(body) pprint(api_response) except ApiException as e: print("Exception when calling ChatApi->put_chats_settings: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/chats/threads/{threadId}/messages Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get history by thread
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); thread_id = 'thread_id_example' # str | threadId limit = 'limit_example' # str | The maximum number of messages to retrieve (optional) before = 'before_example' # str | The cutoff date for messages to retrieve (optional) after = 'after_example' # str | The beginning date for messages to retrieve (optional) try: # Get history by thread api_response = api_instance.get_chats_thread_messages(thread_id, limit=limit, before=before, after=after) pprint(api_response) except ApiException as e: print("Exception when calling ChatApi->get_chats_thread_messages: %s\n" % e)```
Provide a Python example that uses the GET /api/v2/chats/users/{userId}/messages Genesys Cloud Python SDK.
Genesys describes this as an API used to: Get 1on1 History between a user
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); user_id = 'user_id_example' # str | userId limit = 'limit_example' # str | The maximum number of messages to retrieve (optional) before = 'before_example' # str | The cutoff date for messages to retrieve (optional) after = 'after_example' # str | The beginning date for messages to retrieve (optional) try: # Get 1on1 History between a user api_response = api_instance.get_chats_user_messages(user_id, limit=limit, before=before, after=after) pprint(api_response) except ApiException as e: print("Exception when calling ChatApi->get_chats_user_messages: %s\n" % e)```
Provide a Python example that uses the POST /api/v2/chats/users/{userId}/messages Genesys Cloud Python SDK.
Genesys describes this as an API used to: Send a message to a user
```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(...), get_code_authorization_token(...) or get_pkce_token(...) # create an instance of the API class api_instance = PureCloudPlatformClientV2.ChatApi(); user_id = 'user_id_example' # str | userId body = PureCloudPlatformClientV2.SendMessageBody() # SendMessageBody | message body try: # Send a message to a user api_response = api_instance.post_chats_user_messages(user_id, body) pprint(api_response) except ApiException as e: print("Exception when calling ChatApi->post_chats_user_messages: %s\n" % e)```