mail@pastecode.io avatar
2 years ago
5.5 kB
step 1:
connecting to the weather API
	1) go to integrations and install "Web Services Data Actions"
	2) then we go to actions and add an action with its corresponding integration
	3)in setup>contracts in the imput contract we write what information we are going to give the action and in output what it will give us. we are writing templates for the information.
	4)in confing we put the API url. but modify it with our ZIP variable in the end so that it is dynamic.
	5) save and publish (we cannot edit after publishing)

step 2:
secure flow
	1) go to architect and in "flows" choose secure call and add a blank flow template
	2) we add an adudio widget and give it 2 thing to play: 1. greeting and 2. invocation data
	3) then we add collect input so we can take input from the caller.
		we input the audio and add the input to a varaible called CustomerZIP
		in verification choose individual digits
	4) then we add a call data action
		in category we choose our custom integration
		in data action we use the data action which we created
		in zip>Expressions we pass the custom variable which we just created
		we create additional variables in success outputs TimeStamp and Conditions
		then we add a widget called set participant data
		we name an attribute WeatherUpdatedAt and assigning to it the TimeStamp value which we created beforehand
		the second attribute is CurrentConditions and assign Conditions to it.

step 3:
	1) we go to the scripting editor and select a blank template. in script properties we mark Inbound and Data Actions as active
	we are going to create 4 string varaibles:
		1) CustomerInput and mark it as input
		2) CustomerName 
		3) WeatherConditions
		4) WeatherTimestamp
	2) we are going to add a horizontal container and add 2 textboxes
		1) name: Customer Number
		2) pass on the CustomerNumber variable
	3) we are going to add a horizontal container and add 2 textboxes
		1) name: Customer Name
		2) and in the palceholder we will enter the customer name
	4) then we are going to add a button which will invoke our secure call flow SecureWeather and mark return after flow completion as true. and in the flow data field pass the variable CustomerName
	5) we are going to add a horizontal container and add 2 textboxes		
		1) name: Current Weather
		2) variable: WeatherConditions
	6) we are going to add a horizontal container and add 2 textboxes	
		1) name: As of
		2) variable: WeatherTimeStamp
	7) we are going to add a horizontal container and add 2 textboxes	
		1)name: Interaction ID
		2)variable: Scripter.Interaction.ID
	8) save the script

step 4:
Returning Data from Secure Flow
	1) we go to queues and create a new queue Weather Queue
	2) in evaluation method check "Disregard skills, next agent"
	3) in members add admin
4) we need to create an inbound flow
	1) go to architect, in flow choose inbound flow and create a new flow Main Inbound
	2) its starting off with a menu so we want to start with a task like earlier
	3) create reusable task
	4) click the 3 dots of the new task and click set this as a starting task
	5) delete the manu
	6) welcome to the weather demo system
	7) now we want to prompt for
	8) add collect input widget
		1) input audio: please enter your customer id followed by the pound key
		2) variable: EnteredCustomerID
		3) terminated by the # key
		4) verification: individual digits
	9) we go to flow and add a set screen pop widget
		1) in screen pop script we choose our SecureWeather script
		2) in CustomerNumber we choose the variable EnteredCustomerID
	10) then we add a transfer to ACD widget
		1)Queues: Weather Queue
		2)pre-transfer audio: please wait
		3)if failed disconnect
	11) save and publish
	12) go to call routing and add a new route
		1) name: Weather
		2) in regular routing choose Main Inbound
		3) phone number +13179831000 
		4) save
step 4:
Returning Data from Secure Flow
	1) go to integration>OAuth and add a client
	2) app name: Weather Application
	3) in grant types chek Client Credentials
	4) in roles we assing it to admin
	5) copy the client id and secret
	6) we need to add another integration which will be from genesys cloud into genesys cloud
		1) choose Genesys cloud data actions
		2) and in config we need to provide vredentials
		3) input the copied information
		4) save it and turn it on
	7) we need to create a new data action so we can pull the information we need from the conversation with the API
	8) new data action GetSecureWeatherData
		1) integration genesys cloud data actions.
		2) our input contract will be ConversationID
		3) 2 strings in the output
			1) Last_Updated
			2) Conditions
		4) in config put the url
		5) and istead from the convo id use the ConversationID we created
		5) we will modify the response in config so that we can extract the parts we want from the json output
		6) save and publish
	9) we go back to our script
		1) we modify the get weather button
		2) in the buttons click action we change it to our newly created SecureFlow action
		3) we are going to create a custom action SecureFlow
			1) add step: invoke secure flow check true
			2) flow data field: CustomerName
			3) step 2: data action
			4) category: Genesys cloud data actions 
			5) data action: GetSecureWeatherData
			6) ConversationID: scripter.interaction.ID
			7) Last_Updated: WeatherTimeStamp
			8) Conditions: WeatherConditions
		4) save