Advanced Studio Development Development 501: Snippets, API Framework, & REST Mike Voorhees | 801.390.9800 |
[email protected]
YOUR ADVANCED FACILITATION TEAM • Advanced Snippet Functionality presented by Mike Voorhees • Framework API’s presented by Nate Tolman • REST presented by Mark Rasi-Koskinen
Advanced Snippet Development 501: Snippets, API Framework, & REST Mike Voorhees | 801.390.9800 |
[email protected]
WHAT WE WILL COVER • Commands most commonly used in the Snippet action • Build during class for future reference • Necessary concepts for Framework API’s and REST
WHAT IS THIS?
USING CHAR Returns a character from the ASCII code value. This allows a script the ability to programmatically add special characters to a string such as carriage returns, quotes and parenthesis Some common uses: • Combine two prompts to one variable name • Create different lines for the Marquee • Replace values such as commas with spaces or remove the value completely
ASCII TABLE MAP Be cautious with this FUNCTION as char(0) through char(7) are reserved For internal use and may cause scripts to malfunction.
LET’S TRY IT! Let’s create a snippet and write it out to test the functionality. Caption the snippet as Char Please bring a snippet action out and write out like the example
ASSIGNING VARIABLES USING CHAR
After writing this into your snippet be sure and test again for syntax errors
MULTIPLE LINE MARQUEE Char(13) will force a carriage return and different messages can appear on each line in the Marquee
PROMPTS AND TTS • Mixing Voice prompts with TTS in a snippet will cause a hiccup without using Char ASSIGN MIXPROMPT=“”Prompts\MainMenu.wav””%This is a test”” (two quotes together will not work)
MIXING PROMPTS Use the syntax below. If you have prompts you want to use in your Prompts folder you can test it.
REPLACING VALUES Replace the commas in the variables with a space
SPLITTING VARIABLES The split command can change the value of a variable into an array. You can also change the variable name and split the value if you need. Examples: • Separating Names i.e. First and Last from a Web Service call • Separating Telephone numbers to verify area code for time zone bounding • City State separation
SPLIT COMMAND Bring out a new Snippet and caption it as Split
Using the Split Command to assign a value to a new Variable
Note: You will be able to reference the variable now in your script using {VarArray[POS]}
SPLIT COMMAND
If you don’t have a need to rename the variable you can just use the delimiter to separate it out and it will make an array with the same name
SUBSTRING COMMAND The Substring Command allows you to pull part of a variable. String Expressions:
• Returns the characters from start through end. The first character position is 1. If the end exceeds the length of the source text, it will automatically truncate at the end of the source text. Numeric Expressions:
• Takes the characters from start through end and tries to read them as a number. IF the characters do not represent a number, 0 will be returned instead.
WHEN TO USE SUBSTRINGS • To extract area code for logic • Breakdown of day month and year • Formatting a number for query strings
STRING SUBSTRING Let’s open up a new snippet and caption it as Substring
Saving just the area code as a string.
LENGTH COMMAND We’re using the length command so we can do simple math to insert it as a dollar amount
NUMERIC SUBSTRING Let’s write in some simple math for more examples
WORKING WITH TIME “TIME” is a predefined system variable that you can pull in a snippet. You assign it a name and it returns as an OLE Automation. Examples: • Measure distance between two events in the script. • Record a timestamp to return to CRM/Reporting Tool so you save the time of the action • Use a case Statement to route calls differently based on time of day
NUMERIC AND STRING TIME Let’s drop in a new snippet and caption it time
Let’s script this out and test it to see the result. Retest and notice that it is changing in seconds.
MEASURING DISTANCE BETWEEN EVENTS This script is measuring the start time of the music so that it doesn’t play the same segment of music after it loops through every 30 seconds ASSIGN PlayTime=30 ASSIGN MusicStart=time
MEASURING DISTANCE BETWEEN EVENTS
MEASURING DISTANCE BETWEEN EVENTS ASSIGN MusicStop=time ASSIGN MusicLength=(Musi cStopMusicStart)*86400 ASSIGN PlayTime=(PlayTim e-MusicLength)\1 ASSIGN POS=0
MEASURING DISTANCE BETWEEN EVENTS Variable POS Value POS + Playtime
ASSIGN MusicStop=time ASSIGN PlayTime=(MusicStopMusicStart)*86400 ASSIGN PlayTime=PlayTime\1
PREDEFINED VARIABLE NOW Useful for passing a complete timestamp including date and time, and measuring distance between events
• PortChecker RunSub script uses this to ensure emails are not sent any more than every 15 minutes • Can be returned as both numeric and as a string
SNIPPET WITH NOW Insert a new Snippet and label it NOW
When testing you can see it also changes by the second
USING ASDATETIME
converts a OLE numeric datetime to its string equivalent
SEPERATING OUT NOW You can use “datepart” to break down what is returned from NOW or from a web service call. It understands the following: • Day of Week (i.e. Mon, Tue, Wed) • Day of Month • Month • Year • Hour, Minute and Second
PARTING DAYS, HOURS, DOW New Snippet with Datepart as the caption
CHANGING DOW TO ACTUAL DAY Let’s script to change DOW from 0,1,2, etc to an actual day of the week! With DOW 0 = Sunday 1= Monday
USING CONTAINS Can check a variable and verify if it has a specific character. It returns either a “1” for true or a “0” for false.
• IF the variable is an array, all elements will be checked for the exact value • Contains value is case sensitive
USING CONTAINS Let’s create a new Snippet and label it contains, then assign some variables to test using contains
SEARCHING FOR A SINGLE CHARACTER Let’s script this out. What were the results here? Why?
ARRAYS WITH CONTAINS Notice when using an array it can check for a full string
Note: Use with replace to remove characters that are unnecessary
USING COUNT/SIZE Count or Size is used to verify that a variable actually contains a value. Useful to see if a web service is returning customer data in a field.
• If the variable contains an array, this returns the number of elements within the array. • If the value is not an array, but is not empty, the value 1 is returned. Otherwise, 0 is returned.
VERIFYING CONTENT IN VARIABLE Let’s create a new Snippet and call it count_size, script out an array, a variable with a string value and a blank variable
VERIFYING VARIABLES Notice that count and size are synonymous. They can be used interchangeably
VERIFYING SIZE OF STRING Here we see that when we use count or size and a variable exists we will return a 1. The specific length of the single variable has no bearing
USING REPEATING LOOPS • A REPEAT command will loop through the contained information a specific set of times that you have determined. It does not have a predetermined incrementing value. • A FOR command loops through the contained information a specific amount of times, but it does have a predetermined incrementing value
USER CASES • Dynamically pull out variables from an Array • Validate that a value exists in an Array • Build out possible options for a Menu • Mike V. likes Spock
CURRENT USER STORIES • Web Service array passes back a sub array that needs to be parsed out and a “Prompt” string would need to be written out based off variable returns. • We see this often with: • • • • •
Claims Payments Orders Menu accessibility Account access levels
Snippets are powerful Smaller script size Agents are more effective with more information
QUESTIONS?
Framework API's Development 501: Snippets, API Framework, & REST Nate Tolman | 801.320.3434 |
[email protected]
DYNAMIC DATA How do you currently pull out data from imbedded arrays or complex data returns in Studio?
WHAT IS DYNAMIC DATA? A way to place a large and/or complex data package into a structured element that can easily be referenced throughout studio.
DYNAMIC DATA Pre 13.2
Post 13.2
Let’s Take A Look!
Framework API's Nate Tolman| 801.320.3434
[email protected]
WHAT DOES IT CONSIST OF? • Agent information • Contact Monitoring • Service Level Obtainment • Skill information • Team List • And a lot more!
WHY DID WE DO THIS? • Keep calls within our platform without the need to use our WebService for agent/skill information • Speed up the experience during customer’s call by replacing the WebService calls with data from our platform.
API ACTIONS (WE WILL USE TODAY) • Set Security User • Agent list • Agent Skill Assignment • Update Skill Agent Assignment • Agent States
SET SECURITY USER Inputs • Agent • This will base all vision of returns in future actions off this profile • TimeZone Output • SecurityUser
AGENT LIST Inputs • Security User •a Bsed off Previous “Set Security User” Action • AgentID • If left blank will pull all agents Output • Agents
SKILLS LIST (DYNAMIC RETURN) Inputs • Security User • Based off Previous “Set Security User” Action • SkillID • If left blank will pull all skills Output • Skills
AGENT STATES Inputs • Security User • Based off Previous “Set Security User” Action • Updated Since • Date to pull current states of agents that have logged in since this date • AgentID • Find a specific agent. If left blank all agents will be pulled Output • AgentStates
UPDATE SKILL AGENT ASSIGNMENT Inputs • Security User • Based off Previous “Set Security User” Action • SkillID • AgentID • Proficiency • Active
TIME TO PRACTICE! • The scenarios in the following slides are based off real examples. The names of these customers have been changed to protect the innocent.
YAK YAK, Inc.
SCENARIO ONE • Issue – Yak Yak, Inc. would like to streamline the process of getting their customers routed to the agent that is assigned to their case. • Roadblocks- Their CRM only passes e-mail addresses to the inContact platform. • Execution – Add scripting functionality to find the agent id and queue the call to the specific agent.
SCENARIO ONE: THINGS TO USE • Use a “for” or a “repeat” command • Assign an e-mail address as a variable • Find the Agent ID # based off the e-mail address using the Framework Agent List API
PHILOSORAPTOR CORPORATION
SCENARIO TWO • Issue - Philosoraptor Corporation’s customer complain about a long queue time is causing decreased satisfaction. • Roadblocks – Count Agents doesn’t get all the numbers needed for a calls-to-queue count. • Execution – Use the Framework API to calculate agents in certain states (Specific unavailable codes) and then offer a call-back when above threshold.
SCENARIO TWO: THINGS TO USE • Use a “for” or a “repeat” command • Gather the agents from the Framework Agent List API • Find which states the agents are logged into by using the Agent States API • Gather the Skill information through the • Skill List API call
YETI & CORN, Inc.
SCENARIO THREE • Issue - Yeti & Corn, Inc. needs the ability to change phone skills on a regular basis. • RoadBlocks. Y&C’s supervisors aren’t always near a computer and some don’t have smartphones . . . gasp. • Execution – Create an IVR that can change the agent’s skills from a phone.
SCENARIO THREE: THINGS TO USE • Use a snippet to set an array of agents within a switch • Based off a menu entry add skills • Use the Update Skill Agent Assignment Framework API action
API ACTIONS RECAP (WHAT WE DISCUSSED) • Set Security User • Agent list • Agent Skill Assignment • Update Skill Agent Assignment • Agent States
Takeaway Takeaway Takeaway
QUESTIONS?
REST Development 501: Snippets, API Framework, & REST Mark Rasi-Koskinen | 801.320.3434 |
[email protected]
REST: WHAT IS IT? • REST = Representation State Transfer • RESTful applications use HTTP requests • • • •
Create Read Update Delete
• REST is not a “Standard”
WHY REST? • REST is lightweight • There is nothing you could do in RPC or Web Services that you cannot do in REST. • REST does not require an agreed upon library of types and objects.
SOAP VS. REST SOAP • Requires DLL import • XML backbone • High level of entry
REST • No agreed upon library of types and objects, therefore no need for a DLL. • HTTP backbone • Lower level of entry
REST IN SNIPPET
REST IN SNIPPET
REST IN SNIPPET
REST IN SNIPPET
REST IN SNIPPET
REST IN SNIPPET
REST IN SNIPPET
REST IN SNIPPET
REST IN SNIPPET
LET’S BUILD YOUR OWN! • http://services.faa.gov/airport/status/SFO?format=applicat ion/json • GetRESTProxy()
QUESTIONS?
Advanced Snippet Functionality Dynamic Data and Framework API’s Using REST
Thank You!
Advanced Studio Development Development 501: Snippets, API Framework, & REST