API reference

From WalkMe
Jump to: navigation, search

Integrating the Walk-Thru Player into your website does not require any programming. An API is provided for advanced usage, such as creating your own Walk-Thru’s menu or triggering Walk-Thru’s programmatically.

In order to use the API, the WalkMe script must be loaded. Note that you can load the script without displaying the Walk-Thru’s menu by changing the "Player Shape" setting to "None" in the "Customize Player" page.

When the WalkMe script is loaded, the WalkMeAPI object is instantiated and ready to be used.


WalkMeAPI Methods:

getWalkthrus(calcCondition)

Returns an array of the available Walk-Thru’s. Each Walk-Thru contains:

  • ID - the unique identifier of the Walk-Thru.
  • Index - the index of the Walk-Thru in the Walk-Thru‘s list.
  • Name - the name of the Walk-Thru.
  • Visible - if the Walk-Thru is visible, as set in the Editor.
  • CustomField1 - This field can be defined in the Editor under the Walk-Thru's "Advanced" tab. For example, it can be useful when you want to group the Walk-Thru’s to several groups and display each one to different users.
  • ConditionsPassed - exists only if calcCondition=true. It indicates whether the Walk-Thru should be displayed per the conditions set in the recorder. This check can be time-consuming (in case of first step condition), so it is not enabled by default.


startWalkthruById(Id, fromStep)

Starts playing a Walk-Thru by its id. Returns true on success, false otherwise. The fromStep parameter is optional. If it is set, then the Walk-Thru will start from a specific step index (zero based).


startWalkthruByIndex(index, fromStep)

Starts playing a Walk-Thru by its index in the Walk-Thru’s list (zero based). Returns true on success, false otherwise. It is recommended to use startWalkthruById instead, since the id uniquely identifies a Walk-Thru. The fromStep parameter is optional. If it is set, then the Walk-Thru will start from a specific step index (zero based).


canStartWalkthru(id, fromStep)

Checks if a Walk-Thru can start playing. A Walk-Thru can start playing if its first step exists on the page (or if other advanced features are used). Returns true on success, false otherwise.


setWalkthruVisibility(id, visible)

Sets the visibility (whether the Walk-Thru will be displayed in the menu) of a Walk-Thru. visible = true or false. Returns true on success, false otherwise. Note: A Walk-Thru will be displayed in the menu if it is set to visible using the API or Editor AND if its conditions (if exists) passed.


stopWalkthru()

If a Walk-Thru is currently running, it will stop it.

Callbacks

walkme_ready()

If you implement this function, it will be called once the WalkMe script was loaded and the API is ready to be used.


walkme_event(eventData)

If you implement this function, it will be called for any WalkMe event.

eventData is an Object containing:

  • WalkthruId - Current walkthru ID.
  • StepIndex - The step index the event is related to.
  • Type - Event type. Currently supported:
    • NextButtonClicked - Called when the user clicked the "next" button.
    • DoneButtonClicked - Called when the user clicked the "done" button (the "next" button of the last step).
    • BeforeNewStepShown - Called before a new step is shown.
    • NewStepShown - Called when a new step is shown.
    • WalkthruStopped - Called when the walkthru stopped. For example: when the user did not follow the walkthru.
    • WalkthruCompleted - Called after the last step in the walkthru has ended.
    • UserStoppedWalkthru - Called when the user clicked "x" on the balloon.
    • UserStoppedWalkthruAfterStop - Called when the user clicked "x" on the balloon, but after the walk-thru was stopped. Useful if you want to start another walk-thru when the user stops the current one.
    • WelcomeStepCancelPressed - Called when the user clicked cancel on the welcome step.
    • WelcomeStepStartPressed - Called when the user clicked start on the welcome step.


Code Samples:

Very simple Walk-Thru menu

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox