Kogno
  • Introduction
  • Getting Started
    • Configuration
    • Starting the Server
    • Messenger Configuration
    • Telegram Configuration
    • WhatsApp Configuration
    • NLP Configuration
  • Conversation Class
  • Contexts
    • Blocks
      • before_anything
      • postback
      • deep_link
      • command
      • any_attachment
      • regular_expression
      • keyword
      • any_number
      • any_text
      • intent
      • entity
      • membership
      • recurring_notification
      • everything_else
      • after_all
    • Sub Contexts
    • Routing
    • Sequences
    • Conversational Forms
  • Replies / Notifications
    • text
    • button
    • quick_reply
    • raw
    • list
    • carousel
    • url
    • typing
    • image
    • video
    • html
    • markdown
    • contact
    • location
    • recurring_notification_request
    • messenger_generic_template
    • whatsapp_template
  • Templates
  • Models
    • User model
  • Scheduled Messages
  • Telegram Inline Query
  • Command Line
  • Global Methods
  • Internationalization
Powered by GitBook
On this page
  • deep_link(&block)
  • Platforms
  • Example Links
  • Usage
  • value param

Was this helpful?

  1. Contexts
  2. Blocks

deep_link

If it's defined, this action block will be executed if the chat was opened through a link that contains a deep-link query string parameter.

PreviouspostbackNextcommand

Last updated 2 years ago

Was this helpful?

The query string parameters are ref for Messenger and start for Telegram.

To learn more, please read the official documentation from and .

deep_link(&block)

Platforms

Platform
Supported

Messenger

WhatsApp

Telegram

Example Links

Messenger:

Telegram:

Usage

class MainContext < Conversation

  def blocks

    deep_link do |value|
      @reply.text("You just clicked on a link with the value #{value}!")
    end

  end
  
end

value param

This param contains the value passed in the query string, for the example links above, the value is "test"

Routing to Context

Messenger: ?ref=context_name_some_value

Telegram: ?start=context_name_some_value

A deep-link can be handled by other context different than the , simply by passing the name of an existing context as a part of the parameter value:

Read more about this in .

Messenger
Telegram
https://m.me/kogno.io?ref=test
https://t.me/KognoBot?start=test
default context
Context Routing chapter