relay-dotnet
|
The Relay class is responsible for defining the main functionalities that are used within workflows, such as functions for communicating with the device, sending out notifications to groups, handling workflow events, and performing physical actions on the device such as manipulating LEDs and creating vibrations. More...
Public Types | |
enum class | WebSocketConnector { Fleck , SystemHttpListener , SystemKestral } |
Public Member Functions | |
Relay (WebSocketConnector webSocketConnector, string ip, int port, bool secure) | |
async Task< bool > | AddWorkflow (string path, Type relayWorkflowType) |
async Task< bool > | RemoveWorkflow (string path) |
async Task< bool > | OnOpen (IRelayWebSocketConnection webSocketConnection) |
async void | OnClose (IRelayWebSocketConnection webSocketConnection) |
async void | OnMessage (IRelayWebSocketConnection webSocketConnection, string message) |
void | Start () |
void | Dispose () |
async void | Terminate (IRelayWorkflow relayWorkflow) |
Terminates a workflow. This method is usually called after your workflow has completed and you would like to end the workflow by calling end_interaction(), where you can then terminate the workflow. More... | |
async void | StartInteraction (IRelayWorkflow relayWorkflow, string target, string name, Dictionary< string, object > options=null) |
Starts an interaction with the user. Triggers an INTERACTION_STARTED event and allows the user to interact with the device via functions that require an interaction URN. More... | |
async void | EndInteraction (IRelayWorkflow relayWorkflow, string target) |
Ends an interaction with the user. Triggers an INTERACTION_ENDED event to signify that the user is done interacting with the device. More... | |
async Task< string > | Say (IRelayWorkflow relayWorkflow, string target, string text) |
Utilizes text to speech capabilities to make the device 'speak' to the user. More... | |
async Task< string > | Say (IRelayWorkflow relayWorkflow, string target, string text, Language language) |
Utilizes text to speech capabilities to make the device 'speak' to the user. More... | |
async Task< string > | SayAndWait (IRelayWorkflow relayWorkflow, string target, string text) |
Utilizes text to speech capabilities to make the device 'speak' to the user. Waits until the text is fully played out on the device before continuing. More... | |
async Task< string > | SayAndWait (IRelayWorkflow relayWorkflow, string target, string text, Language language) |
Utilizes text to speech capabilities to make the device 'speak' to the user. Waits until the text is fully played out on the device before continuing. More... | |
async Task< string > | Play (IRelayWorkflow relayWorkflow, string target, string filename) |
Plays a custom audio file that was uploaded by the user. More... | |
async Task< string > | PlayAndWait (IRelayWorkflow relayWorkflow, string target, string filename) |
Plays a custom audio file that was uploaded by the user. Waits until the audio file has finished playing before continuing through the workflow. More... | |
async Task< Dictionary< string, object > > | StopPlayback (IRelayWorkflow relayWorkflow, string target) |
async Task< Dictionary< string, object > > | StopPlayback (IRelayWorkflow relayWorkflow, string target, string id) |
async Task< Dictionary< string, object > > | StopPlayback (IRelayWorkflow relayWorkflow, string target, string[] ids) |
async Task< Dictionary< string, object > > | Vibrate (IRelayWorkflow relayWorkflow, string target, int[] pattern) |
Makes the device vibrate in a particular pattern. You can specify how many vibrations you would like, the duration of each vibration in milliseconds, and how long you would like the pauses between each vibration to last in milliseconds. More... | |
async Task< Dictionary< string, object > > | StartTimer (IRelayWorkflow relayWorkflow, int timeout) |
Starts an unnamed timer, meaning this will be the only timer on your device. The timer will fire when it reaches the limit of the 'timeout' parameter. More... | |
async Task< Dictionary< string, object > > | StopTimer (IRelayWorkflow relayWorkflow) |
Stops an unnamed timer. More... | |
async Task< Dictionary< string, object > > | SetTimer (IRelayWorkflow relayWorkflow, string name, string timerType, int timeout, string timeoutType) |
Serves as a named timer that can be either interval or timeout. Allows you to specify the unit of time. More... | |
async Task< Dictionary< string, object > > | ClearTimer (IRelayWorkflow relayWorkflow, string name) |
Clears the specified timer. More... | |
async Task< Dictionary< string, object > > | CreateIncident (IRelayWorkflow relayWorkflow, string originator, string iType) |
Creates an incident that will alert the Relay Dash. More... | |
async Task< Dictionary< string, object > > | ResolveIncident (IRelayWorkflow relayWorkflow, string incidentId, string reason) |
Resolves an incident that was created. More... | |
async Task< Dictionary< string, object > > | SetLed (IRelayWorkflow relayWorkflow, string target, LedEffect ledEffect, LedInfo ledInfo) |
Used for performing actions on the LEDs, such as creating a rainbow, flashing, rotating, etc. More... | |
async Task< Dictionary< string, object > > | SwitchLedOn (IRelayWorkflow relayWorkflow, string target, LedIndex ledIndex, string color) |
Switches on an LED at a particular index to a specified color. More... | |
async Task< Dictionary< string, object > > | SwitchAllLedOn (IRelayWorkflow relayWorkflow, string target, string color) |
Switches all of the LEDs on a device on to a specified color. More... | |
async Task< Dictionary< string, object > > | SwitchAllLedOff (IRelayWorkflow relayWorkflow, string target) |
Switches all of the LEDs on a device off. More... | |
async Task< Dictionary< string, object > > | Rainbow (IRelayWorkflow relayWorkflow, string target, int rotations=-1) |
Switches all of the LEDs on to a configured rainbow pattern and rotates them a specified number of times. More... | |
async Task< Dictionary< string, object > > | Rotate (IRelayWorkflow relayWorkflow, string target, string color="FFFFFF") |
Switches all of the LEDs on a device to a certain color and rotates them a specified number of times. More... | |
async Task< Dictionary< string, object > > | Flash (IRelayWorkflow relayWorkflow, string target, string color="0000FF") |
Switches all of the LEDs on a device to a certain color and flashes them a specified number of times. More... | |
async Task< Dictionary< string, object > > | Breathe (IRelayWorkflow relayWorkflow, string target, string color="0000FF") |
Switches all of the LEDs on a device to a certain color and creates a 'breathing' effect, where the LEDs will slowly light up a specified number of times. More... | |
async Task< Dictionary< string, object > > | SetVar (IRelayWorkflow relayWorkflow, string name, string value) |
Sets a variable with the corresponding name and value. Scope of the variable is from start to end of a workflow. More... | |
async Task< Dictionary< string, object > > | UnsetVar (IRelayWorkflow relayWorkflow, string name) |
Unsets the value of a variable. More... | |
async Task< string > | GetVar (IRelayWorkflow relayWorkflow, string name, string defaultValue=null) |
Retrieves a variable that was set either during workflow registration or through the set_var() function. The variable can be retrieved anywhere within the workflow, but is erased after the workflow terminates. More... | |
async Task< int > | GetNumberVar (IRelayWorkflow relayWorkflow, string name, int defaultValue=-1) |
Retrieves a variable that is an integer type. More... | |
async Task< Dictionary< string, object > > | Listen (IRelayWorkflow relayWorkflow, string target) |
Listens for the user to speak into the device. Utilizes speech to text functionality to interact with the user. More... | |
async Task< Dictionary< string, object > > | Listen (IRelayWorkflow relayWorkflow, string target, string[] phrases) |
Listens for the user to speak into the device. Utilizes speech to text functionality to interact with the user. More... | |
async Task< Dictionary< string, object > > | Listen (IRelayWorkflow relayWorkflow, string target, Language language) |
Listens for the user to speak into the device. Utilizes speech to text functionality to interact with the user. More... | |
async Task< Dictionary< string, object > > | Listen (IRelayWorkflow relayWorkflow, string target, string[] phrases, Language altLanguage, bool transcribe=true, int timeout=60) |
Listens for the user to speak into the device. Utilizes speech to text functionality to interact with the user. More... | |
async Task< string > | Translate (IRelayWorkflow relayWorkflow, string text, Language from, Language to) |
async Task< Dictionary< string, object > > | PlayUnreadInboxMessages (IRelayWorkflow relayWorkflow, string target) |
async Task< int > | GetUnreadInboxSize (IRelayWorkflow relayWorkflow, string target) |
async Task< Dictionary< string, object > > | CancelNotification (IRelayWorkflow relayWorkflow, string originator, string name, string targets) |
Cancels a notification of any type that was sent to a group of devices. More... | |
async Task< Dictionary< string, object > > | Broadcast (IRelayWorkflow relayWorkflow, string targets, string originator, string name, string text) |
Sends out a broadcasted message to a group of devices. The message is played out on all devices, as well as sent to the Relay Dash. More... | |
async Task< Dictionary< string, object > > | Broadcast (IRelayWorkflow relayWorkflow, string targets, string originator, string name, string text, NotificationPushOptions notificationPushOptions) |
Sends out a broadcasted message to a group of devices. The message is played out on all devices, as well as sent to the Relay Dash. More... | |
async Task< Dictionary< string, object > > | CancelBroadcast (IRelayWorkflow relayWorkflow, string originator, string name, string targets) |
Cancels the broadcast that was sent to a group of devices. More... | |
async Task< Dictionary< string, object > > | Alert (IRelayWorkflow relayWorkflow, string targets, string originator, string name, string text) |
Sends out an alert to the specified group of devices and the Relay Dash. More... | |
async Task< Dictionary< string, object > > | Alert (IRelayWorkflow relayWorkflow, string targets, string originator, string name, string text, NotificationPushOptions notificationPushOptions) |
Sends out an alert to the specified group of devices and the Relay Dash. More... | |
async Task< Dictionary< string, object > > | CancelAlert (IRelayWorkflow relayWorkflow, string originator, string name, string targets) |
Cancels an alert that was sent to a group of devices. Particularly useful if you would like to cancel the alert on all devices after one device has acknowledged the alert. More... | |
async Task< string[]> | GetGroupMembers (IRelayWorkflow relayWorkflow, string groupName) |
Returns the members of a particular group. More... | |
async Task< string > | GetDeviceName (IRelayWorkflow relayWorkflow, string target) |
Returns the name of a targeted device. More... | |
async Task< string > | GetDeviceLocation (IRelayWorkflow relayWorkflow, string target, bool refresh) |
Returns the location of a targeted device. More... | |
async Task< string > | GetDeviceId (IRelayWorkflow relayWorkflow, string target) |
Returns the ID of a targeted device. More... | |
async Task< string > | GetDeviceAddress (IRelayWorkflow relayWorkflow, string target, bool refresh) |
Returns the address of a targeted device. More... | |
async Task< float[]> | GetDeviceCoordinates (IRelayWorkflow relayWorkflow, string target, bool refresh) |
Retrieves the coordinates of the device's location. More... | |
async Task< float[]> | GetDeviceLatLong (IRelayWorkflow relayWorkflow, string target, bool refresh) |
Returns the latitude and longitude coordinates of a targeted device. More... | |
async Task< float[]> | GetDeviceIndoorLocation (IRelayWorkflow relayWorkflow, string target, bool refresh) |
Returns the indoor location of a targeted device. More... | |
async Task< int > | GetDeviceBattery (IRelayWorkflow relayWorkflow, string target, bool refresh) |
Returns the battery level of a targeted device. More... | |
async Task< DeviceType > | GetDeviceType (IRelayWorkflow relayWorkflow, string target, bool refresh) |
Returns the device type of a targeted device, i.e. gen 2, gen 3, etc. More... | |
async Task< string > | GetUserProfile (IRelayWorkflow relayWorkflow, string target) |
Returns the user profile of a targeted device. More... | |
async Task< Dictionary< string, object > > | EnableLocation (IRelayWorkflow relayWorkflow, string target) |
Enables the location services on a device. More... | |
async Task< Dictionary< string, object > > | DisableLocation (IRelayWorkflow relayWorkflow, string target) |
Disables the location services on a device. More... | |
async Task< bool > | GetDeviceLocationEnabled (IRelayWorkflow relayWorkflow, string target, bool refresh) |
Returns true if the device's location services are enabled, false otherwise. More... | |
async Task< string[]> | SetUserProfile (IRelayWorkflow relayWorkflow, string target, string username, bool force=false) |
Sets the profile of a user by updating the username. More... | |
async Task< Dictionary< string, object > > | LogUserMessage (IRelayWorkflow relayWorkflow, string message, string target, string category) |
Log an analytic event from a workflow with the specified content and under a specified category. This includes the device who triggered the workflow that called this function. More... | |
async Task< Dictionary< string, object > > | LogMessage (IRelayWorkflow relayWorkflow, string message, string category) |
Log an analytics event from a workflow with the specified content and under a specified category. This does not log the device who triggered the workflow that called this function. More... | |
async Task< Dictionary< string, object > > | SetDeviceName (IRelayWorkflow relayWorkflow, string target, string name) |
Sets the name of a targeted device and updates it on the Relay Dash. The name remains updated until it is set again via a workflow or updated manually on the Relay Dash. More... | |
async Task< Dictionary< string, object > > | SetChannel (IRelayWorkflow relayWorkflow, string target, string channel, string[] targets, bool suppressTts=false, bool disableHomeChannel=false) |
Sets the channel that a device is on. This can be used to change the channel of a device during a workflow, where the channel will also be updated on the Relay Dash. More... | |
async Task< Dictionary< string, object > > | EnableHomeChannel (IRelayWorkflow relayWorkflow, string sourceUri, string target) |
Sets the home channel state on the device to true. More... | |
async Task< Dictionary< string, object > > | EnableHomeChannel (IRelayWorkflow relayWorkflow, string sourceUri, string[] targets) |
async Task< Dictionary< string, object > > | DisableHomeChannel (IRelayWorkflow relayWorkflow, string sourceUri, string target) |
Sets the home channel state on the device to false. More... | |
async Task< Dictionary< string, object > > | DisableHomeChannel (IRelayWorkflow relayWorkflow, string sourceUri, string[] targets) |
async Task< Dictionary< string, object > > | AnswerCall (IRelayWorkflow relayWorkflow, string sourceUri, string callId) |
Answers an incoming call on your device. More... | |
async Task< Dictionary< string, object > > | PlaceCall (IRelayWorkflow relayWorkflow, string sourceUri, string calleeUri) |
Places a call to another device. More... | |
async Task< Dictionary< string, object > > | HangupCall (IRelayWorkflow relayWorkflow, string sourceUri, string callId) |
Ends a call on a device. More... | |
Static Public Member Functions | |
static Dictionary< string, object > | TargetsFromSourceUri (string sourceUri) |
Creates a target object from a source URN. More... | |
static string | GetSourceUriFromStartEvent (IDictionary< string, object > startEvent) |
Parses out and retrieves the source URN from a Start Event More... | |
static async Task< Dictionary< string, object > > | TriggerWorkflow (string accessToken, string refreshToken, string clientId, string workflowId, string subscriberId, string userId, string[] targets, Dictionary< string, string > actionArgs) |
A convenience method for sending an HTTP trigger to the Relay server. This generally would be used in a third-party system to start a Relay workflow via an HTTP trigger and optionally pass data to it with action_args. More... | |
static async Task< Dictionary< string, object > > | FetchDevice (string accessToken, string refreshToken, string clientId, string subscriberId, string userId) |
A convenience method for getting all the details of a device. More... | |
Properties | |
IRelayWebSocketConnector | RelayWebSocketConnector [get] |
The Relay class is responsible for defining the main functionalities that are used within workflows, such as functions for communicating with the device, sending out notifications to groups, handling workflow events, and performing physical actions on the device such as manipulating LEDs and creating vibrations.
|
strong |
|
inline |
|
inline |
|
inline |
Sends out an alert to the specified group of devices and the Relay Dash.
relayWorkflow | the workflow. |
originator | the URN of the device that triggered the alert. |
name | a name for your alert. |
text | the text that you would like to be spoken to the group as your alert. |
targets | the group URN that you would like to send your alert to. |
|
inline |
Sends out an alert to the specified group of devices and the Relay Dash.
relayWorkflow | the workflow. |
originator | the URN of the device that triggered the alert. |
name | a name for your alert. |
text | the text that you would like to be spoken to the group as your alert. |
targets | the group URN that you would like to send your alert to. |
notificationPushOptions | push options for if the alert is sent to the Relay app on a virtual device. Defaults to {}. |
|
inline |
Answers an incoming call on your device.
relayWorkflow | the workflow. |
sourceUri | the device URN which will answer the call. |
callId | the ID of the call to answer. |
|
inline |
Switches all of the LEDs on a device to a certain color and creates a 'breathing' effect, where the LEDs will slowly light up a specified number of times.
relayWorkflow | the workflow. |
target | the interaction URN. |
color | the hex color code you would like to turn the LEDs to. Defaults to '0000FF'. |
|
inline |
Sends out a broadcasted message to a group of devices. The message is played out on all devices, as well as sent to the Relay Dash.
relayWorkflow | the workflow. |
originator | the device URN that triggered the broadcast. |
name | a name for your broadcast. |
text | the text that you would like to be broadcasted to your group. |
targets | the group URN that you would like to broadcast your message to. |
|
inline |
Sends out a broadcasted message to a group of devices. The message is played out on all devices, as well as sent to the Relay Dash.
relayWorkflow | the workflow. |
originator | the device URN that triggered the broadcast. |
name | a name for your broadcast. |
text | the text that you would like to be broadcasted to your group. |
targets | the group URN that you would like to broadcast your message to. |
notificationPushOptions | push options for if the notification is sent to the Relay app on a virtual device. Defaults to {}. |
|
inline |
Cancels an alert that was sent to a group of devices. Particularly useful if you would like to cancel the alert on all devices after one device has acknowledged the alert.
relayWorkflow | the workflow. |
originator | the URN of the device that acknowledged or is cancelling the alert. |
name | the name of the alert. |
targets | the group URN that received the alert. |
|
inline |
Cancels the broadcast that was sent to a group of devices.
relayWorkflow | the workflow. |
originator | the device URN that is cancelling the broadcast. |
name | the name of the broadcast you would like to cancel. |
targets | the group URN that received the broadcast. |
|
inline |
Cancels a notification of any type that was sent to a group of devices.
relayWorkflow | the workflow. |
originator | the device or interacion URN that sent out the message. |
name | the name of the notification to cancel. |
targets | the group URN that received the notification. |
|
inline |
Clears the specified timer.
relayWorkflow | the workflow. |
name | the name of the timer that you would like to clear. |
|
inline |
Creates an incident that will alert the Relay Dash.
relayWorkflow | the workflow. |
originator | the device URN that triggered the incident. |
iType | the type of incident that occurred. |
|
inline |
Sets the home channel state on the device to false.
relayWorkflow | the workflow. |
sourceUri | the URN of the device that called the function. |
target | the device URN whose home channel you would like to set. |
|
inline |
|
inline |
Disables the location services on a device.
relayWorkflow | the workflow. |
target | the device or interaction URN. |
|
inline |
|
inline |
Sets the home channel state on the device to true.
relayWorkflow | the workflow. |
sourceUri | the URN of the device that called the function. |
target | the device URN whose home channel you would like to set. |
|
inline |
|
inline |
Enables the location services on a device.
relayWorkflow | the workflow. |
target | the device or interaction URN. |
|
inline |
Ends an interaction with the user. Triggers an INTERACTION_ENDED event to signify that the user is done interacting with the device.
relayWorkflow | the workflow. |
target | the interaction that you would like to end. |
|
inlinestatic |
A convenience method for getting all the details of a device.
This will return quite a bit of data regarding device configuration and state. The result, if the query was successful, should have a large JSON dictionary.
accessToken | the current access token. Can be a placeholder value and this method will generate a new one and return it. If the original value of the access token passed in here has expired, this method will also generate a new one and return it. |
refreshToken | the permanent refresh token that can be used to obtain a new access_token. The caller should treat the refresh token as very sensitive data, and secure it appropriately. |
clientId | the auth_sdk_id as returned from "relay env". |
subscriberId | the subcriber UUID as returned from "relay whoami". |
userId | the IMEI of the target device, such as 990007560023456. |
|
inline |
Switches all of the LEDs on a device to a certain color and flashes them a specified number of times.
relayWorkflow | the workflow. |
target | the interaction URN. |
color | the hex color code you would like to turn the LEDs to. Defaults to '0000FF'. |
|
inline |
Returns the address of a targeted device.
relayWorkflow | the workflow. |
target | the device or interaction URN. |
refresh | whether you would like to refresh before retrieving the address. Defaults to false. |
|
inline |
Returns the battery level of a targeted device.
relayWorkflow | the workflow. |
target | the device or interaction URN. |
refresh | whether you would like to refresh before retrieving the battery. Defaults to false. |
|
inline |
Retrieves the coordinates of the device's location.
relayWorkflow | the workflow. |
target | the device or interaction URN. |
refresh | whether you would like to refresh before retrieving the coordinates. Defaults to false. |
|
inline |
Returns the ID of a targeted device.
relayWorkflow | the workflow. |
target | the device or interaction URN. |
|
inline |
Returns the indoor location of a targeted device.
relayWorkflow | the workflow. |
target | the device or interaction URN. |
refresh | whether you wouldlike to refresh before retrieving the location. Defaults to false. |
|
inline |
Returns the latitude and longitude coordinates of a targeted device.
relayWorkflow | the workflow. |
target | the device or interaction URN. |
refresh | whether you would like to refresh before retrieving the coordinates. Defaults to false. |
|
inline |
Returns the location of a targeted device.
relayWorkflow | the workflow. |
target | the device or interaction URN. |
refresh | whether you would like to refresh before retrieving the location. Defaults to false. |
|
inline |
Returns true if the device's location services are enabled, false otherwise.
relayWorkflow | the workflow |
target | the device or interaction URN. |
refresh | whether you would like to refresh before retrieving the query information. |
|
inline |
Returns the name of a targeted device.
relayWorkflow | the workflow. |
target | the device or interaction URN. |
|
inline |
Returns the device type of a targeted device, i.e. gen 2, gen 3, etc.
relayWorkflow | the workflow. |
target | the device or interaction URN. |
refresh | whether you would like to refresh before retrieving the device type. |
|
inline |
Returns the members of a particular group.
relayWorkflow | the workflow. |
groupName | the name of the group whose members you would like to retrieve. |
|
inline |
Retrieves a variable that is an integer type.
relayWorkflow | the workflow. |
name | the name of the variable to retrieve. |
defaultValue | the default value for the variable if it does not exist. |
|
inlinestatic |
Parses out and retrieves the source URN from a Start Event
startEvent | the start event |
|
inline |
|
inline |
Returns the user profile of a targeted device.
relayWorkflow | the workflow. |
target | the device or interaction URN. |
|
inline |
Retrieves a variable that was set either during workflow registration or through the set_var() function. The variable can be retrieved anywhere within the workflow, but is erased after the workflow terminates.
relayWorkflow | the workflow. |
name | name of the variable to be retrieved. |
defaultValue | default value of the variable if it does not exist. Defaults to undefined. |
|
inline |
Ends a call on a device.
relayWorkflow | the workflow. |
sourceUri | the device that is hanging up the call. |
callId | the ID of the call to hangup. |
|
inline |
Listens for the user to speak into the device. Utilizes speech to text functionality to interact with the user.
relayWorkflow | the workflow. |
target | the interaction URN. |
|
inline |
Listens for the user to speak into the device. Utilizes speech to text functionality to interact with the user.
relayWorkflow | the workflow. |
target | the interaction URN. |
language | the language that the device is listening for. Defaults to 'en-US'. |
|
inline |
Listens for the user to speak into the device. Utilizes speech to text functionality to interact with the user.
relayWorkflow | the workflow. |
target | the interaction URN. |
phrases | optional phrases that you would like to limit the user's response to. Defualts to none. |
|
inline |
Listens for the user to speak into the device. Utilizes speech to text functionality to interact with the user.
relayWorkflow | the workflow. |
target | the interaction URN. |
phrases | limits the user's response to these phrases. |
altLanguage | the language that the device will listen for. Defaults to 'en-US'. |
transcribe | whether you would like to transcribe. |
timeout | how long to wait for a user's response before timing out. |
|
inline |
Log an analytics event from a workflow with the specified content and under a specified category. This does not log the device who triggered the workflow that called this function.
relayWorkflow | the workflow. |
message | a description for your analytical event. |
category | a category for your analytical event. |
|
inline |
Log an analytic event from a workflow with the specified content and under a specified category. This includes the device who triggered the workflow that called this function.
relayWorkflow | the workflow. |
message | a description for your analytical event. |
target | the URN of a device that triggered this function. Defaults to None. |
category | a category for your analytical event. |
|
inline |
|
inline |
|
inline |
|
inline |
Places a call to another device.
relayWorkflow | the workflow. |
sourceUri | the device that is placing the call. |
calleeUri | the device that you would like to call. |
|
inline |
Plays a custom audio file that was uploaded by the user.
relayWorkflow | the workflow. |
target | the interaction URN. |
filename | the name of the audio file. |
|
inline |
Plays a custom audio file that was uploaded by the user. Waits until the audio file has finished playing before continuing through the workflow.
relayWorkflow | the workflow. |
target | the interaction URN. |
filename | the name of the audio file. |
|
inline |
|
inline |
Switches all of the LEDs on to a configured rainbow pattern and rotates them a specified number of times.
relayWorkflow | the workflow. |
target | the interaction URN. |
rotations | the number of times you would like the rainbow to rotate. Defaults to -1, meaning the rainbow will rotate indefinitely. |
|
inline |
|
inline |
Resolves an incident that was created.
relayWorkflow | the workflow. |
incidentId | the ID of the incident you would like to resolve. |
reason | the reason for resolving the incident. |
|
inline |
Switches all of the LEDs on a device to a certain color and rotates them a specified number of times.
relayWorkflow | the workflow. |
target | the interaction URN. |
color | the hex color code you would like to turn the LEDs to. Defaults to 'FFFFFF'. |
|
inline |
Utilizes text to speech capabilities to make the device 'speak' to the user.
relayWorkflow | the workflow. |
target | the interaction URN. |
text | what you would like the device to say. |
|
inline |
Utilizes text to speech capabilities to make the device 'speak' to the user.
relayWorkflow | the workflow. |
target | the interaction URN. |
text | what you would like the device to say. |
language | the language of the text that is being spoken. Defaults to 'en-US'. |
|
inline |
Utilizes text to speech capabilities to make the device 'speak' to the user. Waits until the text is fully played out on the device before continuing.
relayWorkflow | the workflow. |
target | the interaction URN. |
text | what you would like the device to say. |
|
inline |
Utilizes text to speech capabilities to make the device 'speak' to the user. Waits until the text is fully played out on the device before continuing.
relayWorkflow | the workflow. |
target | the interaction URN. |
text | what you would like the device to say. |
language | the language of the text that is being spoken. Defaults to 'en-US'. |
|
inline |
Sets the channel that a device is on. This can be used to change the channel of a device during a workflow, where the channel will also be updated on the Relay Dash.
relayWorkflow | the workflow. |
target | the device or interaction URN. |
channel | the name of the channel that you would like to set your device to. |
targets | the group URN whose channel you would like to set. |
suppressTts | whether you would like to surpress the text to speech. Defaults to false. |
disableHomeChannel | whether you would like to disable the home channel. Defaults to false. |
|
inline |
Sets the name of a targeted device and updates it on the Relay Dash. The name remains updated until it is set again via a workflow or updated manually on the Relay Dash.
relayWorkflow | the workflow. |
target | the device or interaction URN. |
name | a new name for your device. |
|
inline |
Used for performing actions on the LEDs, such as creating a rainbow, flashing, rotating, etc.
relayWorkflow | the workflow. |
target | the interaction URN. |
ledEffect | effect to perform on the LEDs, can be 'rainbow', 'rotate', 'flash', 'breath', 'static', or 'off'. |
ledInfo | information regarding the actions on the LED, such as the number of rotations, the count, etc. |
|
inline |
Serves as a named timer that can be either interval or timeout. Allows you to specify the unit of time.
relayWorkflow | the workflow. |
name | a name for your timer. |
timerType | can be "timeout" or "interval". Defaults to "timeout" |
timeout | an integer representing when you would like your timer to fire. |
timeoutType | can be "ms", "secs", "mins", or "hrs". Defaults to "secs". |
|
inline |
Sets the profile of a user by updating the username.
relayWorkflow | the workflow. |
target | the device URN whose profile you would like to update. |
username | the updated username for the device. |
force | whether you would like to force this update. Defaults to false. |
|
inline |
Sets a variable with the corresponding name and value. Scope of the variable is from start to end of a workflow.
relayWorkflow | the workflow. |
name | name of the variable to be created. |
value | value that the variable will hold. |
|
inline |
|
inline |
Starts an interaction with the user. Triggers an INTERACTION_STARTED event and allows the user to interact with the device via functions that require an interaction URN.
relayWorkflow | the workflow. |
target | the device that you would like to start an interaction with. |
name | a name for your interaction. |
options | can be color, home channel, or input types. |
|
inline |
Starts an unnamed timer, meaning this will be the only timer on your device. The timer will fire when it reaches the limit of the 'timeout' parameter.
relayWorkflow | the workflow. |
timeout | the number of seconds you would like to wait until the timer fires. |
|
inline |
|
inline |
|
inline |
|
inline |
Stops an unnamed timer.
relayWorkflow | the workflow. |
|
inline |
Switches all of the LEDs on a device off.
relayWorkflow | the workflow. |
target | the interaction URN. |
|
inline |
Switches all of the LEDs on a device on to a specified color.
relayWorkflow | the workflow. |
target | the interaction URN. |
color | the hex color code you would like the LEDs to be. |
|
inline |
Switches on an LED at a particular index to a specified color.
relayWorkflow | the workflow. |
target | the interaction URN. |
ledIndex | the index of the LED, numbered 1-12. |
color | the hex color code that you would like to set the LED to. |
|
inlinestatic |
Creates a target object from a source URN.
sourceUri | source uri that will be used to create a target. |
|
inline |
Terminates a workflow. This method is usually called after your workflow has completed and you would like to end the workflow by calling end_interaction(), where you can then terminate the workflow.
relayWorkflow | the workflow. |
|
inline |
|
inlinestatic |
A convenience method for sending an HTTP trigger to the Relay server. This generally would be used in a third-party system to start a Relay workflow via an HTTP trigger and optionally pass data to it with action_args.
If the access_token has expired and the request gets a 401 response a new access_token will be automatically generated via the refreshToken and the request will be resubmitted with the new accessToken. Otherwise the refresh token won't be used.
accessToken | the current access token. Can be a placeholder value and this method will generate a new one and return it. |
refreshToken | the permanent refresh token that can be used to obtain a new access token. The caller should treat the refresh token as very sensitive data, and secure it appropriately. |
clientId | the auth_sdk_id as returned from "relay env". |
workflowId | the workflow_id as returned from "relay workflow list". Usually starts with "wf_". |
subscriberId | the subcriber UUID as returned from "relay whoami". |
userId | the IMEI of the target device, such as 990007560023456. |
targets | optional targets consisting of an array of the device IMEIs that you would like to run the triggered workflow on. |
actionArgs | a dict of any key/value arguments you want to pass in to the workflow that gets started by this trigger. |
|
inline |
Unsets the value of a variable.
relayWorkflow | the workflow. |
name | the name of the variable whose value you would like to unset. |
|
inline |
Makes the device vibrate in a particular pattern. You can specify how many vibrations you would like, the duration of each vibration in milliseconds, and how long you would like the pauses between each vibration to last in milliseconds.
relayWorkflow | the workflow. |
target | the interaction URN. |
pattern | an array representing the pattern of your vibration. Defaults to none. |
|
get |