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
  • Using HTTP In & HTTP Response
  • Using HTTP Request

Was this helpful?

  1. Building Apps
  2. Building Apps

HTTP Requests

Basic explanation of HTTP Requests in the tekos flow.

PreviousConnecting flow with the chatNextHandle query parameters passed to an HTTP endpoint

Last updated 4 years ago

Was this helpful?

Now days all apps use the HTTP Requests and we either, our whole ecosystem is based on the requests.

In this tutorial we are going to showcase some example usage of the requests in the flow.

The Tekos Flow comes with three basic HTTP nodes which are:

  1. HTTP Request - Sends HTTP requests and returns the response.

  2. HTTP In - Creates an HTTP end-point for creating web services.

  3. HTTP Response - Sends responses back to requests received from an HTTP Input node

It is possible to even create web pages using the tekos flow.

Remember to check the HELP tab of the HTTP nodes in the flow editor.

List of available HTTP Methods:

Method

Description

GET

The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.

HEAD

The HEAD method asks for a response identical to that of a GET request, but without the response body.

POST

The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.

PUT

The PUT method replaces all current representations of the target resource with the request payload.

DELETE

The DELETE method deletes the specified resource.

CONNECT

The CONNECT method establishes a tunnel to the server identified by the target resource.

OPTIONS

The OPTIONS method is used to describe the communication options for the target resource.

TRACE

The TRACE method performs a message loop-back test along the path to the target resource.

PATCH

The PATCH method is used to apply partial modifications to a resource.

Using HTTP In & HTTP Response

Both of those nodes are often necessary to properly configure an endpoint

Let's create an POST endpoint in my flow to adres /tekos/documentation that just responses with payload "It's working!" and code 200 - OK.

Above endpoint will be available under my flow instance adres "https://instance-name.tekos.co/tekos/documentation"

Using HTTP Request

This node allows you to do a HTTP Request to any service endpoint. We can use our previously created one using the HTTP In & HTTP Response, but let's use function node instead of change, and in this function we will enter simple command to iterate the number stored in the payload.

msg.payload++
return msg;

While we have our endpoint prepared let's create an flow with POST Request

As you can see we have an inject node to manually trigger the request, an function node, http request and a debug node, don't mind the change node it is just to hide my instance name.

Function node
msg.url = "https://instance-name.tekos.co/tekos/documentation"
msg.headers ={
    "Content-type": "application/json"
}
msg.payload = 10
return msg;

We have also set the msg.payload value to 10, while our endpoint have a function to iterate the msg.payload so the response from this endpoint should be 11. Let's take a look

Of course this is just a basic example of how to create endpoint and send an http request to it.

Check the full list of available response codes

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
Example HTTP Request with response