Support Center

WalkMe API

Last Updated: Jul 06, 2017 03:59PM PDT

Build

WalkMe APIs

WalkMe APIs enable you to incorporate WalkMe actions, such as opening the Player Menu or starting a Walk-Thru. APIs can be used to launch WalkMe items directly from your site and allows you to re-purpose elements that already exist on your page.
 

Article Contents

 

The Short Version

WalkMe APIs can be used after the Snippet has been added to your environment. APIs will help you integrate WalkMe actions directly onto your website elements, such as a button or a drop down.

APIs work well in situations in which you are trying to repurpose an existing website element. The WalkMe API call to open the Player Menu can be integrated into a help icon that is no longer being used or redirects to an old page. By using the API, you can integrate your performance support options such as Walk-Thrus and Resources in to your site. WalkMe API can also start Walk-Thrus with existing tooltips. You can replace your current guidance with Walk-Thrus that are easy to update.
 

How It Works

WalkMe API uses the same actions the WalkMe player does. By default, WalkMe calls on the server to display WalkMe items. Using API is equivalent to the action of starting a Walk-Thru from the Player Menu, with the exception that the action is hard coded on your environment. WalkMe still communicates with the server to load the item itself, but the call is based from an element on your site.

WalkMe includes APIs which allow you to perform an action, such as start or stop a Walk-Thru, and monitor events which mark specific action within WalkMe, such as the menu opening and closing.

APIs can be used in combination with events.
For example, we can use an API call to start a Walk-Thru after the menu has been opened:
window.walkme_player_event = function(event) {
      if (event.Type == "BeforeMenuOpen") {
         WalkMeAPI.startWalkthruByIndex(X)
   }
}


Multiple calls can work together to perform more advanced actions. For example, we can verify that the menu is opened before opening it:
if (WalkMePlayerAPI.isMenuOpen() == false) {
    WalkMePlayerAPI.toggleMenu();
}


 

Types Of API Calls

Check Menu Status WalkMePlayerAPI.isMenuOpen();
Toggle Menu WalkMePlayerAPI.toggleMenu();
Enable/Disable WalkMe logs WalkMeAPI.log.enable()
Track Goals WalkMeAPI.enableLogs(3)
Untrack goals in logs WalkMeAPI.log.untrack('goals')
Start a Walk-Thru from the console WalkMeAPI.startWalkthruById(XXXXX)
Start a Walk-Thru by its index WalkMeAPI.startWalkthruByIndex(1)
Stop running a Walk-Thru WalkMeAPI.stopWalkthru()
Get a list of Live Walk-Thrus WalkMeAPI.getWalkthrus()
View onboarding tasks WalkMeAPI.getTasks()
Get a List of Live Smart Walk-Thrus WalkMeAPI.getFlows ()
Start a Smart Walk-Thrus WalkMeAPI.startFlowById(XXXXX,XXXXX)
*Use Smart Walk-Thru ID followed by the step Node ID.
Stop a Smart Walk-Thru WalkMeAPI.stopFlow(XXXXX)
 

Entering APIs in the Console
WalkMe APIs can be tested and used by entering them into the browser Console while the editor is in preview mode. The Snippet must be embedded on your site, or the editor must be open in order to use APIs through the console. For example, you can check how many Walk-Thrus are currently Live on your implementation.
  1. Open the Console by pressing F12 on your keyboard.
  2. Enter the API command into the console input line
 
Finding Walk-Thru ID and Index
The Walk-Thru ID can be found by following these steps:
1. Open the Walk-Thru
2. Open the Walk-Thru Settings
3. Open Advanced Settings
4. Find the Walk-Thru ID

 The Walk-Thru and ID can also be found with the API Command:  WalkMeAPI.getWalkthrus()
This API will retrieve all published Walk-Thrus in the environment and return the ID and Index.



Types Of Events

To Listen to a WalkMe event, include a callback function in the the windows scope. WalkMe will try to call the function every time an event is fired. The function needs to be declared before the event happens and can be declared even before WalkMe is loaded into the page. There are two different functions that can be written in order to listen to the events:
  • window.menu_event : This will have all the events associated with the Menu
  • window.walkme_event: Events related to WalkMe items and internal WalkMe functionality

In the example below we are waiting for a user to complete a task before displaying an alert.
 
var importantTaskId = 123456;
window.walkme_event = function(eventData) {
    if (eventData.Type === "SurveyCompleted") {
        if (eventData.ExtraData.TaskId == importantTaskId) {
            alert("Important task completed");
        }
    }
}

If you need to listen to multiple events, you need to do it inside the same function like so:
 
window.menu_event = function(eventData) {
     if (eventData.Type === "BeforeMenuOpen") {
       console.log("I'm about to open the menu")
}

else if (eventData.Type === "AfterMenuOpen") {
     console.log("I warned you... the menu is open.");
   }
}
 
Before menu is Opened BeforeMenuOpen
After menu is Opened AfterMenuOpen
Before menu is Closed BeforeMenuClose
After menu is Closed AfterMenuClose
Walk-Thru started WalkthruSelected
Player finish initialization PlayerInitComplete
Next Step Shown NextStepShown
Launcher is Shown LauncherIsShown
Task Completed TaskCompleted
Tasks Loaded TasksLoaded
Launcher Clicked LauncherClicked
Survey Completed SurveyCompleted
Survey Played Survey Played
Balloon Created BalloonCreated
Walk-Thru Stopped Accidentally WalkthruAborted
User Clicks X UserStoppedWalkthru
User Stops Walk-Thru UserStoppedWalthruAfterStop
Walk-Thru Failed to Start WalkthruFailedToStart
Back Button Clicked BackButtonClicked
Next Button Clicked NextButtonClicked
Done Button Clicked DoneButtonClicked
BBcode Link Clicked BBCodeLinkClicked

Contact Us

  • Email Us
  • FAQ
  • Call Us

    Toll Free (US Number) 1-855-4-WalkMe (1-855-492-5563)
http://assets1.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete