Tekos
  • General overview
  • Tekos Chat Workspace
    • Tekos Chat
      • Design and Interface of chat
      • Apps
    • Tekos Chat FAQ
      • How to create a workspace for my team?
      • How to invite members to my workspace?
      • What is a room and to create it?
      • Public or private room? What is the difference?
      • What is Roles & Permissions?
      • What is power level and how does it work?
      • How do I know if my message was read?
      • How can I share a file?
      • How to search messages and/or files.
      • How do I make video calls?
      • How do I change my profile settings?
      • Notifications settings.
      • Room settings.
      • How to leave a room?
      • Lab features
  • Flow Builder
    • Tekos Flow
      • Editor UI
      • Building your first flow
        • Import / Export Flow
      • Flow.tekos library
      • Subflows
  • Omnichannel Live Chat
    • Overview
    • Channels
      • WhatsApp
  • Building Apps
    • Building Apps
      • Connecting flow with the chat
      • HTTP Requests
        • Handle query parameters passed to an HTTP endpoint
        • Handle url parameters in an HTTP endpoint
    • Chat Surfaces
      • Modals - Adaptive Cards
        • Building An Adaptive Card
        • Basic usage of Cards
        • Variables in the Cards
        • Action Buttons
      • Messages
        • Instant Messaging
          • Message types
        • Getting the Messages
        • Getting events for a room
        • Messages webhook
    • Interactivity in the Chat
      • Shortcuts
      • Slash Commands
      • Buttons
Powered by GitBook
On this page

Was this helpful?

  1. Building Apps
  2. Building Apps
  3. HTTP Requests

Handle query parameters passed to an HTTP endpoint

PreviousHTTP RequestsNextHandle url parameters in an HTTP endpoint

Last updated 4 years ago

Was this helpful?

Problem

You want to access the query parameters passed to an HTTP endpoint, such as:

http://example.com/hello-query?name=Nick

Solution

Use the msg.req.query property of the message sent by the HTTP In node to access the parameters.

Example

[~]$ curl http://localhost:1880/hello-query?name=Nick
<html>
    <head></head>
    <body>
        <h1>Hello Nick!</h1>
    </body>
</html>

Discussion

The msg.req.query property is an object of key/value pairs for each query parameter.

In the above example, a request to /hello-query?name=Nick&colour=blue results in the property containing:

{
    "name": "Nick",
    "colour": "blue"
}

If there are multiple query parameters with the same name, they will be provided as an array. For example, /hello-query?colour=blue&colour=red:

{
    "colour": ["blue","red"]
}