> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreflux.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Postman Echo REST API

> Client-mode REST API connector that calls the public Postman Echo API from MQTT

Technical Preview

## Overview

[Postman Echo](https://postman-echo.com/) is a public HTTP echo service. Use this client-mode `REST_API` connector to prove MQTT-to-HTTP wiring (methods, path placeholders, headers, cookies, status codes, and response topics) without an API key.

> [!TIP]
>
> Public `GET /get` does not need a token. The template still sends `Authorization: Bearer {value.json.api_token}` so the header pattern matches other apps. Leave `api_token` empty for demos, or drop that header.

## Basic Syntax

```lot wrap theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
# Coreflux REST_API template — Postman Echo
# Generated from OpenAPI; credentials are placeholders only.
# Docs: https://docs.coreflux.org/latest/lot-language/routes/rest-api-routes

DEFINE ROUTE PostmanEchoRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://postman-echo.com"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '30'
        WITH DEFAULT_CONTENT_TYPE "application/json"
        # Optional: WITH USERNAME "YOUR_USER" / WITH PASSWORD GET SECRET "APP_PASSWORD"
    ADD EVENT Get
        WITH SOURCE_TOPIC "integrations/postman-echo/request/Get"
        WITH DESTINATION_TOPIC "integrations/postman-echo/response/Get"
        WITH METHOD "GET"
        WITH ENDPOINT "/get"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
    ADD EVENT Post
        WITH SOURCE_TOPIC "integrations/postman-echo/request/Post"
        WITH DESTINATION_TOPIC "integrations/postman-echo/response/Post"
        WITH METHOD "POST"
        WITH ENDPOINT "/post"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
        WITH BODY "{payload}"
    ADD EVENT Put
        WITH SOURCE_TOPIC "integrations/postman-echo/request/Put"
        WITH DESTINATION_TOPIC "integrations/postman-echo/response/Put"
        WITH METHOD "PUT"
        WITH ENDPOINT "/put"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
        WITH BODY "{payload}"
    ADD EVENT Delete
        WITH SOURCE_TOPIC "integrations/postman-echo/request/Delete"
        WITH DESTINATION_TOPIC "integrations/postman-echo/response/Delete"
        WITH METHOD "DELETE"
        WITH ENDPOINT "/delete"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
    ADD EVENT Headers
        WITH SOURCE_TOPIC "integrations/postman-echo/request/Headers"
        WITH DESTINATION_TOPIC "integrations/postman-echo/response/Headers"
        WITH METHOD "GET"
        WITH ENDPOINT "/headers"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
    ADD EVENT Statuscode
        WITH SOURCE_TOPIC "integrations/postman-echo/request/Statuscode"
        WITH DESTINATION_TOPIC "integrations/postman-echo/response/Statuscode"
        WITH METHOD "GET"
        WITH ENDPOINT "/status/{value.json.code}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
    ADD EVENT Timenow
        WITH SOURCE_TOPIC "integrations/postman-echo/request/Timenow"
        WITH DESTINATION_TOPIC "integrations/postman-echo/response/Timenow"
        WITH METHOD "GET"
        WITH ENDPOINT "/time/now"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
    ADD EVENT Cookies
        WITH SOURCE_TOPIC "integrations/postman-echo/request/Cookies"
        WITH DESTINATION_TOPIC "integrations/postman-echo/response/Cookies"
        WITH METHOD "GET"
        WITH ENDPOINT "/cookies"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.api_token}"
```

## Events

| Event | Method | Endpoint | Request topic | Response topic |
| - | - | - | - | - |
| Get | GET | `/get` | `integrations/postman-echo/request/Get` | `integrations/postman-echo/response/Get` |
| Post | POST | `/post` | `integrations/postman-echo/request/Post` | `integrations/postman-echo/response/Post` |
| Put | PUT | `/put` | `integrations/postman-echo/request/Put` | `integrations/postman-echo/response/Put` |
| Delete | DELETE | `/delete` | `integrations/postman-echo/request/Delete` | `integrations/postman-echo/response/Delete` |
| Headers | GET | `/headers` | `integrations/postman-echo/request/Headers` | `integrations/postman-echo/response/Headers` |
| Statuscode | GET | `/status/{value.json.code}` | `integrations/postman-echo/request/Statuscode` | `integrations/postman-echo/response/Statuscode` |
| Timenow | GET | `/time/now` | `integrations/postman-echo/request/Timenow` | `integrations/postman-echo/response/Timenow` |
| Cookies | GET | `/cookies` | `integrations/postman-echo/request/Cookies` | `integrations/postman-echo/response/Cookies` |

## Auth

None required. Base address is `https://postman-echo.com`. Optional Bearer token is a placeholder only. Prefer `GET SECRET` if you later point the connector at a private echo. Never commit real tokens.

## Try it

1. Add the connector on a lab broker (`-addRoute` with the LoT above).
2. Publish `{}` to `integrations/postman-echo/request/Get`.
3. Subscribe to `integrations/postman-echo/response/Get`. Postman Echo echoes the request as JSON.
4. Status check: publish `{"code":"200"}` to `integrations/postman-echo/request/Statuscode`.
5. POST/PUT: publish a JSON body to `integrations/postman-echo/request/Post` or `.../Put`. The connector sends it as `{payload}`.

> [!NOTE]
>
> Direct HTTP check: `GET https://postman-echo.com/get` returns HTTP 200. A broker MQTT round-trip was not run for this template.

## Related

* [REST API Connectors](/latest/lot-language/routes/rest-api-routes)
* [REST API Apps](/latest/lot-language/routes/rest-api-apps)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.