Package: python-playvox
python-playvoxpython-playvox is a simple API wrapper for the Playvox REST API.Documentation for the Playvox API can be foundhere.Please note, this wrapper is in beta and has not been fully tested.UsageTo instantiate the API wrapper you will need the subdomain for your your API uid and your API key.frompython_playvoximportPlayvoxsubdomain='mysubdomain'uid='my-playvox-uid'key='my-playvox-key'pv=Playvox(subdomain,uid,key)This will create an instance of the wrapper that makes calls to 'https://mysubdomain.playvox.com/api/v1/' and authenticates with your playvox uid and key.Methodspv.coaching.get(**kwargs):pv.learning.get(**kwargs):pv.campaign.get(**kwargs):pv.campaign.vars(campaign_id)pv.campaign.users(campaign_id)pv.campaign.send_data(campaign_id, data)pv.calibration.get(**kwargs)pv.evaluation.get(**kwargs)pv.scorecard.get(**kwargs)pv.team.get(**kwargs)pv.team.new(name, description, team_leaders, users)pv.team.update(team_id, **kwargs)pv.team.add_user(team_id, user_id)pv.team.remove_user(team_id, user_id)pv.team.delete(team_id)pv.user.get(**kwargs)pv.user.new(first_name, last_name, username, email, password, **kwargs)pv.user.update(user_id, **kwargs)pv.user.deactivate(user_id, deactivation_type, reason)pv.user.activate(user_id)pv.role.get(**kwargs)pv.integration.get()pv.integration.new(name, description, data_storage_minutes)pv.integration.update(integration_id, **kwargs)pv.integration.delete(integration_id)pv.integration.add_metadata(integration_id, field_id, m_type, allowed, required, available_in):pv.integration.update_metadata(integration_id, metadata_id, **kwargs):pv.integration.delete_metadata(integration_id, metadata_id)pv.interaction.get(integration_id)pv.interaction.add(integration_id, interaction_id, assignee_id, custom_metadata)pv.interaction.update(integration_id, interaction_id, data)pv.interaction.delete(integration_id, interaction_id)pv.interaction.get_comments(interaction_id)pv.interaction.add_comment(interaction_id, body, comment_type, author_id, comment_dt=None)pv.interaction.update_comment(interaction_id, comment_id, body, comment_dt=None)pv.delete_comment(interaction_id, comment_id)pv.interaction.bulk_add(integration_id, interactions)pv.interaction.bulk_status(job_id)pv.coaching.get(**kwargs):Parameters:include(string): use include='all' to include all coaching related objects informationpage(int): page number for data paginationper_page(int): number of resources per page for data paginationquery(string): JSON specifying resource filtersfields(string): comma separated list of fields to be returned from the resourcesort(string): comma separated list of sort attributes. Use + as prefix for ascending and - as prefix for descendingReturns a dict of coaching data that match the specified parameterspv.learning.get(**kwargs):Parameters:include(string): use include='all' to include all learning related objects informationpage(int): page number for data paginationper_page(int): number of resources per page for data paginationquery(string): JSON specifying resource filtersfields(string): comma separated list of fields to be returned from the resourcesort(string): comma separated list of sort attributes. Use + as prefix for ascending and - as prefix for descendingReturns a dict of learnings data that match the specified parameterspv.campaign.get(**kwargs):Parameters:include(string): use include='all' to include all campaign related objects informationpage(int): page number for data paginationper_page(int): number of resources per page for data paginationquery(string): JSON specifying resource filtersfields(string): comma separated list of fields to be returned from the resourcesort(string): comma separated list of sort attributes. Use + as prefix for ascending and - as prefix for descendingReturns a dict of campaign data that match the specified parameterspv.campaign.vars(campaign_id)Parameters:campaign_id(string)required: campaign ID to pull vars data forReturns a dict containing vars data for the specified campaignpv.campaign.users(campaign_id)Parameters:campaign_id(string)required: campaign ID to pull users data forReturns a dict containing users data for the specified campaignpv.campaign.send_data(campaign_id, data)Parameters:campaign_id(string)required: id of campaign to send campaign metric data todata(dict or list[dict])required: metric data to add to the campaignReturns True if the data was successfully added, otherwise an error is raisedpv.calibration.get(**kwargs)Parameters:include(string): use include='all' to include all calibration related objects informationpage(int): page number for data paginationper_page(int): number of resources per page for data paginationquery(string): JSON specifying resource filtersfields(string): comma separated list of fields to be returned from the resourcesort(string): comma separated list of sort attributes. Use + as prefix for ascending and - as prefix for descendingReturns a dict of calibration data that match the specified parameterspv.evaluation.get(**kwargs)Parameters:include(string): use include='all' to include all evaluation related objects informationpage(int): page number for data paginationper_page(int): number of resources per page for data paginationquery(string): JSON specifying resource filtersfields(string): comma separated list of fields to be returned from the resourcesort(string): comma separated list of sort attributes. Use + as prefix for ascending and - as prefix for descendingReturns a dict of evaluation data that match the specified parameterspv.scorecard.get(**kwargs)Parameters:include(string): use include='all' to include all scorecard related objects informationpage(int): page number for data paginationper_page(int): number of resources per page for data paginationquery(string): JSON specifying resource filtersfields(string): comma separated list of fields to be returned from the resourcesort(string): comma separated list of sort attributes. Use + as prefix for ascending and - as prefix for descendingReturns a dict of scorecard data that match the specified parameterspv.team.get(**kwargs)Parameters:include(string): use include='all' to include all team related objects informationpage(int): page number for data paginationper_page(int): number of resources per page for data paginationquery(string): JSON specifying resource filtersfields(string): comma separated list of fields to be returned from the resourcesort(string): comma separated list of sort attributes. Use + as prefix for ascending and - as prefix for descendingReturns a dict of team data that match the specified parameterspv.team.new(name, description, team_leaders, users)Parameters:name(string)required: name of the new teamdescription(string): description of the new teamteam_leaders(list)required: a list of the user ids of team leadersusers(list): a list of the user ids of team membersReturns the id of the newly created teampv.team.update(team_id, **kwargs)Parameters:team_id(string)required: the id of the team to be updatedname(string): the new name of the teamdescription(string): the new description for the teamteam_leader_id(list): a list of user ids for team leaders to replace the current listusers(list): a list of user ids for users to replace the current listReturns True if successful, otherwise an error will be raisedpv.team.add_user(team_id, user_id)Parameters:team_id(string)required: the id of the team the user will be added touser_id(string)required: the id of the user that will be added to the teamReturns True if successful, otherwise an error will be raisedpv.team.remove_user(team_id, user_id)Parameters:team_id(string)required: the id of the team that the user will be removed fromuser_id(string)required: the id of the user that will be removed from the teamReturns True if successful, otherwise an error will be raisedpv.team.delete(team_id)Parameters:team_id(string)required: the id of the team that will be deletedReturns True if successful, otherwise an error will be raisedpv.user.get(**kwargs)Parameters:include(string): use include='all' to include all user related objects informationpage(int): page number for data paginationper_page(int): number of resources per page for data paginationquery(string): JSON specifying resource filtersfields(string): comma separated list of fields to be returned from the resourcesort(string): comma separated list of sort attributes. Use + as prefix for ascending and - as prefix for descendingReturns a dict containing user data for the specified parameterspv.user.new(first_name, last_name, username, email, password, **kwargs)Parameters:first_name(string)required: the new user's first namelast_name(string)required: the new user's last nameusername(string)required: the username that the new user will login withemail(string)required: the new user's email addresspassword(string)required: the new user's passwordat least 10 characters1 numer required1 uppercase letter required1 lowercase letter requiredintegrations_{integration_name}(string): the user's integration ID for the specified integration, acceptable integration names include:five9zendesksalesforcelivechatringcentralintercomfreshdesktalkdesksopimkustomerhelpscouthelpshiftReturns the id of the new userpv.user.update(user_id, **kwargs)Parameters:user_id(string)required: the id of the user to be updatedname(string): the new first name for the specified userlast_name(string): the new last name for the specified userintegrations_{integration_name}(string): the user's integration ID for the specified integration, acceptable integration names include:five9zendesksalesforcelivechatringcentralintercomfreshdesktalkdesksopimkustomerhelpscouthelpshiftReturns True if the user was updated successfully, otherwise an error will be raisedpv.user.deactivate(user_id, deactivation_type, reason)Parameters:user_id(string)required: the id of the user to be deactivateddeactivation_type(string)required: the type of deactivationreason(string)required: the reason the user is being deactivatedReturns True if successful, otherwise an error will be raisedpv.user.activate(user_id)Parameters:user_id(string)required: the id of a previously deactivated user to be activatedReturns True if succesful, otherwise an error will be raisedpv.role.get(**kwargs)Parameters:include(string): use include='all' to include all role related objects informationpage(int): page number for data paginationper_page(int): number of resources per page for data paginationquery(string): JSON specifying resource filtersfields(string): comma separated list of fields to be returned from the resourcesort(string): comma separated list of sort attributes. Use + as prefix for ascending and - as prefix for descendingReturns a dict of role data that match the specified parameterspv.integration.get()Returns all available integrationspv.integration.new(name, description, data_storage_minutes)Parameters:name(string)required: name for the new integrationdescription(string)required: description for the new integrationdata_storage_minutes(int)required: the time in minutes to retain data from the integrationMax: 129600(90 days)Returns the id of the newly created integrationpv.integration.update(integration_id, **kwargs)Parameters:integration_id(string)required: the id of the integration to be updatedname(string): a new name for the integrationdescription(string): a new description for the integrationdata_storage_minutes(int): the time in minutes to retain data from the integrationMax: 129600(90 days)Returns True if the specified integration is updated successfully, otherwise an error will be raisedpv.integration.delete(integration_id)Parameters:integration_id(string)required: the id of the integration to be deletedReturns True if the specified integration is deleted successfully, otherwise an error will be raisedpv.integration.add_metadata(integration_id, field_id, m_type, allowed, required, available_in):Parameters:integration_id(string)required: the id of the integration that the metadata field will be added tofield_id(string)required: name to identify the metadata fieldMinimum 3 charactersMaximum 30 charactersAccepts only a-z and underscoresm_type(string)required: the type of the field, allowed values:stringintegerfloatlistbooleandatetimeallowed(list)required: the allowed values that the filed will acceptrequired(boolean)required: specifies whether or not the field is requiredavailable_in(list[string]): specifies if the field can be filtered or shown in related data, accepts:'filters''display'Returns the id of the new metadata field if successful, otherwise an error will be raisedpv.integration.update_metadata(integration_id, metadata_id, **kwargs):Parameters:integration_id(string)required: the id of the integration that the target metadata field exists onmetadata_id(string)required: the id of the metadata field that will be updatedfield_id(string): name to identify the metadata fieldMinimum 3 charactersMaximum 30 charactersAccepts only a-z and underscoresm_type(string): the type of the field, allowed values:stringintegerfloatlistbooleandatetimeallowed(list): the allowed values that the filed will acceptrequired(boolean): specifies whether or not the field is requiredavailable_in(list[string]): specifies if the field can be filtered or shown in related data, accepts:'filters''display'Returns True if successful, otherwise an error will be raisedpv.integration.delete_metadata(integration_id, metadata_id)Parameters:integration_id(string)required: the id of the integration that the target metadata field exists onmetadata_id(string)required: the id of the metadata field to be deletedReturns True if successful, otherwise an error will be raisedpv.interaction.get(integration_id)Parameters:integration_id(string)requiredThe id of the integration to get integrations for.Returns all interactions for the specified integrationpv.interaction.add(integration_id, interaction_id, assignee_id, custom_metadata)Parameters:integration_id(string)required: The id of the integration the interaction will be added to.interaction_id(string): The id of your external systemMax length: 68 charactersassignee_id(string): The id of the user on the external system (should match email or username in playvox)custom_metadata(dict)required: The payload of all the metadata fields defined on the integrationReturns the id of the new interactionpv.interaction.update(integration_id, interaction_id, data)Parameters:integration_id(string)required: the id of the integration the target interaction exists oninteraction_id(string)required: the id of the interaction to be updateddata(dict)required: The payload of the metadata fields to be updatedReturns True if successful, otherwise an error will be raisedpv.interaction.delete(integration_id, interaction_id)Parameters:integration_id(string)required: the id of the integration the target interaction exists oninteraction_id(string)required: the id of the interaction to be deletedReturns True if successful, otherwise an error will be raisedpv.interaction.get_comments(interaction_id)Parameters:interaction_id(string)required: the id of the interaction to get comments forReturns all comments associated with the interactionpv.interaction.add_comment(interaction_id, body, comment_type, author_id, comment_dt=None)Parameters:interaction_id(string)required: the id of the interaction the comment will be added tobody(string)required: the body of the commentcomment_type(string)required: the type of comment, accepts:'customer_comment''agent_comment''internal_note'author_id(string)required: the username or email of the author on playvoxcomment_dt(datetime): the time that the comment was added to the interaction, defaults to current time if not specifiedReturns the id of the newly created commentpv.interaction.update_comment(interaction_id, comment_id, body, comment_dt=None)Parameters:interaction_id(string)required: the id of the interaction that the comment is associated withcomment_id(string)required: the id of the comment to be updatedbody(string)required: the new body of the commentcomment_dt(datetime): the time that the comment was updated, defaults to current time if not specifiedReturns True if the comment is updated successfully, otherwise an error will be raisedpv.delete_comment(interaction_id, comment_id)Parameters:interaction_id(string)required: the id of the interaction that the target comment is associated withcomment_id(string)required: the id of the comment to be deletedReturns True if the comment is deleted successfully, otherwise an error will be raisedpv.interaction.bulk_add(integration_id, interactions)Parameters:integration_id(string)required: the id of the integration that the interactions will be added tointeractions(dict)required: the interactions to be added to the integration, for more information see thePlayvox API DocumentationReturns the job id of the bulk jobpv.interaction.bulk_status(job_id)Parameters:job_id(string)required: the id of the bulk job to check the status ofReturns status information on the specified bulk job